@@ -893,29 +893,29 @@ struct Document
893
893
%pythoncode%{@property%}
894
894
PyObject *pageCount()
895
895
{
896
- int pc = 0 ;
896
+ PyObject *ret ;
897
897
fz_try(gctx) {
898
- pc = fz_count_pages(gctx, (fz_document *) $self);
898
+ ret = Py_BuildValue("i", fz_count_pages(gctx, (fz_document *) $self) );
899
899
}
900
900
fz_catch(gctx) {
901
901
return NULL;
902
902
}
903
- return Py_BuildValue("i", pc) ;
903
+ return ret ;
904
904
}
905
905
906
906
FITZEXCEPTION(chapterCount, !result)
907
907
CLOSECHECK0(chapterCount, """Number of chapters.""")
908
908
%pythoncode%{@property%}
909
909
PyObject *chapterCount()
910
910
{
911
- int pc=0 ;
911
+ PyObject *ret ;
912
912
fz_try(gctx) {
913
- pc = fz_count_chapters(gctx, (fz_document *) $self);
913
+ ret = Py_BuildValue("i", fz_count_chapters(gctx, (fz_document *) $self) );
914
914
}
915
915
fz_catch(gctx) {
916
916
return NULL;
917
917
}
918
- return Py_BuildValue("i", pc) ;
918
+ return ret ;
919
919
}
920
920
921
921
FITZEXCEPTION(lastLocation, !result)
@@ -939,9 +939,9 @@ struct Document
939
939
CLOSECHECK0(chapterPageCount, """Page count of chapter.""")
940
940
PyObject *chapterPageCount(int chapter)
941
941
{
942
- int chapters = fz_count_chapters(gctx, (fz_document *) $self);
943
942
int pages = 0;
944
943
fz_try(gctx) {
944
+ int chapters = fz_count_chapters(gctx, (fz_document *) $self);
945
945
if (chapter < 0 || chapter >= chapters)
946
946
THROWMSG("bad chapter number");
947
947
pages = fz_count_chapter_pages(gctx, (fz_document *) $self, chapter);
0 commit comments