summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/poppler-page-renderer.cpp10
-rw-r--r--cpp/poppler-page.cpp26
-rw-r--r--fofi/FoFiBase.cc36
-rw-r--r--fofi/FoFiBase.h22
-rw-r--r--fofi/FoFiIdentifier.cc152
-rw-r--r--fofi/FoFiTrueType.cc84
-rw-r--r--fofi/FoFiTrueType.h18
-rw-r--r--fofi/FoFiType1.cc32
-rw-r--r--fofi/FoFiType1.h4
-rw-r--r--fofi/FoFiType1C.cc268
-rw-r--r--fofi/FoFiType1C.h50
-rw-r--r--glib/poppler-action.cc6
-rw-r--r--glib/poppler-document.cc4
-rw-r--r--glib/poppler-form-field.cc2
-rw-r--r--glib/poppler-input-stream.cc18
-rw-r--r--glib/poppler-input-stream.h12
-rw-r--r--glib/poppler-page.cc44
-rw-r--r--glib/poppler-structure-element.cc4
-rw-r--r--goo/FixedPoint.cc8
-rw-r--r--goo/FixedPoint.h4
-rw-r--r--goo/GooString.cc52
-rw-r--r--goo/GooString.h20
-rw-r--r--goo/GooTimer.h2
-rw-r--r--goo/gdir.h12
-rw-r--r--goo/gfile.cc10
-rw-r--r--goo/gtypes.h12
-rw-r--r--poppler/Annot.cc300
-rw-r--r--poppler/Annot.h80
-rw-r--r--poppler/Array.cc6
-rw-r--r--poppler/Array.h2
-rw-r--r--poppler/BuiltinFont.cc6
-rw-r--r--poppler/BuiltinFont.h2
-rw-r--r--poppler/CMap.cc18
-rw-r--r--poppler/CMap.h4
-rw-r--r--poppler/CairoFontEngine.cc62
-rw-r--r--poppler/CairoFontEngine.h26
-rw-r--r--poppler/CairoOutputDev.cc206
-rw-r--r--poppler/CairoOutputDev.h166
-rw-r--r--poppler/CairoRescaleBox.cc6
-rw-r--r--poppler/CairoRescaleBox.h2
-rw-r--r--poppler/Catalog.cc54
-rw-r--r--poppler/Catalog.h10
-rw-r--r--poppler/CharCodeToUnicode.cc24
-rw-r--r--poppler/CharCodeToUnicode.h6
-rw-r--r--poppler/CurlPDFDocBuilder.cc8
-rw-r--r--poppler/CurlPDFDocBuilder.h2
-rw-r--r--poppler/DCTStream.cc4
-rw-r--r--poppler/DCTStream.h4
-rw-r--r--poppler/DateInfo.cc14
-rw-r--r--poppler/DateInfo.h2
-rw-r--r--poppler/Decrypt.cc96
-rw-r--r--poppler/Decrypt.h20
-rw-r--r--poppler/Dict.cc12
-rw-r--r--poppler/Dict.h6
-rw-r--r--poppler/FileSpec.cc16
-rw-r--r--poppler/FileSpec.h10
-rw-r--r--poppler/FlateEncoder.cc20
-rw-r--r--poppler/FlateEncoder.h10
-rw-r--r--poppler/FlateStream.cc4
-rw-r--r--poppler/FlateStream.h2
-rw-r--r--poppler/FontInfo.cc6
-rw-r--r--poppler/FontInfo.h12
-rw-r--r--poppler/Form.cc58
-rw-r--r--poppler/Form.h22
-rw-r--r--poppler/Function.cc126
-rw-r--r--poppler/Function.h32
-rw-r--r--poppler/Gfx.cc240
-rw-r--r--poppler/Gfx.h48
-rw-r--r--poppler/GfxFont.cc166
-rw-r--r--poppler/GfxFont.h46
-rw-r--r--poppler/GfxState.cc168
-rw-r--r--poppler/GfxState.h150
-rw-r--r--poppler/GlobalParams.cc168
-rw-r--r--poppler/GlobalParams.h54
-rw-r--r--poppler/GlobalParamsWin.cc188
-rw-r--r--poppler/Hints.cc56
-rw-r--r--poppler/Hints.h8
-rw-r--r--poppler/JArithmeticDecoder.cc12
-rw-r--r--poppler/JArithmeticDecoder.h8
-rw-r--r--poppler/JBIG2Stream.cc142
-rw-r--r--poppler/JBIG2Stream.h42
-rw-r--r--poppler/JPEG2000Stream.cc28
-rw-r--r--poppler/JPEG2000Stream.h4
-rw-r--r--poppler/JPXStream.cc412
-rw-r--r--poppler/JPXStream.h52
-rw-r--r--poppler/Lexer.cc56
-rw-r--r--poppler/Lexer.h6
-rw-r--r--poppler/Linearization.cc4
-rw-r--r--poppler/Link.cc62
-rw-r--r--poppler/Link.h76
-rw-r--r--poppler/LocalPDFDocBuilder.cc8
-rw-r--r--poppler/LocalPDFDocBuilder.h2
-rw-r--r--poppler/MarkedContentOutputDev.cc12
-rw-r--r--poppler/MarkedContentOutputDev.h12
-rw-r--r--poppler/Movie.cc22
-rw-r--r--poppler/Movie.h16
-rw-r--r--poppler/Object.h60
-rw-r--r--poppler/OptionalContent.cc22
-rw-r--r--poppler/OptionalContent.h6
-rw-r--r--poppler/Outline.cc4
-rw-r--r--poppler/Outline.h6
-rw-r--r--poppler/OutputDev.cc30
-rw-r--r--poppler/OutputDev.h96
-rw-r--r--poppler/PDFDoc.cc222
-rw-r--r--poppler/PDFDoc.h72
-rw-r--r--poppler/PDFDocBuilder.h4
-rw-r--r--poppler/PSOutputDev.cc584
-rw-r--r--poppler/PSOutputDev.h228
-rw-r--r--poppler/PSTokenizer.cc20
-rw-r--r--poppler/PSTokenizer.h2
-rw-r--r--poppler/Page.cc74
-rw-r--r--poppler/Page.h50
-rw-r--r--poppler/PageLabelInfo.cc24
-rw-r--r--poppler/PageLabelInfo.h4
-rw-r--r--poppler/PageLabelInfo_p.h4
-rw-r--r--poppler/PageTransition.cc6
-rw-r--r--poppler/PageTransition.h8
-rw-r--r--poppler/Parser.cc16
-rw-r--r--poppler/Parser.h10
-rw-r--r--poppler/PreScanOutputDev.cc128
-rw-r--r--poppler/PreScanOutputDev.h60
-rw-r--r--poppler/Rendition.cc26
-rw-r--r--poppler/Rendition.h18
-rw-r--r--poppler/SecurityHandler.cc24
-rw-r--r--poppler/SecurityHandler.h20
-rw-r--r--poppler/SplashOutputDev.cc408
-rw-r--r--poppler/SplashOutputDev.h156
-rw-r--r--poppler/StdinPDFDocBuilder.cc8
-rw-r--r--poppler/StdinPDFDocBuilder.h2
-rw-r--r--poppler/Stream.cc568
-rw-r--r--poppler/Stream.h226
-rw-r--r--poppler/StructElement.cc214
-rw-r--r--poppler/StructElement.h34
-rw-r--r--poppler/StructTreeRoot.cc2
-rw-r--r--poppler/TextOutputDev.cc260
-rw-r--r--poppler/TextOutputDev.h130
-rw-r--r--poppler/UnicodeMap.cc8
-rw-r--r--poppler/UnicodeMap.h10
-rw-r--r--poppler/UnicodeTypeTable.cc32
-rw-r--r--poppler/UnicodeTypeTable.h12
-rw-r--r--poppler/ViewerPreferences.cc12
-rw-r--r--poppler/ViewerPreferences.h24
-rw-r--r--poppler/XRef.cc270
-rw-r--r--poppler/XRef.h74
-rw-r--r--qt5/src/ArthurOutputDev.cc30
-rw-r--r--qt5/src/ArthurOutputDev.h28
-rw-r--r--qt5/src/poppler-annotation-helper.h2
-rw-r--r--qt5/src/poppler-annotation.cc2
-rw-r--r--qt5/src/poppler-form.cc4
-rw-r--r--qt5/src/poppler-link-extractor-private.h6
-rw-r--r--qt5/src/poppler-link-extractor.cc2
-rw-r--r--qt5/src/poppler-movie.cc2
-rw-r--r--qt5/src/poppler-page-private.h4
-rw-r--r--qt5/src/poppler-page.cc84
-rw-r--r--qt5/src/poppler-ps-converter.cc20
-rw-r--r--qt5/tests/check_pagelabelinfo.cpp4
-rw-r--r--splash/Splash.cc254
-rw-r--r--splash/Splash.h102
-rw-r--r--splash/SplashBitmap.cc8
-rw-r--r--splash/SplashBitmap.h10
-rw-r--r--splash/SplashClip.cc8
-rw-r--r--splash/SplashClip.h18
-rw-r--r--splash/SplashFTFont.cc36
-rw-r--r--splash/SplashFTFont.h10
-rw-r--r--splash/SplashFTFontEngine.cc8
-rw-r--r--splash/SplashFTFontEngine.h16
-rw-r--r--splash/SplashFTFontFile.cc8
-rw-r--r--splash/SplashFTFontFile.h6
-rw-r--r--splash/SplashFont.cc20
-rw-r--r--splash/SplashFont.h10
-rw-r--r--splash/SplashFontEngine.cc14
-rw-r--r--splash/SplashFontEngine.h12
-rw-r--r--splash/SplashFontFile.cc18
-rw-r--r--splash/SplashFontFile.h12
-rw-r--r--splash/SplashFontFileID.h2
-rw-r--r--splash/SplashGlyphBitmap.h4
-rw-r--r--splash/SplashMath.h2
-rw-r--r--splash/SplashPath.cc8
-rw-r--r--splash/SplashPath.h10
-rw-r--r--splash/SplashPattern.cc4
-rw-r--r--splash/SplashPattern.h18
-rw-r--r--splash/SplashScreen.h2
-rw-r--r--splash/SplashState.cc36
-rw-r--r--splash/SplashState.h22
-rw-r--r--splash/SplashXPath.cc12
-rw-r--r--splash/SplashXPath.h6
-rw-r--r--splash/SplashXPathScanner.cc36
-rw-r--r--splash/SplashXPathScanner.h20
-rw-r--r--test/gtk-test.cc4
-rw-r--r--test/pdf-fullrewrite.cc78
-rw-r--r--test/pdf-inspector.cc4
-rw-r--r--test/perf-test.cc20
-rw-r--r--utils/HtmlFonts.cc22
-rw-r--r--utils/HtmlFonts.h22
-rw-r--r--utils/HtmlLinks.cc10
-rw-r--r--utils/HtmlLinks.h6
-rw-r--r--utils/HtmlOutputDev.cc102
-rw-r--r--utils/HtmlOutputDev.h54
-rw-r--r--utils/HtmlUtils.h8
-rw-r--r--utils/ImageOutputDev.cc54
-rw-r--r--utils/ImageOutputDev.h64
-rw-r--r--utils/JSInfo.cc14
-rw-r--r--utils/JSInfo.h6
-rw-r--r--utils/parseargs.cc40
-rw-r--r--utils/parseargs.h10
-rw-r--r--utils/pdfdetach.cc26
-rw-r--r--utils/pdffonts.cc8
-rw-r--r--utils/pdfimages.cc40
-rw-r--r--utils/pdfinfo.cc46
-rw-r--r--utils/pdfseparate.cc6
-rw-r--r--utils/pdfsig.cc10
-rw-r--r--utils/pdftocairo-win32.cc32
-rw-r--r--utils/pdftocairo-win32.h8
-rw-r--r--utils/pdftocairo.cc122
-rw-r--r--utils/pdftohtml.cc78
-rw-r--r--utils/pdftoppm.cc68
-rw-r--r--utils/pdftops.cc76
-rw-r--r--utils/pdftotext.cc44
-rw-r--r--utils/pdfunite.cc24
219 files changed, 5479 insertions, 5491 deletions
diff --git a/cpp/poppler-page-renderer.cpp b/cpp/poppler-page-renderer.cpp
index fd28d9b1..4713cb17 100644
--- a/cpp/poppler-page-renderer.cpp
+++ b/cpp/poppler-page-renderer.cpp
@@ -292,14 +292,14 @@ image page_renderer::render_page(const page *p,
bgColor[0] = d->paper_color & 0xff;
bgColor[1] = (d->paper_color >> 8) & 0xff;
bgColor[2] = (d->paper_color >> 16) & 0xff;
- SplashOutputDev splashOutputDev(colorMode, 4, gFalse, bgColor, gTrue, lineMode);
- splashOutputDev.setFontAntialias(d->hints & text_antialiasing ? gTrue : gFalse);
- splashOutputDev.setVectorAntialias(d->hints & antialiasing ? gTrue : gFalse);
- splashOutputDev.setFreeTypeHinting(d->hints & text_hinting ? gTrue : gFalse, gFalse);
+ SplashOutputDev splashOutputDev(colorMode, 4, false, bgColor, true, lineMode);
+ splashOutputDev.setFontAntialias(d->hints & text_antialiasing ? true : false);
+ splashOutputDev.setVectorAntialias(d->hints & antialiasing ? true : false);
+ splashOutputDev.setFreeTypeHinting(d->hints & text_hinting ? true : false, false);
splashOutputDev.startDoc(pdfdoc);
pdfdoc->displayPageSlice(&splashOutputDev, pp->index + 1,
xres, yres, int(rotate) * 90,
- gFalse, gTrue, gFalse,
+ false, true, false,
x, y, w, h);
SplashBitmap *bitmap = splashOutputDev.getBitmap();
diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp
index ed9d2300..bc7dcfdc 100644
--- a/cpp/poppler-page.cpp
+++ b/cpp/poppler-page.cpp
@@ -206,7 +206,7 @@ bool page::search(const ustring &text, rectf &r, search_direction_enum direction
u[i] = text[i];
}
- const GBool sCase = case_sensitivity == case_sensitive ? gTrue : gFalse;
+ const bool sCase = case_sensitivity == case_sensitive;
const int rotation_value = (int)rotation * 90;
bool found = false;
@@ -215,24 +215,24 @@ bool page::search(const ustring &text, rectf &r, search_direction_enum direction
double rect_right = r.right();
double rect_bottom = r.bottom();
- TextOutputDev td(nullptr, gTrue, 0, gFalse, gFalse);
+ TextOutputDev td(nullptr, true, 0, false, false);
d->doc->doc->displayPage(&td, d->index + 1, 72, 72, rotation_value, false, true, false);
TextPage *text_page = td.takeText();
switch (direction) {
case search_from_top:
found = text_page->findText(&u[0], len,
- gTrue, gTrue, gFalse, gFalse, sCase, gFalse, gFalse,
+ true, true, false, false, sCase, false, false,
&rect_left, &rect_top, &rect_right, &rect_bottom);
break;
case search_next_result:
found = text_page->findText(&u[0], len,
- gFalse, gTrue, gTrue, gFalse, sCase, gFalse, gFalse,
+ false, true, true, false, sCase, false, false,
&rect_left, &rect_top, &rect_right, &rect_bottom);
break;
case search_previous_result:
found = text_page->findText(&u[0], len,
- gFalse, gTrue, gTrue, gFalse, sCase, gTrue, gFalse,
+ false, true, true, false, sCase, true, false,
&rect_left, &rect_top, &rect_right, &rect_bottom);
break;
}
@@ -273,8 +273,8 @@ ustring page::text(const rectf &r) const
ustring page::text(const rectf &r, text_layout_enum layout_mode) const
{
std::unique_ptr<GooString> s;
- const GBool use_raw_order = (layout_mode == raw_order_layout);
- TextOutputDev td(nullptr, gFalse, 0, use_raw_order, gFalse);
+ const bool use_raw_order = (layout_mode == raw_order_layout);
+ TextOutputDev td(nullptr, false, 0, use_raw_order, false);
d->doc->doc->displayPage(&td, d->index + 1, 72, 72, 0, false, true, false);
if (r.is_empty()) {
PDFRectangle rect = *d->page->getCropBox();
@@ -338,10 +338,10 @@ std::vector<text_box> page::text_list() const
/* config values are same with Qt5 Page::TextList() */
auto output_dev = std::make_unique<TextOutputDev>(
nullptr, /* char* fileName */
- gFalse, /* GBool physLayoutA */
+ false, /* bool physLayoutA */
0, /* double fixedPitchA */
- gFalse, /* GBool rawOrderA */
- gFalse /* GBool append */
+ false, /* bool rawOrderA */
+ false /* bool append */
);
/*
@@ -352,11 +352,11 @@ std::vector<text_box> page::text_list() const
d->doc->doc->displayPageSlice(output_dev.get(),
d->index + 1, /* page */
72, 72, 0, /* hDPI, vDPI, rot */
- gFalse, gFalse, gFalse, /* useMediaBox, crop, printing */
+ false, false, false, /* useMediaBox, crop, printing */
-1, -1, -1, -1, /* sliceX, sliceY, sliceW, sliceH */
nullptr, nullptr, /* abortCheckCbk(), abortCheckCbkData */
nullptr, nullptr, /* annotDisplayDecideCbk(), annotDisplayDecideCbkData */
- gTrue); /* copyXRef */
+ true); /* copyXRef */
if (std::unique_ptr< TextWordList > word_list{output_dev->makeWordList()}) {
@@ -375,7 +375,7 @@ std::vector<text_box> page::text_list() const
{xMin, yMin, xMax-xMin, yMax-yMin},
word->getRotation(),
{},
- word->hasSpaceAfter() == gTrue
+ word->hasSpaceAfter() == true
}};
tb.m_data->char_bboxes.reserve(word->getLength());
diff --git a/fofi/FoFiBase.cc b/fofi/FoFiBase.cc
index 713d071d..ff1d92ca 100644
--- a/fofi/FoFiBase.cc
+++ b/fofi/FoFiBase.cc
@@ -34,7 +34,7 @@
// FoFiBase
//------------------------------------------------------------------------
-FoFiBase::FoFiBase(const char *fileA, int lenA, GBool freeFileDataA) {
+FoFiBase::FoFiBase(const char *fileA, int lenA, bool freeFileDataA) {
file = (const Guchar *)fileA;
len = lenA;
freeFileData = freeFileDataA;
@@ -82,11 +82,11 @@ char *FoFiBase::readFile(const char *fileName, int *fileLen) {
return buf;
}
-int FoFiBase::getS8(int pos, GBool *ok) const {
+int FoFiBase::getS8(int pos, bool *ok) const {
int x;
if (pos < 0 || pos >= len) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = file[pos];
@@ -96,19 +96,19 @@ int FoFiBase::getS8(int pos, GBool *ok) const {
return x;
}
-int FoFiBase::getU8(int pos, GBool *ok) const {
+int FoFiBase::getU8(int pos, bool *ok) const {
if (pos < 0 || pos >= len) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
return file[pos];
}
-int FoFiBase::getS16BE(int pos, GBool *ok) const {
+int FoFiBase::getS16BE(int pos, bool *ok) const {
int x;
if (pos < 0 || pos+1 >= len || pos > INT_MAX - 1) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = file[pos];
@@ -119,11 +119,11 @@ int FoFiBase::getS16BE(int pos, GBool *ok) const {
return x;
}
-int FoFiBase::getU16BE(int pos, GBool *ok) const {
+int FoFiBase::getU16BE(int pos, bool *ok) const {
int x;
if (pos < 0 || pos+1 >= len || pos > INT_MAX - 1) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = file[pos];
@@ -131,11 +131,11 @@ int FoFiBase::getU16BE(int pos, GBool *ok) const {
return x;
}
-int FoFiBase::getS32BE(int pos, GBool *ok) const {
+int FoFiBase::getS32BE(int pos, bool *ok) const {
int x;
if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = file[pos];
@@ -148,11 +148,11 @@ int FoFiBase::getS32BE(int pos, GBool *ok) const {
return x;
}
-Guint FoFiBase::getU32BE(int pos, GBool *ok) const {
+Guint FoFiBase::getU32BE(int pos, bool *ok) const {
Guint x;
if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = file[pos];
@@ -162,11 +162,11 @@ Guint FoFiBase::getU32BE(int pos, GBool *ok) const {
return x;
}
-Guint FoFiBase::getU32LE(int pos, GBool *ok) const {
+Guint FoFiBase::getU32LE(int pos, bool *ok) const {
Guint x;
if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = file[pos+3];
@@ -176,12 +176,12 @@ Guint FoFiBase::getU32LE(int pos, GBool *ok) const {
return x;
}
-Guint FoFiBase::getUVarBE(int pos, int size, GBool *ok) const {
+Guint FoFiBase::getUVarBE(int pos, int size, bool *ok) const {
Guint x;
int i;
if (pos < 0 || pos + size > len || pos > INT_MAX - size) {
- *ok = gFalse;
+ *ok = false;
return 0;
}
x = 0;
@@ -191,7 +191,7 @@ Guint FoFiBase::getUVarBE(int pos, int size, GBool *ok) const {
return x;
}
-GBool FoFiBase::checkRegion(int pos, int size) const {
+bool FoFiBase::checkRegion(int pos, int size) const {
return pos >= 0 &&
pos < INT_MAX - size &&
size < INT_MAX - pos &&
diff --git a/fofi/FoFiBase.h b/fofi/FoFiBase.h
index 51652985..73842769 100644
--- a/fofi/FoFiBase.h
+++ b/fofi/FoFiBase.h
@@ -42,26 +42,26 @@ public:
protected:
- FoFiBase(const char *fileA, int lenA, GBool freeFileDataA);
+ FoFiBase(const char *fileA, int lenA, bool freeFileDataA);
static char *readFile(const char *fileName, int *fileLen);
// S = signed / U = unsigned
// 8/16/32/Var = word length, in bytes
// BE = big endian
- int getS8(int pos, GBool *ok) const;
- int getU8(int pos, GBool *ok) const;
- int getS16BE(int pos, GBool *ok) const;
- int getU16BE(int pos, GBool *ok) const;
- int getS32BE(int pos, GBool *ok) const;
- Guint getU32BE(int pos, GBool *ok) const;
- Guint getU32LE(int pos, GBool *ok) const;
- Guint getUVarBE(int pos, int size, GBool *ok) const;
+ int getS8(int pos, bool *ok) const;
+ int getU8(int pos, bool *ok) const;
+ int getS16BE(int pos, bool *ok) const;
+ int getU16BE(int pos, bool *ok) const;
+ int getS32BE(int pos, bool *ok) const;
+ Guint getU32BE(int pos, bool *ok) const;
+ Guint getU32LE(int pos, bool *ok) const;
+ Guint getUVarBE(int pos, int size, bool *ok) const;
- GBool checkRegion(int pos, int size) const;
+ bool checkRegion(int pos, int size) const;
const Guchar *file;
int len;
- GBool freeFileData;
+ bool freeFileData;
};
#endif
diff --git a/fofi/FoFiIdentifier.cc b/fofi/FoFiIdentifier.cc
index ded16e23..5cd7506a 100644
--- a/fofi/FoFiIdentifier.cc
+++ b/fofi/FoFiIdentifier.cc
@@ -44,22 +44,22 @@ public:
// Read a big-endian unsigned 16-bit integer. Fills in *val and
// returns true if successful.
- virtual GBool getU16BE(int pos, int *val) = 0;
+ virtual bool getU16BE(int pos, int *val) = 0;
// Read a big-endian unsigned 32-bit integer. Fills in *val and
// returns true if successful.
- virtual GBool getU32BE(int pos, Guint *val) = 0;
+ virtual bool getU32BE(int pos, Guint *val) = 0;
// Read a little-endian unsigned 32-bit integer. Fills in *val and
// returns true if successful.
- virtual GBool getU32LE(int pos, Guint *val) = 0;
+ virtual bool getU32LE(int pos, Guint *val) = 0;
// Read a big-endian unsigned <size>-byte integer, where 1 <= size
// <= 4. Fills in *val and returns true if successful.
- virtual GBool getUVarBE(int pos, int size, Guint *val) = 0;
+ virtual bool getUVarBE(int pos, int size, Guint *val) = 0;
// Compare against a string. Returns true if equal.
- virtual GBool cmp(int pos, const char *s) = 0;
+ virtual bool cmp(int pos, const char *s) = 0;
};
@@ -71,11 +71,11 @@ public:
static MemReader *make(const char *bufA, int lenA);
~MemReader();
int getByte(int pos) override;
- GBool getU16BE(int pos, int *val) override;
- GBool getU32BE(int pos, Guint *val) override;
- GBool getU32LE(int pos, Guint *val) override;
- GBool getUVarBE(int pos, int size, Guint *val) override;
- GBool cmp(int pos, const char *s) override;
+ bool getU16BE(int pos, int *val) override;
+ bool getU32BE(int pos, Guint *val) override;
+ bool getU32LE(int pos, Guint *val) override;
+ bool getUVarBE(int pos, int size, Guint *val) override;
+ bool cmp(int pos, const char *s) override;
private:
@@ -104,56 +104,56 @@ int MemReader::getByte(int pos) {
return buf[pos] & 0xff;
}
-GBool MemReader::getU16BE(int pos, int *val) {
+bool MemReader::getU16BE(int pos, int *val) {
if (pos < 0 || pos > len - 2) {
- return gFalse;
+ return false;
}
*val = ((buf[pos] & 0xff) << 8) +
(buf[pos+1] & 0xff);
- return gTrue;
+ return true;
}
-GBool MemReader::getU32BE(int pos, Guint *val) {
+bool MemReader::getU32BE(int pos, Guint *val) {
if (pos < 0 || pos > len - 4) {
- return gFalse;
+ return false;
}
*val = ((buf[pos] & 0xff) << 24) +
((buf[pos+1] & 0xff) << 16) +
((buf[pos+2] & 0xff) << 8) +
(buf[pos+3] & 0xff);
- return gTrue;
+ return true;
}
-GBool MemReader::getU32LE(int pos, Guint *val) {
+bool MemReader::getU32LE(int pos, Guint *val) {
if (pos < 0 || pos > len - 4) {
- return gFalse;
+ return false;
}
*val = (buf[pos] & 0xff) +
((buf[pos+1] & 0xff) << 8) +
((buf[pos+2] & 0xff) << 16) +
((buf[pos+3] & 0xff) << 24);
- return gTrue;
+ return true;
}
-GBool MemReader::getUVarBE(int pos, int size, Guint *val) {
+bool MemReader::getUVarBE(int pos, int size, Guint *val) {
int i;
if (size < 1 || size > 4 || pos < 0 || pos > len - size) {
- return gFalse;
+ return false;
}
*val = 0;
for (i = 0; i < size; ++i) {
*val = (*val << 8) + (buf[pos + i] & 0xff);
}
- return gTrue;
+ return true;
}
-GBool MemReader::cmp(int pos, const char *s) {
+bool MemReader::cmp(int pos, const char *s) {
int n;
n = (int)strlen(s);
if (pos < 0 || len < n || pos > len - n) {
- return gFalse;
+ return false;
}
return !memcmp(buf + pos, s, n);
}
@@ -166,16 +166,16 @@ public:
static FileReader *make(const char *fileName);
~FileReader();
int getByte(int pos) override;
- GBool getU16BE(int pos, int *val) override;
- GBool getU32BE(int pos, Guint *val) override;
- GBool getU32LE(int pos, Guint *val) override;
- GBool getUVarBE(int pos, int size, Guint *val) override;
- GBool cmp(int pos, const char *s) override;
+ bool getU16BE(int pos, int *val) override;
+ bool getU32BE(int pos, Guint *val) override;
+ bool getU32LE(int pos, Guint *val) override;
+ bool getUVarBE(int pos, int size, Guint *val) override;
+ bool cmp(int pos, const char *s) override;
private:
FileReader(FILE *fA);
- GBool fillBuf(int pos, int len);
+ bool fillBuf(int pos, int len);
FILE *f;
char buf[1024];
@@ -208,77 +208,77 @@ int FileReader::getByte(int pos) {
return buf[pos - bufPos] & 0xff;
}
-GBool FileReader::getU16BE(int pos, int *val) {
+bool FileReader::getU16BE(int pos, int *val) {
if (!fillBuf(pos, 2)) {
- return gFalse;
+ return false;
}
*val = ((buf[pos - bufPos] & 0xff) << 8) +
(buf[pos - bufPos + 1] & 0xff);
- return gTrue;
+ return true;
}
-GBool FileReader::getU32BE(int pos, Guint *val) {
+bool FileReader::getU32BE(int pos, Guint *val) {
if (!fillBuf(pos, 4)) {
- return gFalse;
+ return false;
}
*val = ((buf[pos - bufPos] & 0xff) << 24) +
((buf[pos - bufPos + 1] & 0xff) << 16) +
((buf[pos - bufPos + 2] & 0xff) << 8) +
(buf[pos - bufPos + 3] & 0xff);
- return gTrue;
+ return true;
}
-GBool FileReader::getU32LE(int pos, Guint *val) {
+bool FileReader::getU32LE(int pos, Guint *val) {
if (!fillBuf(pos, 4)) {
- return gFalse;
+ return false;
}
*val = (buf[pos - bufPos] & 0xff) +
((buf[pos - bufPos + 1] & 0xff) << 8) +
((buf[pos - bufPos + 2] & 0xff) << 16) +
((buf[pos - bufPos + 3] & 0xff) << 24);
- return gTrue;
+ return true;
}
-GBool FileReader::getUVarBE(int pos, int size, Guint *val) {
+bool FileReader::getUVarBE(int pos, int size, Guint *val) {
int i;
if (size < 1 || size > 4 || !fillBuf(pos, size)) {
- return gFalse;
+ return false;
}
*val = 0;
for (i = 0; i < size; ++i) {
*val = (*val << 8) + (buf[pos - bufPos + i] & 0xff);
}
- return gTrue;
+ return true;
}
-GBool FileReader::cmp(int pos, const char *s) {
+bool FileReader::cmp(int pos, const char *s) {
int n;
n = (int)strlen(s);
if (!fillBuf(pos, n)) {
- return gFalse;
+ return false;
}
return !memcmp(buf - bufPos + pos, s, n);
}
-GBool FileReader::fillBuf(int pos, int len) {
+bool FileReader::fillBuf(int pos, int len) {
if (pos < 0 || len < 0 || len > (int)sizeof(buf) ||
pos > INT_MAX - (int)sizeof(buf)) {
- return gFalse;
+ return false;
}
if (pos >= bufPos && pos + len <= bufPos + bufLen) {
- return gTrue;
+ return true;
}
if (fseek(f, pos, SEEK_SET)) {
- return gFalse;
+ return false;
}
bufPos = pos;
bufLen = (int)fread(buf, 1, sizeof(buf), f);
if (bufLen < len) {
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
//------------------------------------------------------------------------
@@ -289,16 +289,16 @@ public:
static StreamReader *make(int (*getCharA)(void *data), void *dataA);
~StreamReader();
int getByte(int pos) override;
- GBool getU16BE(int pos, int *val) override;
- GBool getU32BE(int pos, Guint *val) override;
- GBool getU32LE(int pos, Guint *val) override;
- GBool getUVarBE(int pos, int size, Guint *val) override;
- GBool cmp(int pos, const char *s) override;
+ bool getU16BE(int pos, int *val) override;
+ bool getU32BE(int pos, Guint *val) override;
+ bool getU32LE(int pos, Guint *val) override;
+ bool getUVarBE(int pos, int size, Guint *val) override;
+ bool cmp(int pos, const char *s) override;
private:
StreamReader(int (*getCharA)(void *data), void *dataA);
- GBool fillBuf(int pos, int len);
+ bool fillBuf(int pos, int len);
int (*getChar)(void *data);
void *data;
@@ -329,68 +329,68 @@ int StreamReader::getByte(int pos) {
return buf[pos - bufPos] & 0xff;
}
-GBool StreamReader::getU16BE(int pos, int *val) {
+bool StreamReader::getU16BE(int pos, int *val) {
if (!fillBuf(pos, 2)) {
- return gFalse;
+ return false;
}
*val = ((buf[pos - bufPos] & 0xff) << 8) +
(buf[pos - bufPos + 1] & 0xff);
- return gTrue;
+ return true;
}
-GBool StreamReader::getU32BE(int pos, Guint *val) {
+bool StreamReader::getU32BE(int pos, Guint *val) {
if (!fillBuf(pos, 4)) {
- return gFalse;
+ return false;
}
*val = ((buf[pos - bufPos] & 0xff) << 24) +
((buf[pos - bufPos + 1] & 0xff) << 16) +
((buf[pos - bufPos + 2] & 0xff) << 8) +
(buf[pos - bufPos + 3] & 0xff);
- return gTrue;
+ return true;
}
-GBool StreamReader::getU32LE(int pos, Guint *val) {
+bool StreamReader::getU32LE(int pos, Guint *val) {
if (!fillBuf(pos, 4)) {
- return gFalse;
+ return false;
}
*val = (buf[pos - bufPos] & 0xff) +
((buf[pos - bufPos + 1] & 0xff) << 8) +
((buf[pos - bufPos + 2] & 0xff) << 16) +
((buf[pos - bufPos + 3] & 0xff) << 24);
- return gTrue;
+ return true;
}
-GBool StreamReader::getUVarBE(int pos, int size, Guint *val) {
+bool StreamReader::getUVarBE(int pos, int size, Guint *val) {
int i;
if (size < 1 || size > 4 || !fillBuf(pos, size)) {
- return gFalse;
+ return false;
}
*val = 0;
for (i = 0; i < size; ++i) {
*val = (*val << 8) + (buf[pos - bufPos + i] & 0xff);
}
- return gTrue;
+ return true;
}
-GBool StreamReader::cmp(int pos, const char *s) {
+bool StreamReader::cmp(int pos, const char *s) {
const int n = (int)strlen(s);
if (!fillBuf(pos, n)) {
- return gFalse;
+ return false;
}
const int posDiff = pos - bufPos;
return !memcmp(buf + posDiff, s, n);
}
-GBool StreamReader::fillBuf(int pos, int len) {
+bool StreamReader::fillBuf(int pos, int len) {
int c;
if (pos < 0 || len < 0 || len > (int)sizeof(buf) ||
pos > INT_MAX - (int)sizeof(buf)) {
- return gFalse;
+ return false;
}
if (pos < bufPos) {
- return gFalse;
+ return false;
}
// if requested region will not fit in the current buffer...
@@ -410,7 +410,7 @@ GBool StreamReader::fillBuf(int pos, int len) {
bufLen = 0;
while (bufPos < pos) {
if ((c = (*getChar)(data)) < 0) {
- return gFalse;
+ return false;
}
++bufPos;
}
@@ -420,12 +420,12 @@ GBool StreamReader::fillBuf(int pos, int len) {
// read the rest of the requested data
while (bufPos + bufLen < pos + len) {
if ((c = (*getChar)(data)) < 0) {
- return gFalse;
+ return false;
}
buf[bufLen++] = (char)c;
}
- return gTrue;
+ return true;
}
}
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index f7b9ab58..612adc3c 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -166,24 +166,24 @@ struct cmpTrueTypeTableTagFunctor {
struct T42Table {
const char *tag; // 4-byte tag
- GBool required; // required by the TrueType spec?
+ bool required; // required by the TrueType spec?
};
// TrueType tables to be embedded in Type 42 fonts.
// NB: the table names must be in alphabetical order here.
#define nT42Tables 11
static T42Table t42Tables[nT42Tables] = {
- { "cvt ", gTrue },
- { "fpgm", gTrue },
- { "glyf", gTrue },
- { "head", gTrue },
- { "hhea", gTrue },
- { "hmtx", gTrue },
- { "loca", gTrue },
- { "maxp", gTrue },
- { "prep", gTrue },
- { "vhea", gFalse },
- { "vmtx", gFalse }
+ { "cvt ", true },
+ { "fpgm", true },
+ { "glyf", true },
+ { "head", true },
+ { "hhea", true },
+ { "hmtx", true },
+ { "loca", true },
+ { "maxp", true },
+ { "prep", true },
+ { "vhea", false },
+ { "vmtx", false }
};
#define t42HeadTable 3
#define t42LocaTable 6
@@ -270,7 +270,7 @@ static const char *macGlyphNames[258] = {
FoFiTrueType *FoFiTrueType::make(const char *fileA, int lenA, int faceIndexA) {
FoFiTrueType *ff;
- ff = new FoFiTrueType(fileA, lenA, gFalse, faceIndexA);
+ ff = new FoFiTrueType(fileA, lenA, false, faceIndexA);
if (!ff->parsedOk) {
delete ff;
return nullptr;
@@ -286,7 +286,7 @@ FoFiTrueType *FoFiTrueType::load(const char *fileName, int faceIndexA) {
if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
return nullptr;
}
- ff = new FoFiTrueType(fileA, lenA, gTrue, faceIndexA);
+ ff = new FoFiTrueType(fileA, lenA, true, faceIndexA);
if (!ff->parsedOk) {
delete ff;
return nullptr;
@@ -294,14 +294,14 @@ FoFiTrueType *FoFiTrueType::load(const char *fileName, int faceIndexA) {
return ff;
}
-FoFiTrueType::FoFiTrueType(const char *fileA, int lenA, GBool freeFileDataA, int faceIndexA):
+FoFiTrueType::FoFiTrueType(const char *fileA, int lenA, bool freeFileDataA, int faceIndexA):
FoFiBase(fileA, lenA, freeFileDataA)
{
tables = nullptr;
nTables = 0;
cmaps = nullptr;
nCmaps = 0;
- parsedOk = gFalse;
+ parsedOk = false;
faceIndex = faceIndexA;
gsubFeatureTable = 0;
gsubLookupList = 0;
@@ -342,12 +342,12 @@ int FoFiTrueType::mapCodeToGID(int i, Guint c) const {
Guint segCnt, segEnd, segStart, segDelta, segOffset;
Guint cmapFirst, cmapLen;
int pos, a, b, m;
- GBool ok;
+ bool ok;
if (i < 0 || i >= nCmaps) {
return 0;
}
- ok = gTrue;
+ ok = true;
pos = cmaps[i].offset;
switch (cmaps[i].fmt) {
case 0:
@@ -442,19 +442,19 @@ int FoFiTrueType::mapNameToGID(const char *name) const {
return gid->second;
}
-GBool FoFiTrueType::getCFFBlock(char **start, int *length) const {
+bool FoFiTrueType::getCFFBlock(char **start, int *length) const {
int i;
if (!openTypeCFF || !tables) {
- return gFalse;
+ return false;
}
i = seekTable("CFF ");
if (!checkRegion(tables[i].offset, tables[i].len)) {
- return gFalse;
+ return false;
}
*start = (char *)file + tables[i].offset;
*length = tables[i].len;
- return gTrue;
+ return true;
}
int *FoFiTrueType::getCIDToGIDMap(int *nCIDs) const {
@@ -477,12 +477,12 @@ int *FoFiTrueType::getCIDToGIDMap(int *nCIDs) const {
int FoFiTrueType::getEmbeddingRights() const {
int i, fsType;
- GBool ok;
+ bool ok;
if ((i = seekTable("OS/2")) < 0) {
return 4;
}
- ok = gTrue;
+ ok = true;
fsType = getU16BE(tables[i].offset + 8, &ok);
if (!ok) {
return 4;
@@ -520,14 +520,14 @@ void FoFiTrueType::convertToType42(const char *psName, char **encoding,
void *outputStream) const {
GooString *buf;
int maxUsedGlyph;
- GBool ok;
+ bool ok;
if (openTypeCFF) {
return;
}
// write the header
- ok = gTrue;
+ ok = true;
buf = GooString::format("%!PS-TrueTypeFont-{0:2g}\n",
(double)getS32BE(0, &ok) / 65536.0);
(*outputFunc)(outputStream, buf->getCString(), buf->getLength());
@@ -549,14 +549,14 @@ void FoFiTrueType::convertToType42(const char *psName, char **encoding,
// write the guts of the dictionary
cvtEncoding(encoding, outputFunc, outputStream);
cvtCharStrings(encoding, codeToGID, outputFunc, outputStream);
- cvtSfnts(outputFunc, outputStream, nullptr, gFalse, &maxUsedGlyph);
+ cvtSfnts(outputFunc, outputStream, nullptr, false, &maxUsedGlyph);
// end the dictionary and define the font
(*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
}
void FoFiTrueType::convertToType1(const char *psName, const char **newEncoding,
- GBool ascii, FoFiOutputFunc outputFunc,
+ bool ascii, FoFiOutputFunc outputFunc,
void *outputStream) const {
char *start;
int length;
@@ -574,12 +574,12 @@ void FoFiTrueType::convertToType1(const char *psName, const char **newEncoding,
void FoFiTrueType::convertToCIDType2(const char *psName,
int *cidMap, int nCIDs,
- GBool needVerticalMetrics,
+ bool needVerticalMetrics,
FoFiOutputFunc outputFunc,
void *outputStream) const {
GooString *buf;
int cid, maxUsedGlyph;
- GBool ok;
+ bool ok;
int i, j, k;
if (openTypeCFF) {
@@ -587,7 +587,7 @@ void FoFiTrueType::convertToCIDType2(const char *psName,
}
// write the header
- ok = gTrue;
+ ok = true;
buf = GooString::format("%!PS-TrueTypeFont-{0:2g}\n",
(double)getS32BE(0, &ok) / 65536.0);
(*outputFunc)(outputStream, buf->getCString(), buf->getLength());
@@ -720,7 +720,7 @@ void FoFiTrueType::convertToCIDType0(const char *psName, int *cidMap, int nCIDs,
}
void FoFiTrueType::convertToType0(const char *psName, int *cidMap, int nCIDs,
- GBool needVerticalMetrics,
+ bool needVerticalMetrics,
int *maxValidGlyph,
FoFiOutputFunc outputFunc,
void *outputStream) const {
@@ -934,14 +934,14 @@ void FoFiTrueType::cvtCharStrings(char **encoding,
void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
void *outputStream, GooString *name,
- GBool needVerticalMetrics,
+ bool needVerticalMetrics,
int *maxUsedGlyph) const {
Guchar headData[54];
TrueTypeLoca *locaTable;
Guchar *locaData;
TrueTypeTable newTables[nT42Tables];
Guchar tableDir[12 + nT42Tables*16];
- GBool ok;
+ bool ok;
Guint checksum;
int nNewTables;
int glyfTableLen, length, pos, glyfPos, i, j, k, vmtxTabLength;
@@ -965,7 +965,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
0, 1 // number of advance heights in vmtx table
};
Guchar *vmtxTab;
- GBool needVhea, needVmtx;
+ bool needVhea, needVmtx;
int advance;
// construct the 'head' table, zero out the font checksum
@@ -999,7 +999,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
pos = tables[i].offset;
i = seekTable("glyf");
glyfTableLen = tables[i].len;
- ok = gTrue;
+ ok = true;
for (i = 0; i <= nGlyphs; ++i) {
locaTable[i].idx = i;
if (locaFmt) {
@@ -1318,7 +1318,7 @@ void FoFiTrueType::parse() {
Guint topTag;
int pos, ver, i, j;
- parsedOk = gTrue;
+ parsedOk = true;
// look for a collection (TTC)
topTag = getU32BE(0, &parsedOk);
@@ -1333,7 +1333,7 @@ void FoFiTrueType::parse() {
if (!parsedOk)
return;
if (! dircount) {
- parsedOk = gFalse;
+ parsedOk = false;
return;
}
@@ -1392,7 +1392,7 @@ void FoFiTrueType::parse() {
(!openTypeCFF && seekTable("loca") < 0) ||
(!openTypeCFF && seekTable("glyf") < 0) ||
(openTypeCFF && seekTable("CFF ") < 0)) {
- parsedOk = gFalse;
+ parsedOk = false;
return;
}
@@ -1445,10 +1445,10 @@ void FoFiTrueType::parse() {
void FoFiTrueType::readPostTable() {
std::string name;
int tablePos, postFmt, stringIdx, stringPos;
- GBool ok;
+ bool ok;
int i, j, n, m;
- ok = gTrue;
+ ok = true;
if ((i = seekTable("post")) < 0) {
return;
}
@@ -1474,7 +1474,7 @@ void FoFiTrueType::readPostTable() {
stringIdx = 0;
stringPos = tablePos + 34 + 2*n;
for (i = 0; i < n; ++i) {
- ok = gTrue;
+ ok = true;
j = getU16BE(tablePos + 34 + 2*i, &ok);
if (j < 258) {
nameToGID[macGlyphNames[j]] = i;
diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h
index e364112c..3f2a1b7d 100644
--- a/fofi/FoFiTrueType.h
+++ b/fofi/FoFiTrueType.h
@@ -55,7 +55,7 @@ public:
// Returns true if this an OpenType font containing CFF data, false
// if it's a TrueType font (or OpenType font with TrueType data).
- GBool isOpenTypeCFF() const { return openTypeCFF; }
+ bool isOpenTypeCFF() const { return openTypeCFF; }
// Return the number of cmaps defined by this font.
int getNumCmaps() const;
@@ -118,7 +118,7 @@ public:
// otherwise it will be left as binary data. If <psName> is
// non-NULL, it will be used as the PostScript font name. (Only
// useful for OpenType CFF fonts.)
- void convertToType1(const char *psName, const char **newEncoding, GBool ascii,
+ void convertToType1(const char *psName, const char **newEncoding, bool ascii,
FoFiOutputFunc outputFunc, void *outputStream) const;
// Convert to a Type 2 CIDFont, suitable for embedding in a
@@ -127,7 +127,7 @@ public:
// font). The <cidMap> array maps CIDs to GIDs; it has <nCIDs>
// entries. (Not useful for OpenType CFF fonts.)
void convertToCIDType2(const char *psName, int *cidMap, int nCIDs,
- GBool needVerticalMetrics,
+ bool needVerticalMetrics,
FoFiOutputFunc outputFunc, void *outputStream) const;
// Convert to a Type 0 CIDFont, suitable for embedding in a
@@ -142,7 +142,7 @@ public:
// table in the font). The <cidMap> array maps CIDs to GIDs; it has
// <nCIDs> entries. (Not useful for OpenType CFF fonts.)
void convertToType0(const char *psName, int *cidMap, int nCIDs,
- GBool needVerticalMetrics,
+ bool needVerticalMetrics,
int *maxValidGlyph,
FoFiOutputFunc outputFunc, void *outputStream) const;
@@ -155,7 +155,7 @@ public:
// Returns a pointer to the CFF font embedded in this OpenType font.
// If successful, sets *<start> and *<length>, and returns true.
// Otherwise returns false. (Only useful for OpenType CFF fonts).
- GBool getCFFBlock(char **start, int *length) const;
+ bool getCFFBlock(char **start, int *length) const;
// setup vert/vrt2 GSUB for default lang
int setupGSUB(const char *scriptName);
@@ -165,7 +165,7 @@ public:
private:
- FoFiTrueType(const char *fileA, int lenA, GBool freeFileDataA, int faceIndexA);
+ FoFiTrueType(const char *fileA, int lenA, bool freeFileDataA, int faceIndexA);
void cvtEncoding(char **encoding,
FoFiOutputFunc outputFunc,
void *outputStream) const;
@@ -175,7 +175,7 @@ private:
void *outputStream) const;
void cvtSfnts(FoFiOutputFunc outputFunc,
void *outputStream, GooString *name,
- GBool needVerticalMetrics,
+ bool needVerticalMetrics,
int *maxUsedGlyph) const;
void dumpString(const Guchar *s, int length,
FoFiOutputFunc outputFunc,
@@ -198,9 +198,9 @@ private:
int locaFmt;
int bbox[4];
std::unordered_map<std::string,int> nameToGID;
- GBool openTypeCFF;
+ bool openTypeCFF;
- GBool parsedOk;
+ bool parsedOk;
int faceIndex;
Guint gsubFeatureTable;
Guint gsubLookupList;
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 83faa4a1..00fb9591 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -42,7 +42,7 @@
//------------------------------------------------------------------------
FoFiType1 *FoFiType1::make(const char *fileA, int lenA) {
- return new FoFiType1(fileA, lenA, gFalse);
+ return new FoFiType1(fileA, lenA, false);
}
FoFiType1 *FoFiType1::load(const char *fileName) {
@@ -52,10 +52,10 @@ FoFiType1 *FoFiType1::load(const char *fileName) {
if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
return nullptr;
}
- return new FoFiType1(fileA, lenA, gTrue);
+ return new FoFiType1(fileA, lenA, true);
}
-FoFiType1::FoFiType1(const char *fileA, int lenA, GBool freeFileDataA):
+FoFiType1::FoFiType1(const char *fileA, int lenA, bool freeFileDataA):
FoFiBase(fileA, lenA, freeFileDataA)
{
name = nullptr;
@@ -66,7 +66,7 @@ FoFiType1::FoFiType1(const char *fileA, int lenA, GBool freeFileDataA):
fontMatrix[3] = 0.001;
fontMatrix[4] = 0;
fontMatrix[5] = 0;
- parsed = gFalse;
+ parsed = false;
undoPFB();
}
@@ -214,9 +214,9 @@ void FoFiType1::parse() {
char c;
int n, code, base, i, j;
char *tokptr;
- GBool gotMatrix, continueLine;
+ bool gotMatrix, continueLine;
- gotMatrix = gFalse;
+ gotMatrix = false;
for (i = 1, line = (char *)file;
i <= 100 && line && (!name || !encoding);
++i) {
@@ -247,7 +247,7 @@ void FoFiType1::parse() {
for (j = 0; j < 256; ++j) {
encoding[j] = nullptr;
}
- continueLine = gFalse;
+ continueLine = false;
for (j = 0, line = getNextLine(line);
j < 300 && line && (line1 = getNextLine(line));
++j, line = line1) {
@@ -256,7 +256,7 @@ void FoFiType1::parse() {
n = 255;
}
if (continueLine) {
- continueLine = gFalse;
+ continueLine = false;
if ((line1 - firstLine) + 1 > (int)sizeof(buf))
break;
p = firstLine;
@@ -287,7 +287,7 @@ void FoFiType1::parse() {
} else if (*p >= '0' && *p <= '9') {
base = 10;
} else if (*p == '\n' || *p == '\r') {
- continueLine = gTrue;
+ continueLine = true;
break;
} else {
break;
@@ -297,7 +297,7 @@ void FoFiType1::parse() {
}
for (; *p == ' ' || *p == '\t'; ++p) ;
if (*p == '\n' || *p == '\r') {
- continueLine = gTrue;
+ continueLine = true;
break;
} else if (*p != '/') {
break;
@@ -313,7 +313,7 @@ void FoFiType1::parse() {
}
for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
if (*p == '\n' || *p == '\r') {
- continueLine = gTrue;
+ continueLine = true;
break;
}
if (strncmp(p, "put", 3)) {
@@ -353,24 +353,24 @@ void FoFiType1::parse() {
}
}
}
- gotMatrix = gTrue;
+ gotMatrix = true;
} else {
line = getNextLine(line);
}
}
- parsed = gTrue;
+ parsed = true;
}
// Undo the PFB encoding, i.e., remove the PFB headers.
void FoFiType1::undoPFB() {
- GBool ok;
+ bool ok;
Guchar *file2;
int pos1, pos2, type;
Guint segLen;
- ok = gTrue;
+ ok = true;
if (getU8(0, &ok) != 0x80 || !ok) {
return;
}
@@ -394,6 +394,6 @@ void FoFiType1::undoPFB() {
gfree((char*)file);
}
file = file2;
- freeFileData = gTrue;
+ freeFileData = true;
len = pos2;
}
diff --git a/fofi/FoFiType1.h b/fofi/FoFiType1.h
index 7902be53..313b2981 100644
--- a/fofi/FoFiType1.h
+++ b/fofi/FoFiType1.h
@@ -57,7 +57,7 @@ public:
private:
- FoFiType1(const char *fileA, int lenA, GBool freeFileDataA);
+ FoFiType1(const char *fileA, int lenA, bool freeFileDataA);
char *getNextLine(char *line) const;
void parse();
@@ -66,7 +66,7 @@ private:
char *name;
char **encoding;
double fontMatrix[6];
- GBool parsed;
+ bool parsed;
};
#endif
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index 2312f3af..d079f0b5 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -46,7 +46,7 @@ static char hexChars[17] = "0123456789ABCDEF";
FoFiType1C *FoFiType1C::make(const char *fileA, int lenA) {
FoFiType1C *ff;
- ff = new FoFiType1C(fileA, lenA, gFalse);
+ ff = new FoFiType1C(fileA, lenA, false);
if (!ff->parse()) {
delete ff;
return nullptr;
@@ -62,7 +62,7 @@ FoFiType1C *FoFiType1C::load(const char *fileName) {
if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
return nullptr;
}
- ff = new FoFiType1C(fileA, lenA, gTrue);
+ ff = new FoFiType1C(fileA, lenA, true);
if (!ff->parse()) {
delete ff;
return nullptr;
@@ -70,7 +70,7 @@ FoFiType1C *FoFiType1C::load(const char *fileName) {
return ff;
}
-FoFiType1C::FoFiType1C(const char *fileA, int lenA, GBool freeFileDataA):
+FoFiType1C::FoFiType1C(const char *fileA, int lenA, bool freeFileDataA):
FoFiBase(fileA, lenA, freeFileDataA)
{
name = nullptr;
@@ -119,9 +119,9 @@ char **FoFiType1C::getEncoding() const {
GooString *FoFiType1C::getGlyphName(int gid) const {
char buf[256];
- GBool ok;
+ bool ok;
- ok = gTrue;
+ ok = true;
if (gid < 0 || gid >= charsetLength)
return nullptr;
getString(charset[gid], buf, &ok);
@@ -188,7 +188,7 @@ void FoFiType1C::getFontMatrix(double *mat) const {
}
}
-void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GBool ascii,
+void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, bool ascii,
FoFiOutputFunc outputFunc,
void *outputStream) {
int psNameLen;
@@ -198,7 +198,7 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GB
GooString *buf;
char buf2[256];
const char **enc;
- GBool ok;
+ bool ok;
int i;
if (psName) {
@@ -209,7 +209,7 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GB
}
// write header and font dictionary, up to encoding
- ok = gTrue;
+ ok = true;
(*outputFunc)(outputStream, "%!FontType1-1.0: ", 17);
(*outputFunc)(outputStream, psName, psNameLen);
if (topDict.versionSID != 0) {
@@ -450,7 +450,7 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GB
}
// set up subroutines
- ok = gTrue;
+ ok = true;
getIndex(privateDicts[0].subrsOffset, &subrIdx, &ok);
if (!ok) {
subrIdx.pos = -1;
@@ -462,7 +462,7 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GB
eexecWrite(&eb, buf->getCString());
delete buf;
for (i = 0; i < nGlyphs; ++i) {
- ok = gTrue;
+ ok = true;
getIndexVal(&charStringsIdx, i, &val, &ok);
if (ok && i < charsetLength) {
getString(charset[i], buf2, &ok);
@@ -499,7 +499,7 @@ void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes,
int nCIDs, gdBytes;
GooString *buf;
char buf2[256];
- GBool ok;
+ bool ok;
int gid, offset, n, i, j, k;
// compute the CID count and build the CID-to-GID mapping
@@ -541,7 +541,7 @@ void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes,
for (i = 0; i < nCIDs; ++i) {
charStringOffsets[i] = charStrings->getLength();
if ((gid = cidMap[i]) >= 0) {
- ok = gTrue;
+ ok = true;
getIndexVal(&charStringsIdx, gid, &val, &ok);
if (ok) {
getIndex(privateDicts[fdSelect ? fdSelect[gid] : 0].subrsOffset,
@@ -550,7 +550,7 @@ void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes,
subrIdx.pos = -1;
}
cvtGlyph(val.pos, val.len, charStrings,
- &subrIdx, &privateDicts[fdSelect ? fdSelect[gid] : 0], gTrue);
+ &subrIdx, &privateDicts[fdSelect ? fdSelect[gid] : 0], true);
}
}
}
@@ -580,14 +580,14 @@ void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes,
(*outputFunc)(outputStream, "/CIDFontType 0 def\n", 19);
(*outputFunc)(outputStream, "/CIDSystemInfo 3 dict dup begin\n", 32);
if (topDict.registrySID > 0 && topDict.orderingSID > 0) {
- ok = gTrue;
+ ok = true;
getString(topDict.registrySID, buf2, &ok);
if (ok) {
(*outputFunc)(outputStream, " /Registry (", 13);
(*outputFunc)(outputStream, buf2, strlen(buf2));
(*outputFunc)(outputStream, ") def\n", 6);
}
- ok = gTrue;
+ ok = true;
getString(topDict.orderingSID, buf2, &ok);
if (ok) {
(*outputFunc)(outputStream, " /Ordering (", 13);
@@ -842,7 +842,7 @@ void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes,
int nCIDs;
GooString *buf;
Type1CEexecBuf eb;
- GBool ok;
+ bool ok;
int fd, i, j, k;
// compute the CID count and build the CID-to-GID mapping
@@ -955,7 +955,7 @@ void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes,
(*outputFunc)(outputStream, "currentfile eexec\n", 18);
eb.outputFunc = outputFunc;
eb.outputStream = outputStream;
- eb.ascii = gTrue;
+ eb.ascii = true;
eb.r1 = 55665;
eb.line = 0;
@@ -1084,7 +1084,7 @@ void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes,
}
// set up the subroutines
- ok = gTrue;
+ ok = true;
getIndex(privateDicts[fd].subrsOffset, &subrIdx, &ok);
if (!ok) {
subrIdx.pos = -1;
@@ -1094,7 +1094,7 @@ void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes,
eexecWrite(&eb, "2 index /CharStrings 256 dict dup begin\n");
// write the .notdef CharString
- ok = gTrue;
+ ok = true;
getIndexVal(&charStringsIdx, 0, &val, &ok);
if (ok) {
eexecCvtGlyph(&eb, ".notdef", val.pos, val.len,
@@ -1104,7 +1104,7 @@ void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes,
// write the CharStrings
for (j = 0; j < 256 && i+j < nCIDs; ++j) {
if (cidMap[i+j] >= 0) {
- ok = gTrue;
+ ok = true;
getIndexVal(&charStringsIdx, cidMap[i+j], &val, &ok);
if (ok) {
buf = GooString::format("c{0:02x}", j);
@@ -1181,7 +1181,7 @@ void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
// generate the charstring
charBuf = new GooString();
- cvtGlyph(offset, nBytes, charBuf, subrIdx, pDict, gTrue);
+ cvtGlyph(offset, nBytes, charBuf, subrIdx, pDict, true);
buf = GooString::format("/{0:s} {1:d} RD ", glyphName, charBuf->getLength());
eexecWrite(eb, buf->getCString());
@@ -1195,9 +1195,9 @@ void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
Type1CIndex *subrIdx, Type1CPrivateDict *pDict,
- GBool top) {
+ bool top) {
Type1CIndexVal val;
- GBool ok, dFP;
+ bool ok, dFP;
double d, dx, dy;
Gushort r2;
Guchar byte;
@@ -1211,14 +1211,14 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)134);
nOps = 0;
nHints = 0;
- firstOp = gTrue;
- openPath = gFalse;
+ firstOp = true;
+ openPath = false;
}
pos = offset;
while (pos < offset + nBytes) {
- ok = gTrue;
- pos = getOp(pos, gTrue, &ok);
+ ok = true;
+ pos = getOp(pos, true, &ok);
if (!ok) {
break;
}
@@ -1228,13 +1228,13 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
case 0x0001: // hstem
if (firstOp) {
cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (nOps & 1) {
//~ error(-1, "Wrong number of args (%d) to Type 2 hstem", nOps);
}
d = 0;
- dFP = gFalse;
+ dFP = false;
for (k = 0; k < nOps; k += 2) {
// convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
if (ops[k+1].num < 0) {
@@ -1258,13 +1258,13 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
case 0x0003: // vstem
if (firstOp) {
cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (nOps & 1) {
//~ error(-1, "Wrong number of args (%d) to Type 2 vstem", nOps);
}
d = 0;
- dFP = gFalse;
+ dFP = false;
for (k = 0; k < nOps; k += 2) {
// convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
if (ops[k+1].num < 0) {
@@ -1288,11 +1288,11 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
case 0x0004: // vmoveto
if (firstOp) {
cvtGlyphWidth(nOps == 2, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (openPath) {
charBuf->append((char)9);
- openPath = gFalse;
+ openPath = false;
}
if (nOps != 1) {
//~ error(-1, "Wrong number of args (%d) to Type 2 vmoveto", nOps);
@@ -1311,7 +1311,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)5);
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0006: // hlineto
if (nOps < 1) {
@@ -1322,7 +1322,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)((k & 1) ? 7 : 6));
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0007: // vlineto
if (nOps < 1) {
@@ -1333,7 +1333,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)((k & 1) ? 6 : 7));
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0008: // rrcurveto
if (nOps < 6 || nOps % 6 != 0) {
@@ -1349,7 +1349,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)8);
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x000a: // callsubr
if (nOps >= 1) {
@@ -1357,10 +1357,10 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
? 107 : (subrIdx->len < 33900) ? 1131 : 32768;
k = subrBias + (int)ops[nOps - 1].num;
--nOps;
- ok = gTrue;
+ ok = true;
getIndexVal(subrIdx, k, &val, &ok);
if (likely(ok && val.pos != offset)) {
- cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
+ cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, false);
}
} else {
//~ error(-1, "Too few args to Type 2 callsubr");
@@ -1373,14 +1373,14 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
case 0x000e: // endchar / seac
if (firstOp) {
cvtGlyphWidth(nOps == 1 || nOps == 5, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (openPath) {
charBuf->append((char)9);
- openPath = gFalse;
+ openPath = false;
}
if (nOps == 4) {
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[0].num, ops[0].isFP, charBuf);
cvtNum(ops[1].num, ops[1].isFP, charBuf);
cvtNum(ops[2].num, ops[2].isFP, charBuf);
@@ -1397,7 +1397,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
// this op is ignored, but we need the glyph width
if (firstOp) {
cvtGlyphWidth(nOps > 0, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
nOps = 0;
break;
@@ -1409,7 +1409,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
// ignored
if (firstOp) {
cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (nOps & 1) {
//~ error(-1, "Wrong number of args (%d) to Type 2 hstemhm", nOps);
@@ -1421,7 +1421,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
// ignored
if (firstOp) {
cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (nOps > 0) {
if (nOps & 1) {
@@ -1437,7 +1437,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
// ignored
if (firstOp) {
cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (nOps > 0) {
if (nOps & 1) {
@@ -1452,11 +1452,11 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
case 0x0015: // rmoveto
if (firstOp) {
cvtGlyphWidth(nOps == 3, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (openPath) {
charBuf->append((char)9);
- openPath = gFalse;
+ openPath = false;
}
if (nOps != 2) {
//~ error(-1, "Wrong number of args (%d) to Type 2 rmoveto", nOps);
@@ -1469,11 +1469,11 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
case 0x0016: // hmoveto
if (firstOp) {
cvtGlyphWidth(nOps == 2, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (openPath) {
charBuf->append((char)9);
- openPath = gFalse;
+ openPath = false;
}
if (nOps != 1) {
//~ error(-1, "Wrong number of args (%d) to Type 2 hmoveto", nOps);
@@ -1486,7 +1486,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
// ignored
if (firstOp) {
cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
+ firstOp = false;
}
if (nOps & 1) {
//~ error(-1, "Wrong number of args (%d) to Type 2 vstemhm", nOps);
@@ -1511,7 +1511,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
charBuf->append((char)5);
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0019: // rlinecurve
if (nOps < 8 || (nOps - 6) % 2 != 0) {
@@ -1530,7 +1530,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
charBuf->append((char)8);
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x001a: // vvcurveto
if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
@@ -1541,7 +1541,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[1].num, ops[1].isFP, charBuf);
cvtNum(ops[2].num, ops[2].isFP, charBuf);
cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[4].num, ops[4].isFP, charBuf);
charBuf->append((char)8);
k = 5;
@@ -1549,16 +1549,16 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
k = 0;
}
for (; k < nOps; k += 4) {
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k].num, ops[k].isFP, charBuf);
cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
charBuf->append((char)8);
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x001b: // hhcurveto
if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
@@ -1570,7 +1570,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[2].num, ops[2].isFP, charBuf);
cvtNum(ops[3].num, ops[3].isFP, charBuf);
cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
charBuf->append((char)8);
k = 5;
} else {
@@ -1578,24 +1578,24 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
}
for (; k < nOps; k += 4) {
cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
charBuf->append((char)8);
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x001d: // callgsubr
if (nOps >= 1) {
k = gsubrBias + (int)ops[nOps - 1].num;
--nOps;
- ok = gTrue;
+ ok = true;
getIndexVal(&gsubrIdx, k, &val, &ok);
if (likely(ok && val.pos != offset)) {
- cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
+ cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, false);
}
} else {
//~ error(-1, "Too few args to Type 2 callgsubr");
@@ -1623,7 +1623,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
}
if (k == nOps-5) {
if (k % 8 == 0) {
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k].num, ops[k].isFP, charBuf);
cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
@@ -1631,7 +1631,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
} else {
cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
@@ -1640,7 +1640,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)8);
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x001f: // hvcurveto
if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
@@ -1664,13 +1664,13 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
if (k == nOps-5) {
if (k % 8 == 0) {
cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
} else {
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[k].num, ops[k].isFP, charBuf);
cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
@@ -1680,7 +1680,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
charBuf->append((char)8);
}
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0c00: // dotsection (should be Type 1 only?)
// ignored
@@ -1716,21 +1716,21 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
//~ error(-1, "Wrong number of args (%d) to Type 2 hflex", nOps);
}
cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[1].num, ops[1].isFP, charBuf);
cvtNum(ops[2].num, ops[2].isFP, charBuf);
cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
charBuf->append((char)8);
cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[5].num, ops[5].isFP, charBuf);
cvtNum(-ops[2].num, ops[2].isFP, charBuf);
cvtNum(ops[6].num, ops[6].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
charBuf->append((char)8);
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0c23: // flex
if (nOps != 13) {
@@ -1751,7 +1751,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[11].num, ops[11].isFP, charBuf);
charBuf->append((char)8);
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0c24: // hflex1
if (nOps != 9) {
@@ -1762,10 +1762,10 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
cvtNum(ops[2].num, ops[2].isFP, charBuf);
cvtNum(ops[3].num, ops[3].isFP, charBuf);
cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
charBuf->append((char)8);
cvtNum(ops[5].num, ops[5].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(ops[6].num, ops[6].isFP, charBuf);
cvtNum(ops[7].num, ops[7].isFP, charBuf);
cvtNum(ops[8].num, ops[8].isFP, charBuf);
@@ -1773,7 +1773,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
ops[1].isFP | ops[3].isFP | ops[7].isFP, charBuf);
charBuf->append((char)8);
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
case 0x0c25: // flex1
if (nOps != 11) {
@@ -1803,7 +1803,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
}
charBuf->append((char)8);
nOps = 0;
- openPath = gTrue;
+ openPath = true;
break;
default:
//~ error(-1, "Illegal Type 2 charstring op: %04x",
@@ -1825,10 +1825,10 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
}
}
-void FoFiType1C::cvtGlyphWidth(GBool useOp, GooString *charBuf,
+void FoFiType1C::cvtGlyphWidth(bool useOp, GooString *charBuf,
Type1CPrivateDict *pDict) {
double w;
- GBool wFP;
+ bool wFP;
int i;
if (useOp) {
@@ -1842,12 +1842,12 @@ void FoFiType1C::cvtGlyphWidth(GBool useOp, GooString *charBuf,
w = pDict->defaultWidthX;
wFP = pDict->defaultWidthXFP;
}
- cvtNum(0, gFalse, charBuf);
+ cvtNum(0, false, charBuf);
cvtNum(w, wFP, charBuf);
charBuf->append((char)13);
}
-void FoFiType1C::cvtNum(double x, GBool isFP, GooString *charBuf) const {
+void FoFiType1C::cvtNum(double x, bool isFP, GooString *charBuf) const {
Guchar buf[12];
int y, n;
@@ -1974,12 +1974,12 @@ void FoFiType1C::writePSString(const char *s, FoFiOutputFunc outputFunc,
(*outputFunc)(outputStream, buf, i);
}
-GBool FoFiType1C::parse() {
+bool FoFiType1C::parse() {
Type1CIndex fdIdx;
Type1CIndexVal val;
int i;
- parsedOk = gTrue;
+ parsedOk = true;
// some tools embed Type 1C fonts with an extra whitespace char at
// the beginning
@@ -1994,7 +1994,7 @@ GBool FoFiType1C::parse() {
getIndex(topDictIdx.endPos, &stringIdx, &parsedOk);
getIndex(stringIdx.endPos, &gsubrIdx, &parsedOk);
if (!parsedOk) {
- return gFalse;
+ return false;
}
gsubrBias = (gsubrIdx.len < 1240) ? 107
: (gsubrIdx.len < 33900) ? 1131 : 32768;
@@ -2002,7 +2002,7 @@ GBool FoFiType1C::parse() {
// read the first font name
getIndexVal(&nameIdx, 0, &val, &parsedOk);
if (!parsedOk) {
- return gFalse;
+ return false;
}
name = new GooString((char *)&file[val.pos], val.len);
@@ -2018,7 +2018,7 @@ GBool FoFiType1C::parse() {
} else {
getIndex(topDict.fdArrayOffset, &fdIdx, &parsedOk);
if (!parsedOk) {
- return gFalse;
+ return false;
}
nFDs = fdIdx.len;
privateDicts = (Type1CPrivateDict *)
@@ -2026,7 +2026,7 @@ GBool FoFiType1C::parse() {
for (i = 0; i < nFDs; ++i) {
getIndexVal(&fdIdx, i, &val, &parsedOk);
if (!parsedOk) {
- return gFalse;
+ return false;
}
readFD(val.pos, val.len, &privateDicts[i]);
}
@@ -2042,17 +2042,17 @@ GBool FoFiType1C::parse() {
// check for parse errors in the private dict(s)
if (!parsedOk) {
- return gFalse;
+ return false;
}
// get the charstrings index
if (topDict.charStringsOffset <= 0) {
- parsedOk = gFalse;
- return gFalse;
+ parsedOk = false;
+ return false;
}
getIndex(topDict.charStringsOffset, &charStringsIdx, &parsedOk);
if (!parsedOk) {
- return gFalse;
+ return false;
}
nGlyphs = charStringsIdx.len;
@@ -2060,21 +2060,21 @@ GBool FoFiType1C::parse() {
if (topDict.firstOp == 0x0c1e) {
readFDSelect();
if (!parsedOk) {
- return gFalse;
+ return false;
}
}
// read the charset
if (!readCharset()) {
- parsedOk = gFalse;
- return gFalse;
+ parsedOk = false;
+ return false;
}
// for 8-bit fonts: build the encoding
if (topDict.firstOp != 0x0c14 && topDict.firstOp != 0x0c1e) {
buildEncoding();
if (!parsedOk) {
- return gFalse;
+ return false;
}
}
@@ -2104,7 +2104,7 @@ void FoFiType1C::readTopDict() {
topDict.fontMatrix[3] = 0.001;
topDict.fontMatrix[4] = 0;
topDict.fontMatrix[5] = 0;
- topDict.hasFontMatrix = gFalse;
+ topDict.hasFontMatrix = false;
topDict.uniqueID = 0;
topDict.fontBBox[0] = 0;
topDict.fontBBox[1] = 0;
@@ -2129,7 +2129,7 @@ void FoFiType1C::readTopDict() {
pos = topDictPtr.pos;
nOps = 0;
while (pos < topDictPtr.pos + topDictPtr.len) {
- pos = getOp(pos, gFalse, &parsedOk);
+ pos = getOp(pos, false, &parsedOk);
if (!parsedOk) {
break;
}
@@ -2157,7 +2157,7 @@ void FoFiType1C::readTopDict() {
topDict.fontMatrix[3] = ops[3].num;
topDict.fontMatrix[4] = ops[4].num;
topDict.fontMatrix[5] = ops[5].num;
- topDict.hasFontMatrix = gTrue; break;
+ topDict.hasFontMatrix = true; break;
case 0x000d: topDict.uniqueID = (int)ops[0].num; break;
case 0x0005: topDict.fontBBox[0] = ops[0].num;
topDict.fontBBox[1] = ops[1].num;
@@ -2186,9 +2186,9 @@ void FoFiType1C::readTopDict() {
void FoFiType1C::readFD(int offset, int length, Type1CPrivateDict *pDict) {
int pSize, pOffset;
double fontMatrix[6] = {0};
- GBool hasFontMatrix;
+ bool hasFontMatrix;
- hasFontMatrix = gFalse;
+ hasFontMatrix = false;
fontMatrix[0] = fontMatrix[1] = fontMatrix[2] = 0; // make gcc happy
fontMatrix[3] = fontMatrix[4] = fontMatrix[5] = 0;
pSize = pOffset = 0;
@@ -2201,14 +2201,14 @@ void FoFiType1C::readFD(int offset, int length, Type1CPrivateDict *pDict) {
int pos = offset;
nOps = 0;
while (pos < posEnd) {
- pos = getOp(pos, gFalse, &parsedOk);
+ pos = getOp(pos, false, &parsedOk);
if (!parsedOk) {
return;
}
if (!ops[nOps - 1].isNum) {
if (ops[nOps - 1].op == 0x0012) {
if (nOps < 3) {
- parsedOk = gFalse;
+ parsedOk = false;
return;
}
pSize = (int)ops[0].num;
@@ -2221,7 +2221,7 @@ void FoFiType1C::readFD(int offset, int length, Type1CPrivateDict *pDict) {
fontMatrix[3] = ops[3].num;
fontMatrix[4] = ops[4].num;
fontMatrix[5] = ops[5].num;
- hasFontMatrix = gTrue;
+ hasFontMatrix = true;
}
nOps = 0;
}
@@ -2234,13 +2234,13 @@ void FoFiType1C::readFD(int offset, int length, Type1CPrivateDict *pDict) {
pDict->fontMatrix[3] = fontMatrix[3];
pDict->fontMatrix[4] = fontMatrix[4];
pDict->fontMatrix[5] = fontMatrix[5];
- pDict->hasFontMatrix = gTrue;
+ pDict->hasFontMatrix = true;
}
}
void FoFiType1C::readPrivateDict(int offset, int length,
Type1CPrivateDict *pDict) {
- pDict->hasFontMatrix = gFalse;
+ pDict->hasFontMatrix = false;
pDict->nBlueValues = 0;
pDict->nOtherBlues = 0;
pDict->nFamilyBlues = 0;
@@ -2248,20 +2248,20 @@ void FoFiType1C::readPrivateDict(int offset, int length,
pDict->blueScale = 0.039625;
pDict->blueShift = 7;
pDict->blueFuzz = 1;
- pDict->hasStdHW = gFalse;
- pDict->hasStdVW = gFalse;
+ pDict->hasStdHW = false;
+ pDict->hasStdVW = false;
pDict->nStemSnapH = 0;
pDict->nStemSnapV = 0;
- pDict->hasForceBold = gFalse;
+ pDict->hasForceBold = false;
pDict->forceBoldThreshold = 0;
pDict->languageGroup = 0;
pDict->expansionFactor = 0.06;
pDict->initialRandomSeed = 0;
pDict->subrsOffset = 0;
pDict->defaultWidthX = 0;
- pDict->defaultWidthXFP = gFalse;
+ pDict->defaultWidthXFP = false;
pDict->nominalWidthX = 0;
- pDict->nominalWidthXFP = gFalse;
+ pDict->nominalWidthXFP = false;
// no dictionary
if (offset == 0 || length == 0) {
@@ -2276,7 +2276,7 @@ void FoFiType1C::readPrivateDict(int offset, int length,
int pos = offset;
nOps = 0;
while (pos < posEnd) {
- pos = getOp(pos, gFalse, &parsedOk);
+ pos = getOp(pos, false, &parsedOk);
if (!parsedOk) {
break;
}
@@ -2310,11 +2310,11 @@ void FoFiType1C::readPrivateDict(int offset, int length,
break;
case 0x000a:
pDict->stdHW = ops[0].num;
- pDict->hasStdHW = gTrue;
+ pDict->hasStdHW = true;
break;
case 0x000b:
pDict->stdVW = ops[0].num;
- pDict->hasStdVW = gTrue;
+ pDict->hasStdVW = true;
break;
case 0x0c0c:
pDict->nStemSnapH = getDeltaFPArray(pDict->stemSnapH,
@@ -2326,7 +2326,7 @@ void FoFiType1C::readPrivateDict(int offset, int length,
break;
case 0x0c0e:
pDict->forceBold = ops[0].num != 0;
- pDict->hasForceBold = gTrue;
+ pDict->hasForceBold = true;
break;
case 0x0c0f:
pDict->forceBoldThreshold = ops[0].num;
@@ -2373,7 +2373,7 @@ void FoFiType1C::readFDSelect() {
}
if (fdSelectFmt == 0) {
if (!checkRegion(pos, nGlyphs)) {
- parsedOk = gFalse;
+ parsedOk = false;
return;
}
memcpy(fdSelect, file + pos, nGlyphs);
@@ -2391,7 +2391,7 @@ void FoFiType1C::readFDSelect() {
pos += 2;
if (gid0 > gid1 || gid1 > nGlyphs) {
//~ error(-1, "Bad FDSelect table in CID font");
- parsedOk = gFalse;
+ parsedOk = false;
return;
}
for (j = gid0; j < gid1; ++j) {
@@ -2496,7 +2496,7 @@ void FoFiType1C::buildEncoding() {
}
}
-GBool FoFiType1C::readCharset() {
+bool FoFiType1C::readCharset() {
int charsetFormat, c, pos;
int nLeft, i, j;
@@ -2557,13 +2557,13 @@ GBool FoFiType1C::readCharset() {
gfree(charset);
charset = nullptr;
charsetLength = 0;
- return gFalse;
+ return false;
}
}
- return gTrue;
+ return true;
}
-int FoFiType1C::getOp(int pos, GBool charstring, GBool *ok) {
+int FoFiType1C::getOp(int pos, bool charstring, bool *ok) {
static char nybChars[16] = "0123456789.ee -";
Type1COp op;
char buf[65];
@@ -2621,7 +2621,7 @@ int FoFiType1C::getOp(int pos, GBool charstring, GBool *ok) {
} while (i < 64);
buf[i] = '\0';
op.num = gatof(buf);
- op.isFP = gTrue;
+ op.isFP = true;
} else if (b0 >= 32 && b0 <= 246) {
op.num = b0 - 139;
@@ -2641,14 +2641,14 @@ int FoFiType1C::getOp(int pos, GBool charstring, GBool *ok) {
x |= ~0xffffffff;
}
op.num = (double)x / 65536.0;
- op.isFP = gTrue;
+ op.isFP = true;
} else if (b0 == 12) {
- op.isNum = gFalse;
+ op.isNum = false;
op.op = 0x0c00 + getU8(pos++, ok);
} else {
- op.isNum = gFalse;
+ op.isNum = false;
op.op = b0;
}
@@ -2698,7 +2698,7 @@ int FoFiType1C::getDeltaFPArray(double *arr, int maxLen) const {
return n;
}
-void FoFiType1C::getIndex(int pos, Type1CIndex *idx, GBool *ok) const {
+void FoFiType1C::getIndex(int pos, Type1CIndex *idx, bool *ok) const {
idx->pos = pos;
idx->len = getU16BE(pos, ok);
if (idx->len == 0) {
@@ -2708,26 +2708,26 @@ void FoFiType1C::getIndex(int pos, Type1CIndex *idx, GBool *ok) const {
} else {
idx->offSize = getU8(pos + 2, ok);
if (idx->offSize < 1 || idx->offSize > 4) {
- *ok = gFalse;
+ *ok = false;
}
idx->startPos = pos + 3 + (idx->len + 1) * idx->offSize - 1;
if (idx->startPos < 0 || idx->startPos >= len) {
- *ok = gFalse;
+ *ok = false;
}
idx->endPos = idx->startPos + getUVarBE(pos + 3 + idx->len * idx->offSize,
idx->offSize, ok);
if (idx->endPos < idx->startPos || idx->endPos > len) {
- *ok = gFalse;
+ *ok = false;
}
}
}
void FoFiType1C::getIndexVal(const Type1CIndex *idx, int i,
- Type1CIndexVal *val, GBool *ok) const {
+ Type1CIndexVal *val, bool *ok) const {
int pos0, pos1;
if (i < 0 || i >= idx->len) {
- *ok = gFalse;
+ *ok = false;
return;
}
pos0 = idx->startPos + getUVarBE(idx->pos + 3 + i * idx->offSize,
@@ -2737,14 +2737,14 @@ void FoFiType1C::getIndexVal(const Type1CIndex *idx, int i,
if (pos0 < idx->startPos || pos0 > idx->endPos ||
pos1 <= idx->startPos || pos1 > idx->endPos ||
pos1 < pos0) {
- *ok = gFalse;
+ *ok = false;
return;
}
val->pos = pos0;
val->len = pos1 - pos0;
}
-char *FoFiType1C::getString(int sid, char *buf, GBool *ok) const {
+char *FoFiType1C::getString(int sid, char *buf, bool *ok) const {
Type1CIndexVal val;
int n;
diff --git a/fofi/FoFiType1C.h b/fofi/FoFiType1C.h
index 131fa311..0c7884fe 100644
--- a/fofi/FoFiType1C.h
+++ b/fofi/FoFiType1C.h
@@ -61,7 +61,7 @@ struct Type1CTopDict {
int paintType;
int charstringType;
double fontMatrix[6];
- GBool hasFontMatrix; // CID fonts are allowed to put their
+ bool hasFontMatrix; // CID fonts are allowed to put their
// FontMatrix in the FD instead of the
// top dict
int uniqueID;
@@ -87,7 +87,7 @@ struct Type1CTopDict {
struct Type1CPrivateDict {
double fontMatrix[6];
- GBool hasFontMatrix;
+ bool hasFontMatrix;
int blueValues[type1CMaxBlueValues];
int nBlueValues;
int otherBlues[type1CMaxOtherBlues];
@@ -100,29 +100,29 @@ struct Type1CPrivateDict {
int blueShift;
int blueFuzz;
double stdHW;
- GBool hasStdHW;
+ bool hasStdHW;
double stdVW;
- GBool hasStdVW;
+ bool hasStdVW;
double stemSnapH[type1CMaxStemSnap];
int nStemSnapH;
double stemSnapV[type1CMaxStemSnap];
int nStemSnapV;
- GBool forceBold;
- GBool hasForceBold;
+ bool forceBold;
+ bool hasForceBold;
double forceBoldThreshold;
int languageGroup;
double expansionFactor;
int initialRandomSeed;
int subrsOffset;
double defaultWidthX;
- GBool defaultWidthXFP;
+ bool defaultWidthXFP;
double nominalWidthX;
- GBool nominalWidthXFP;
+ bool nominalWidthXFP;
};
struct Type1COp {
- GBool isNum = gTrue; // true -> number, false -> operator
- GBool isFP = gFalse; // true -> floating point number, false -> int
+ bool isNum = true; // true -> number, false -> operator
+ bool isFP = false; // true -> floating point number, false -> int
union {
double num = 0; // if num is true
int op; // if num is false
@@ -132,7 +132,7 @@ struct Type1COp {
struct Type1CEexecBuf {
FoFiOutputFunc outputFunc;
void *outputStream;
- GBool ascii; // ASCII encoding?
+ bool ascii; // ASCII encoding?
Gushort r1; // eexec encryption key
int line; // number of eexec chars left on current line
};
@@ -176,7 +176,7 @@ public:
// font. If <ascii> is true the eexec section will be hex-encoded,
// otherwise it will be left as binary data. If <psName> is non-NULL,
// it will be used as the PostScript font name.
- void convertToType1(const char *psName, const char **newEncoding, GBool ascii,
+ void convertToType1(const char *psName, const char **newEncoding, bool ascii,
FoFiOutputFunc outputFunc, void *outputStream);
// Convert to a Type 0 CIDFont, suitable for embedding in a
@@ -204,33 +204,33 @@ public:
private:
- FoFiType1C(const char *fileA, int lenA, GBool freeFileDataA);
+ FoFiType1C(const char *fileA, int lenA, bool freeFileDataA);
void eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
int offset, int nBytes,
Type1CIndex *subrIdx,
Type1CPrivateDict *pDict);
void cvtGlyph(int offset, int nBytes, GooString *charBuf,
Type1CIndex *subrIdx, Type1CPrivateDict *pDict,
- GBool top);
- void cvtGlyphWidth(GBool useOp, GooString *charBuf,
+ bool top);
+ void cvtGlyphWidth(bool useOp, GooString *charBuf,
Type1CPrivateDict *pDict);
- void cvtNum(double x, GBool isFP, GooString *charBuf) const;
+ void cvtNum(double x, bool isFP, GooString *charBuf) const;
void eexecWrite(Type1CEexecBuf *eb, const char *s) const;
void eexecWriteCharstring(Type1CEexecBuf *eb, const Guchar *s, int n) const;
void writePSString(const char *s, FoFiOutputFunc outputFunc, void *outputStream) const;
- GBool parse();
+ bool parse();
void readTopDict();
void readFD(int offset, int length, Type1CPrivateDict *pDict);
void readPrivateDict(int offset, int length, Type1CPrivateDict *pDict);
void readFDSelect();
void buildEncoding();
- GBool readCharset();
- int getOp(int pos, GBool charstring, GBool *ok);
+ bool readCharset();
+ int getOp(int pos, bool charstring, bool *ok);
int getDeltaIntArray(int *arr, int maxLen) const;
int getDeltaFPArray(double *arr, int maxLen) const;
- void getIndex(int pos, Type1CIndex *idx, GBool *ok) const;
- void getIndexVal(const Type1CIndex *idx, int i, Type1CIndexVal *val, GBool *ok) const;
- char *getString(int sid, char *buf, GBool *ok) const;
+ void getIndex(int pos, Type1CIndex *idx, bool *ok) const;
+ void getIndexVal(const Type1CIndex *idx, int i, Type1CIndexVal *val, bool *ok) const;
+ char *getString(int sid, char *buf, bool *ok) const;
GooString *name;
char **encoding;
@@ -251,13 +251,13 @@ private:
Gushort charsetLength;
int gsubrBias;
- GBool parsedOk;
+ bool parsedOk;
Type1COp ops[49]; // operands and operator
int nOps; // number of operands
int nHints; // number of hints for the current glyph
- GBool firstOp; // true if we haven't hit the first op yet
- GBool openPath; // true if there is an unclosed path
+ bool firstOp; // true if we haven't hit the first op yet
+ bool openPath; // true if there is an unclosed path
};
#endif
diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc
index 3fbd3984..679e8301 100644
--- a/glib/poppler-action.cc
+++ b/glib/poppler-action.cc
@@ -444,7 +444,7 @@ find_annot_movie_for_action (PopplerDocument *document,
Object annots = p->getAnnotsObject ();
if (annots.isArray ()) {
int j;
- GBool found = gFalse;
+ bool found = false;
for (j = 0; j < annots.arrayGetLength () && !found; ++j) {
annotObj = annots.arrayGet(j);
@@ -459,7 +459,7 @@ find_annot_movie_for_action (PopplerDocument *document,
const GooString *t = obj1.getString ();
if (title->cmp(t) == 0)
- found = gTrue;
+ found = true;
}
}
if (!found)
@@ -578,7 +578,7 @@ build_ocg_state (PopplerDocument *document,
const LinkOCGState *ocg_state)
{
const GooList *st_list = ocg_state->getStateList();
- GBool preserve_rb = ocg_state->getPreserveRB();
+ bool preserve_rb = ocg_state->getPreserveRB();
gint i, j;
GList *layer_state = nullptr;
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 8567856a..eb620609 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -306,10 +306,10 @@ poppler_document_new_from_stream (GInputStream *stream,
}
if (stream_is_memory_buffer_or_local_file(stream)) {
- str = new PopplerInputStream(stream, cancellable, 0, gFalse, 0, Object(objNull));
+ str = new PopplerInputStream(stream, cancellable, 0, false, 0, Object(objNull));
} else {
CachedFile *cachedFile = new CachedFile(new PopplerCachedFileLoader(stream, cancellable, length), new GooString());
- str = new CachedFileStream(cachedFile, 0, gFalse, cachedFile->getLength(), Object(objNull));
+ str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull));
}
password_g = poppler_password_to_latin1(password);
diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
index 816cb896..2e1244b0 100644
--- a/glib/poppler-form-field.cc
+++ b/glib/poppler-form-field.cc
@@ -254,7 +254,7 @@ poppler_form_field_button_set_state (PopplerFormField *field,
{
g_return_if_fail (field->widget->getType () == formButton);
- static_cast<FormWidgetButton*>(field->widget)->setState ((GBool)state);
+ static_cast<FormWidgetButton*>(field->widget)->setState ((bool)state);
}
/**
diff --git a/glib/poppler-input-stream.cc b/glib/poppler-input-stream.cc
index 20336826..c4bab01e 100644
--- a/glib/poppler-input-stream.cc
+++ b/glib/poppler-input-stream.cc
@@ -21,7 +21,7 @@
#include "poppler-input-stream.h"
PopplerInputStream::PopplerInputStream(GInputStream *inputStreamA, GCancellable *cancellableA,
- Goffset startA, GBool limitedA, Goffset lengthA, Object &&dictA)
+ Goffset startA, bool limitedA, Goffset lengthA, Object &&dictA)
: BaseStream(std::move(dictA), lengthA)
{
inputStream = (GInputStream *)g_object_ref(inputStreamA);
@@ -32,7 +32,7 @@ PopplerInputStream::PopplerInputStream(GInputStream *inputStreamA, GCancellable
bufPtr = bufEnd = buf;
bufPos = start;
savePos = 0;
- saved = gFalse;
+ saved = false;
}
PopplerInputStream::~PopplerInputStream()
@@ -47,7 +47,7 @@ BaseStream *PopplerInputStream::copy() {
return new PopplerInputStream(inputStream, cancellable, start, limited, length, dict.copy());
}
-Stream *PopplerInputStream::makeSubStream(Goffset startA, GBool limitedA,
+Stream *PopplerInputStream::makeSubStream(Goffset startA, bool limitedA,
Goffset lengthA, Object &&dictA)
{
return new PopplerInputStream(inputStream, cancellable, startA, limitedA, lengthA, std::move(dictA));
@@ -59,7 +59,7 @@ void PopplerInputStream::reset()
savePos = (Guint)g_seekable_tell(seekable);
g_seekable_seek(seekable, start, G_SEEK_SET, cancellable, nullptr);
- saved = gTrue;
+ saved = true;
bufPtr = bufEnd = buf;
bufPos = start;
}
@@ -69,7 +69,7 @@ void PopplerInputStream::close()
if (!saved)
return;
g_seekable_seek(G_SEEKABLE(inputStream), savePos, G_SEEK_SET, cancellable, nullptr);
- saved = gFalse;
+ saved = false;
}
void PopplerInputStream::setPos(Goffset pos, int dir)
@@ -100,14 +100,14 @@ void PopplerInputStream::moveStart(Goffset delta)
bufPos = start;
}
-GBool PopplerInputStream::fillBuf()
+bool PopplerInputStream::fillBuf()
{
int n;
bufPos += bufEnd - buf;
bufPtr = bufEnd = buf;
if (limited && bufPos >= start + length) {
- return gFalse;
+ return false;
}
if (limited && bufPos + inputStreamBufSize > start + length) {
@@ -119,10 +119,10 @@ GBool PopplerInputStream::fillBuf()
n = g_input_stream_read(inputStream, buf, n, cancellable, nullptr);
bufEnd = buf + n;
if (bufPtr >= bufEnd) {
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
int PopplerInputStream::getChars(int nChars, Guchar *buffer)
diff --git a/glib/poppler-input-stream.h b/glib/poppler-input-stream.h
index 536487a4..97448d2f 100644
--- a/glib/poppler-input-stream.h
+++ b/glib/poppler-input-stream.h
@@ -31,10 +31,10 @@ class PopplerInputStream: public BaseStream {
public:
PopplerInputStream(GInputStream *inputStream, GCancellable *cancellableA,
- Goffset startA, GBool limitedA, Goffset lengthA, Object &&dictA);
+ Goffset startA, bool limitedA, Goffset lengthA, Object &&dictA);
~PopplerInputStream();
BaseStream *copy() override;
- Stream *makeSubStream(Goffset start, GBool limited,
+ Stream *makeSubStream(Goffset start, bool limited,
Goffset lengthA, Object &&dictA) override;
StreamKind getKind() override { return strWeird; }
void reset() override;
@@ -53,21 +53,21 @@ public:
private:
- GBool fillBuf();
+ bool fillBuf();
- GBool hasGetChars() override { return true; }
+ bool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
GInputStream *inputStream;
GCancellable *cancellable;
Goffset start;
- GBool limited;
+ bool limited;
char buf[inputStreamBufSize];
char *bufPtr;
char *bufEnd;
Goffset bufPos;
int savePos;
- GBool saved;
+ bool saved;
};
#endif /* __GI_SCANNER__ */
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index 2934aba5..6a592fbc 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -265,13 +265,13 @@ poppler_page_get_text_page (PopplerPage *page)
TextOutputDev *text_dev;
Gfx *gfx;
- text_dev = new TextOutputDev (nullptr, gTrue, 0, gFalse, gFalse);
+ text_dev = new TextOutputDev (nullptr, true, 0, false, false);
gfx = page->page->createGfx(text_dev,
72.0, 72.0, 0,
- gFalse, /* useMediaBox */
- gTrue, /* Crop */
+ false, /* useMediaBox */
+ true, /* Crop */
-1, -1, -1, -1,
- gFalse, /* printing */
+ false, /* printing */
nullptr, nullptr);
page->page->display(gfx);
text_dev->endPage();
@@ -304,13 +304,13 @@ annot_is_markup (Annot *annot)
}
}
-static GBool
+static bool
poppler_print_annot_cb (Annot *annot, void *user_data)
{
PopplerPrintFlags user_print_flags = (PopplerPrintFlags)GPOINTER_TO_INT (user_data);
if (annot->getFlags () & Annot::flagHidden)
- return gFalse;
+ return false;
if (user_print_flags & POPPLER_PRINT_STAMP_ANNOTS_ONLY) {
return (annot->getType() == Annot::typeStamp) ?
@@ -331,7 +331,7 @@ poppler_print_annot_cb (Annot *annot, void *user_data)
static void
_poppler_page_render (PopplerPage *page,
cairo_t *cairo,
- GBool printing,
+ bool printing,
PopplerPrintFlags print_flags)
{
CairoOutputDev *output_dev;
@@ -344,7 +344,7 @@ _poppler_page_render (PopplerPage *page,
if (!printing && page->text == nullptr) {
- page->text = new TextPage (gFalse);
+ page->text = new TextPage (false);
output_dev->setTextPage (page->text);
}
/* NOTE: instead of passing -1 we should/could use cairo_clip_extents()
@@ -352,8 +352,8 @@ _poppler_page_render (PopplerPage *page,
cairo_save (cairo);
page->page->displaySlice(output_dev,
72.0, 72.0, 0,
- gFalse, /* useMediaBox */
- gTrue, /* Crop */
+ false, /* useMediaBox */
+ true, /* Crop */
-1, -1,
-1, -1,
printing,
@@ -382,7 +382,7 @@ poppler_page_render (PopplerPage *page,
{
g_return_if_fail (POPPLER_IS_PAGE (page));
- _poppler_page_render (page, cairo, gFalse, (PopplerPrintFlags)0);
+ _poppler_page_render (page, cairo, false, (PopplerPrintFlags)0);
}
/**
@@ -403,7 +403,7 @@ poppler_page_render_for_printing_with_options (PopplerPage *page,
{
g_return_if_fail (POPPLER_IS_PAGE (page));
- _poppler_page_render (page, cairo, gTrue, options);
+ _poppler_page_render (page, cairo, true, options);
}
/**
@@ -419,7 +419,7 @@ poppler_page_render_for_printing (PopplerPage *page,
{
g_return_if_fail (POPPLER_IS_PAGE (page));
- _poppler_page_render (page, cairo, gTrue, POPPLER_PRINT_ALL);
+ _poppler_page_render (page, cairo, true, POPPLER_PRINT_ALL);
}
static cairo_surface_t *
@@ -911,9 +911,9 @@ poppler_page_find_text_with_options (PopplerPage *page,
yMin = backwards ? height : 0;
while (text_dev->findText (ucs4, ucs4_len,
- gFalse, gTrue, // startAtTop, stopAtBottom
+ false, true, // startAtTop, stopAtBottom
start_at_last,
- gFalse, //stopAtLast
+ false, //stopAtLast
options & POPPLER_FIND_CASE_SENSITIVE,
backwards,
options & POPPLER_FIND_WHOLE_WORDS_ONLY,
@@ -953,7 +953,7 @@ poppler_page_find_text (PopplerPage *page,
static CairoImageOutputDev *
poppler_page_get_image_output_dev (PopplerPage *page,
- GBool (*imgDrawDeviceCbk)(int img_id, void *data),
+ bool (*imgDrawDeviceCbk)(int img_id, void *data),
void *imgDrawCbkData)
{
CairoImageOutputDev *image_dev;
@@ -968,10 +968,10 @@ poppler_page_get_image_output_dev (PopplerPage *page,
gfx = page->page->createGfx(image_dev,
72.0, 72.0, 0,
- gFalse, /* useMediaBox */
- gTrue, /* Crop */
+ false, /* useMediaBox */
+ true, /* Crop */
-1, -1, -1, -1,
- gFalse, /* printing */
+ false, /* printing */
nullptr, nullptr);
page->page->display(gfx);
delete gfx;
@@ -1026,7 +1026,7 @@ poppler_page_get_image_mapping (PopplerPage *page)
return map_list;
}
-static GBool
+static bool
image_draw_decide_cb (int image_id, void *data)
{
return (image_id == GPOINTER_TO_INT (data));
@@ -1116,12 +1116,12 @@ poppler_page_render_to_ps (PopplerPage *page,
nullptr, pages,
psModePS, (int)ps_file->paper_width,
(int)ps_file->paper_height, ps_file->duplex,
- 0, 0, 0, 0, gFalse, gFalse);
+ 0, 0, 0, 0, false, false);
}
ps_file->document->doc->displayPage (ps_file->out, page->index + 1, 72.0, 72.0,
- 0, gFalse, gTrue, gFalse);
+ 0, false, true, false);
}
static void
diff --git a/glib/poppler-structure-element.cc b/glib/poppler-structure-element.cc
index 6ee8bc65..0e71285f 100644
--- a/glib/poppler-structure-element.cc
+++ b/glib/poppler-structure-element.cc
@@ -400,7 +400,7 @@ static EnumType
attr_to_enum (PopplerStructureElement *poppler_structure_element)
{
const Attribute *attr =
- poppler_structure_element->elem->findAttribute (EnumNameValue<EnumType>::attribute_type, gTrue);
+ poppler_structure_element->elem->findAttribute (EnumNameValue<EnumType>::attribute_type, true);
return name_to_enum<EnumType> ((attr != nullptr)
? attr->getValue ()
: Attribute::getDefaultValue (EnumNameValue<EnumType>::attribute_type));
@@ -412,7 +412,7 @@ attr_value_or_default (PopplerStructureElement *poppler_structure_element,
Attribute::Type attribute_type)
{
const Attribute *attr =
- poppler_structure_element->elem->findAttribute (attribute_type, gTrue);
+ poppler_structure_element->elem->findAttribute (attribute_type, true);
return attr ? attr->getValue () : Attribute::getDefaultValue (attribute_type);
}
diff --git a/goo/FixedPoint.cc b/goo/FixedPoint.cc
index 565b86c2..31e04b68 100644
--- a/goo/FixedPoint.cc
+++ b/goo/FixedPoint.cc
@@ -117,19 +117,19 @@ int FixedPoint::div(int x, int y) {
}
}
-GBool FixedPoint::divCheck(FixedPoint x, FixedPoint y, FixedPoint *result) {
+bool FixedPoint::divCheck(FixedPoint x, FixedPoint y, FixedPoint *result) {
FixPtInt64 z;
z = ((FixPtInt64)x.val << fixptShift) / y.val;
if ((z == 0 && x != 0) ||
z >= ((FixPtInt64)1 << 31) || z < -((FixPtInt64)1 << 31)) {
- return gFalse;
+ return false;
}
result->val = z;
- return gTrue;
+ return true;
}
-GBool FixedPoint::checkDet(FixedPoint m11, FixedPoint m12,
+bool FixedPoint::checkDet(FixedPoint m11, FixedPoint m12,
FixedPoint m21, FixedPoint m22,
FixedPoint epsilon) {
FixPtInt64 det, e;
diff --git a/goo/FixedPoint.h b/goo/FixedPoint.h
index a7b406ec..9ba5ed7a 100644
--- a/goo/FixedPoint.h
+++ b/goo/FixedPoint.h
@@ -154,11 +154,11 @@ public:
// Compute *result = x/y; return false if there is an underflow or
// overflow.
- static GBool divCheck(FixedPoint x, FixedPoint y, FixedPoint *result);
+ static bool divCheck(FixedPoint x, FixedPoint y, FixedPoint *result);
// Compute abs(m11*m22 - m12*m21) >= epsilon, handling the case
// where the multiplications overflow.
- static GBool checkDet(FixedPoint m11, FixedPoint m12,
+ static bool checkDet(FixedPoint m11, FixedPoint m12,
FixedPoint m21, FixedPoint m22,
FixedPoint epsilon);
diff --git a/goo/GooString.cc b/goo/GooString.cc
index 42bf604e..b1a7ae86 100644
--- a/goo/GooString.cc
+++ b/goo/GooString.cc
@@ -228,7 +228,7 @@ GooString *GooString::fromInt(int x) {
char buf[24]; // enough space for 64-bit ints plus a little extra
const char *p;
int len;
- formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
+ formatInt(x, buf, sizeof(buf), false, 0, 10, &p, &len);
return new GooString(p, len);
}
@@ -292,7 +292,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
int argsLen, argsSize;
GooStringFormatArg arg;
int idx, width, prec;
- GBool reverseAlign, zeroFill;
+ bool reverseAlign, zeroFill;
GooStringFormatType ft;
char buf[65];
int len, i;
@@ -326,10 +326,10 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
}
++p0;
if (*p0 == '-') {
- reverseAlign = gTrue;
+ reverseAlign = true;
++p0;
} else {
- reverseAlign = gFalse;
+ reverseAlign = false;
}
width = 0;
zeroFill = *p0 == '0';
@@ -452,7 +452,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
break;
case fmtIntHexUpper:
formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 16, &str, &len,
- gTrue);
+ true);
break;
case fmtIntOctal:
formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
@@ -470,7 +470,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
break;
case fmtUIntHexUpper:
formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 16,
- &str, &len, gTrue);
+ &str, &len, true);
break;
case fmtUIntOctal:
formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
@@ -486,7 +486,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
break;
case fmtLongHexUpper:
formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 16, &str, &len,
- gTrue);
+ true);
break;
case fmtLongOctal:
formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
@@ -504,7 +504,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
break;
case fmtULongHexUpper:
formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 16,
- &str, &len, gTrue);
+ &str, &len, true);
break;
case fmtULongOctal:
formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
@@ -520,7 +520,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
break;
case fmtLongLongHexUpper:
formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 16, &str, &len,
- gTrue);
+ true);
break;
case fmtLongLongOctal:
formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
@@ -538,7 +538,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
break;
case fmtULongLongHexUpper:
formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 16,
- &str, &len, gTrue);
+ &str, &len, true);
break;
case fmtULongLongOctal:
formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 8,
@@ -549,13 +549,13 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
&str, &len);
break;
case fmtDouble:
- formatDouble(arg.f, buf, sizeof(buf), prec, gFalse, &str, &len);
+ formatDouble(arg.f, buf, sizeof(buf), prec, false, &str, &len);
break;
case fmtDoubleTrim:
- formatDouble(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
+ formatDouble(arg.f, buf, sizeof(buf), prec, true, &str, &len);
break;
case fmtDoubleTrimSmallAware:
- formatDoubleSmallAware(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
+ formatDoubleSmallAware(arg.f, buf, sizeof(buf), prec, true, &str, &len);
break;
case fmtChar:
buf[0] = arg.c;
@@ -619,10 +619,10 @@ static const char lowerCaseDigits[17] = "0123456789abcdef";
static const char upperCaseDigits[17] = "0123456789ABCDEF";
void GooString::formatInt(long long x, char *buf, int bufSize,
- GBool zeroFill, int width, int base,
- const char **p, int *len, GBool upperCase) {
+ bool zeroFill, int width, int base,
+ const char **p, int *len, bool upperCase) {
const char *vals = upperCase ? upperCaseDigits : lowerCaseDigits;
- GBool neg;
+ bool neg;
int start, i, j;
unsigned long long abs_x;
@@ -654,8 +654,8 @@ void GooString::formatInt(long long x, char *buf, int bufSize,
}
void GooString::formatUInt(unsigned long long x, char *buf, int bufSize,
- GBool zeroFill, int width, int base,
- const char **p, int *len, GBool upperCase) {
+ bool zeroFill, int width, int base,
+ const char **p, int *len, bool upperCase) {
const char *vals = upperCase ? upperCaseDigits : lowerCaseDigits;
int i, j;
@@ -678,8 +678,8 @@ void GooString::formatUInt(unsigned long long x, char *buf, int bufSize,
}
void GooString::formatDouble(double x, char *buf, int bufSize, int prec,
- GBool trim, const char **p, int *len) {
- GBool neg, started;
+ bool trim, const char **p, int *len) {
+ bool neg, started;
double x2;
int d, i, j;
@@ -694,7 +694,7 @@ void GooString::formatDouble(double x, char *buf, int bufSize, int prec,
d = (int)floor(x - 10 * x2 + 0.5);
if (started || d != 0) {
buf[--i] = '0' + d;
- started = gTrue;
+ started = true;
}
x = x2;
}
@@ -717,7 +717,7 @@ void GooString::formatDouble(double x, char *buf, int bufSize, int prec,
}
void GooString::formatDoubleSmallAware(double x, char *buf, int bufSize, int prec,
- GBool trim, const char **p, int *len)
+ bool trim, const char **p, int *len)
{
double absX = fabs(x);
if (absX >= 0.1) {
@@ -864,16 +864,16 @@ int GooString::cmpN(const char *sA, int n) const {
return 0;
}
-GBool GooString::endsWith(const char *suffix) const {
+bool GooString::endsWith(const char *suffix) const {
int suffixLen = strlen(suffix);
if (length < suffixLen)
- return gFalse;
+ return false;
return strcmp(s + length - suffixLen, suffix) == 0;
}
-GBool GooString::hasUnicodeMarker(void) const
+bool GooString::hasUnicodeMarker(void) const
{
return length > 1 && (s[0] & 0xff) == 0xfe && (s[1] & 0xff) == 0xff;
}
@@ -884,7 +884,7 @@ void GooString::prependUnicodeMarker()
insert(0, (char)0xfe);
}
-GooString *GooString::sanitizedName(GBool psmode) const
+GooString *GooString::sanitizedName(bool psmode) const
{
GooString *name;
char buf[8];
diff --git a/goo/GooString.h b/goo/GooString.h
index 4755526a..4b040942 100644
--- a/goo/GooString.h
+++ b/goo/GooString.h
@@ -155,17 +155,17 @@ public:
int cmpN(const char *sA, int n) const;
// Return true if string ends with suffix
- GBool endsWith(const char *suffix) const;
+ bool endsWith(const char *suffix) const;
- GBool hasUnicodeMarker(void) const;
+ bool hasUnicodeMarker(void) const;
void prependUnicodeMarker();
- GBool hasJustUnicodeMarker(void) const { return length == 2 && hasUnicodeMarker(); }
+ bool hasJustUnicodeMarker(void) const { return length == 2 && hasUnicodeMarker(); }
// Sanitizes the string so that it does
// not contain any ( ) < > [ ] { } / %
// The postscript mode also has some more strict checks
// The caller owns the return value
- GooString *sanitizedName(GBool psmode) const;
+ GooString *sanitizedName(bool psmode) const;
// Conversion from and to std::string
explicit GooString(const std::string& str) : GooString(str.data(), str.size()) {}
@@ -189,15 +189,15 @@ private:
void resize(int newLength);
static void formatInt(long long x, char *buf, int bufSize,
- GBool zeroFill, int width, int base,
- const char **p, int *len, GBool upperCase = gFalse);
+ bool zeroFill, int width, int base,
+ const char **p, int *len, bool upperCase = false);
static void formatUInt(unsigned long long x, char *buf, int bufSize,
- GBool zeroFill, int width, int base,
- const char **p, int *len, GBool upperCase = gFalse);
+ bool zeroFill, int width, int base,
+ const char **p, int *len, bool upperCase = false);
static void formatDouble(double x, char *buf, int bufSize, int prec,
- GBool trim, const char **p, int *len);
+ bool trim, const char **p, int *len);
static void formatDoubleSmallAware(double x, char *buf, int bufSize, int prec,
- GBool trim, const char **p, int *len);
+ bool trim, const char **p, int *len);
};
#endif
diff --git a/goo/GooTimer.h b/goo/GooTimer.h
index be0b6ff1..9df747b7 100644
--- a/goo/GooTimer.h
+++ b/goo/GooTimer.h
@@ -52,7 +52,7 @@ private:
LARGE_INTEGER start_time;
LARGE_INTEGER end_time;
#endif
- GBool active;
+ bool active;
};
#endif
diff --git a/goo/gdir.h b/goo/gdir.h
index 4df9db32..505b4b08 100644
--- a/goo/gdir.h
+++ b/goo/gdir.h
@@ -46,11 +46,11 @@ class GooString;
class GDirEntry {
public:
- GDirEntry(const char *dirPath, const char *nameA, GBool doStat);
+ GDirEntry(const char *dirPath, const char *nameA, bool doStat);
~GDirEntry();
const GooString *getName() const { return name; }
const GooString *getFullPath() const { return fullPath; }
- GBool isDir() const { return dir; }
+ bool isDir() const { return dir; }
private:
GDirEntry(const GDirEntry &other);
@@ -58,13 +58,13 @@ private:
GooString *name; // dir/file name
GooString *fullPath;
- GBool dir; // is it a directory?
+ bool dir; // is it a directory?
};
class GDir {
public:
- GDir(const char *name, GBool doStatA = gTrue);
+ GDir(const char *name, bool doStatA = true);
~GDir();
GDirEntry *getNextEntry();
void rewind();
@@ -74,7 +74,7 @@ private:
GDir& operator=(const GDir &other);
GooString *path; // directory path
- GBool doStat; // call stat() for each entry?
+ bool doStat; // call stat() for each entry?
#if defined(_WIN32)
WIN32_FIND_DATAA ffd;
HANDLE hnd;
@@ -83,7 +83,7 @@ private:
#else
DIR *dir; // the DIR structure from opendir()
#ifdef VMS
- GBool needParent; // need to return an entry for [-]
+ bool needParent; // need to return an entry for [-]
#endif
#endif
};
diff --git a/goo/gfile.cc b/goo/gfile.cc
index dcfd1124..125cbed2 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -513,7 +513,7 @@ bool GooFile::modificationTimeChangedSinceOpen() const
// GDir and GDirEntry
//------------------------------------------------------------------------
-GDirEntry::GDirEntry(const char *dirPath, const char *nameA, GBool doStat) {
+GDirEntry::GDirEntry(const char *dirPath, const char *nameA, bool doStat) {
#ifdef VMS
char *p;
#elif defined(_WIN32)
@@ -524,14 +524,14 @@ GDirEntry::GDirEntry(const char *dirPath, const char *nameA, GBool doStat) {
#endif
name = new GooString(nameA);
- dir = gFalse;
+ dir = false;
fullPath = new GooString(dirPath);
appendToPath(fullPath, nameA);
if (doStat) {
#ifdef VMS
if (!strcmp(nameA, "-") ||
((p = strrchr(nameA, '.')) && !strncmp(p, ".DIR;", 5)))
- dir = gTrue;
+ dir = true;
#elif defined(ACORN)
#else
#ifdef _WIN32
@@ -550,7 +550,7 @@ GDirEntry::~GDirEntry() {
delete name;
}
-GDir::GDir(const char *name, GBool doStatA) {
+GDir::GDir(const char *name, bool doStatA) {
path = new GooString(name);
doStat = doStatA;
#if defined(_WIN32)
@@ -603,7 +603,7 @@ GDirEntry *GDir::getNextEntry() {
if (dir) {
if (needParent) {
e = new GDirEntry(path->getCString(), "-", doStat);
- needParent = gFalse;
+ needParent = false;
return e;
}
ent = readdir(dir);
diff --git a/goo/gtypes.h b/goo/gtypes.h
index a8d45194..922cf905 100644
--- a/goo/gtypes.h
+++ b/goo/gtypes.h
@@ -28,18 +28,6 @@
#include "poppler-config.h"
/*
- * These have stupid names to avoid conflicts with some (but not all)
- * C++ compilers which define them.
- */
-typedef bool GBool;
-#define gTrue true
-#define gFalse false
-
-#ifdef _MSC_VER
-#pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
-#endif
-
-/*
* These have stupid names to avoid conflicts with <sys/types.h>,
* which on various systems defines some random subset of these.
*/
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 4f7a18c4..d5c6ec0c 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -468,8 +468,8 @@ AnnotBorder::AnnotBorder() {
style = borderSolid;
}
-GBool AnnotBorder::parseDashArray(Object *dashObj) {
- GBool correct = gTrue;
+bool AnnotBorder::parseDashArray(Object *dashObj) {
+ bool correct = true;
const int tempLength = dashObj->arrayGetLength();
double *tempDash = (double *) gmallocn (tempLength, sizeof (double));
@@ -481,7 +481,7 @@ GBool AnnotBorder::parseDashArray(Object *dashObj) {
correct = tempDash[i] >= 0;
} else {
- correct = gFalse;
+ correct = false;
}
}
@@ -514,7 +514,7 @@ AnnotBorderArray::AnnotBorderArray(Array *array) {
Object obj1;
int arrayLength = array->getLength();
- GBool correct = gTrue;
+ bool correct = true;
if (arrayLength == 3 || arrayLength == 4) {
// implementation note 81 in Appendix H.
@@ -522,29 +522,29 @@ AnnotBorderArray::AnnotBorderArray(Array *array) {
if (obj1.isNum())
horizontalCorner = obj1.getNum();
else
- correct = gFalse;
+ correct = false;
obj1 = array->get(1);
if (obj1.isNum())
verticalCorner = obj1.getNum();
else
- correct = gFalse;
+ correct = false;
obj1 = array->get(2);
if (obj1.isNum())
width = obj1.getNum();
else
- correct = gFalse;
+ correct = false;
if (arrayLength == 4) {
obj1 = array->get(3);
if (obj1.isArray())
correct = parseDashArray(&obj1);
else
- correct = gFalse;
+ correct = false;
}
} else {
- correct = gFalse;
+ correct = false;
}
if (!correct) {
@@ -800,7 +800,7 @@ void DefaultAppearance::setFontColor(std::unique_ptr<AnnotColor> fontColorA) {
GooString *DefaultAppearance::toAppearanceString() const {
AnnotAppearanceBuilder appearBuilder;
if (fontColor) {
- appearBuilder.setDrawColor(fontColor.get(), gTrue);
+ appearBuilder.setDrawColor(fontColor.get(), true);
}
appearBuilder.setTextFont(fontName, fontPtSize);
return appearBuilder.buffer()->copy();
@@ -863,7 +863,7 @@ AnnotIconFit::AnnotIconFit(Dict* dict) {
if (obj1.isBool()) {
fullyBounds = obj1.getBool();
} else {
- fullyBounds = gFalse;
+ fullyBounds = false;
}
}
@@ -926,11 +926,11 @@ int AnnotAppearance::getNumStates() {
}
// Test if stateObj (a Ref or a Dict) points to the specified stream
-GBool AnnotAppearance::referencesStream(Object *stateObj, Ref refToStream) {
+bool AnnotAppearance::referencesStream(Object *stateObj, Ref refToStream) {
if (stateObj->isRef()) {
Ref r = stateObj->getRef();
if (r.num == refToStream.num && r.gen == refToStream.gen) {
- return gTrue;
+ return true;
}
} else if (stateObj->isDict()) { // Test each value
const int size = stateObj->dictGetLength();
@@ -939,29 +939,29 @@ GBool AnnotAppearance::referencesStream(Object *stateObj, Ref refToStream) {
if (obj1.isRef()) {
Ref r = obj1.getRef();
if (r.num == refToStream.num && r.gen == refToStream.gen) {
- return gTrue;
+ return true;
}
}
}
}
- return gFalse; // Not found
+ return false; // Not found
}
// Test if this AnnotAppearance references the specified stream
-GBool AnnotAppearance::referencesStream(Ref refToStream) {
+bool AnnotAppearance::referencesStream(Ref refToStream) {
Object obj1;
- GBool found;
+ bool found;
// Scan each state's ref/subdictionary
obj1 = appearDict.dictLookupNF("N");
found = referencesStream(&obj1, refToStream);
if (found)
- return gTrue;
+ return true;
obj1 = appearDict.dictLookupNF("R");
found = referencesStream(&obj1, refToStream);
if (found)
- return gTrue;
+ return true;
obj1 = appearDict.dictLookupNF("D");
found = referencesStream(&obj1, refToStream);
@@ -1167,10 +1167,10 @@ Annot::Annot(PDFDoc *docA, Object *dictObject) {
Annot::Annot(PDFDoc *docA, Object *dictObject, Object *obj) {
refCnt = 1;
if (obj->isRef()) {
- hasRef = gTrue;
+ hasRef = true;
ref = obj->getRef();
} else {
- hasRef = gFalse;
+ hasRef = false;
}
flags = flagUnknown;
type = typeUnknown;
@@ -1181,7 +1181,7 @@ Annot::Annot(PDFDoc *docA, Object *dictObject, Object *obj) {
void Annot::initialize(PDFDoc *docA, Dict *dict) {
Object apObj, asObj, obj1;
- ok = gTrue;
+ ok = true;
doc = docA;
xref = doc->getXRef();
@@ -1212,7 +1212,7 @@ void Annot::initialize(PDFDoc *docA, Dict *dict) {
rect->x1 = rect->y1 = 0;
rect->x2 = rect->y2 = 1;
error(errSyntaxError, -1, "Bad bounding box for annotation");
- ok = gFalse;
+ ok = false;
}
obj1 = dict->lookup("Contents");
@@ -1341,7 +1341,7 @@ void Annot::setRect(double x1, double y1, double x2, double y2) {
invalidateAppearance();
}
-GBool Annot::inRect(double x, double y) const {
+bool Annot::inRect(double x, double y) const {
return rect->contains(x, y);
}
@@ -1430,7 +1430,7 @@ void Annot::setColor(std::unique_ptr<AnnotColor> &&new_color) {
invalidateAppearance();
}
-void Annot::setPage(int pageIndex, GBool updateP) {
+void Annot::setPage(int pageIndex, bool updateP) {
annotLocker();
Page *pageobj = doc->getPage(pageIndex);
Object obj1(objNull);
@@ -1507,7 +1507,7 @@ void Annot::readArrayNum(Object *pdfArray, int key, double *value) {
*value = valueObject.getNum();
} else {
*value = 0;
- ok = gFalse;
+ ok = false;
}
}
@@ -1528,7 +1528,7 @@ void Annot::decRefCnt() {
Annot::~Annot() {}
-void AnnotAppearanceBuilder::setDrawColor(const AnnotColor *drawColor, GBool fill) {
+void AnnotAppearanceBuilder::setDrawColor(const AnnotColor *drawColor, bool fill) {
const double *values = drawColor->getValues();
switch (drawColor->getSpace()) {
@@ -1580,7 +1580,7 @@ void AnnotAppearanceBuilder::setLineStyleForBorder(const AnnotBorder *border) {
// Draw an (approximate) circle of radius <r> centered at (<cx>, <cy>).
// If <fill> is true, the circle is filled; otherwise it is stroked.
-void AnnotAppearanceBuilder::drawCircle(double cx, double cy, double r, GBool fill) {
+void AnnotAppearanceBuilder::drawCircle(double cx, double cy, double r, bool fill) {
appearBuf->appendf("{0:.2f} {1:.2f} m\n",
cx + r, cy);
appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
@@ -1652,11 +1652,11 @@ void AnnotAppearanceBuilder::drawCircleBottomRight(double cx, double cy, double
appearBuf->append("S\n");
}
-Object Annot::createForm(const GooString *appearBuf, double *bbox, GBool transparencyGroup, Dict *resDict) {
+Object Annot::createForm(const GooString *appearBuf, double *bbox, bool transparencyGroup, Dict *resDict) {
return createForm(appearBuf, bbox, transparencyGroup, resDict ? Object(resDict) : Object());
}
-Object Annot::createForm(const GooString *appearBuf, double *bbox, GBool transparencyGroup, Object &&resDictObject) {
+Object Annot::createForm(const GooString *appearBuf, double *bbox, bool transparencyGroup, Object &&resDictObject) {
Dict *appearDict = new Dict(xref);
appearDict->set("Length", Object(appearBuf->getLength()));
appearDict->set("Subtype", Object(objName, "Form"));
@@ -1717,22 +1717,22 @@ Object Annot::getAppearanceResDict() {
return Object(objNull);
}
-GBool Annot::isVisible(GBool printing) {
+bool Annot::isVisible(bool printing) {
// check the flags
if ((flags & flagHidden) ||
(printing && !(flags & flagPrint)) ||
(!printing && (flags & flagNoView))) {
- return gFalse;
+ return false;
}
// check the OC
OCGs *optContentConfig = doc->getCatalog()->getOptContentConfig();
if (optContentConfig) {
if (! optContentConfig->optContentIsVisible(&oc))
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
int Annot::getRotation() const
@@ -1747,7 +1747,7 @@ int Annot::getRotation() const
}
}
-void Annot::draw(Gfx *gfx, GBool printing) {
+void Annot::draw(Gfx *gfx, bool printing) {
annotLocker();
if (!isVisible (printing))
return;
@@ -1789,7 +1789,7 @@ void AnnotPopup::initialize(PDFDoc *docA, Dict *dict) {
if (obj1.isBool()) {
open = obj1.getBool();
} else {
- open = gFalse;
+ open = false;
}
}
@@ -1802,7 +1802,7 @@ void AnnotPopup::setParent(Annot *parentA) {
update ("Parent", Object(parentRef.num, parentRef.gen));
}
-void AnnotPopup::setOpen(GBool openA) {
+void AnnotPopup::setOpen(bool openA) {
open = openA;
update ("Open", Object(open));
}
@@ -1987,7 +1987,7 @@ void AnnotText::initialize(PDFDoc *docA, Dict *dict) {
if (obj1.isBool())
open = obj1.getBool();
else
- open = gFalse;
+ open = false;
obj1 = dict->lookup("Name");
if (obj1.isName()) {
@@ -2060,7 +2060,7 @@ void AnnotText::initialize(PDFDoc *docA, Dict *dict) {
}
}
-void AnnotText::setOpen(GBool openA) {
+void AnnotText::setOpen(bool openA) {
open = openA;
update ("Open", Object(open));
}
@@ -2323,7 +2323,7 @@ void AnnotText::setIcon(GooString *new_icon) {
"16.641 7.859 20 12 20 c 16.141 20 19.5 16.641 19.5 12.5 c h\n" \
"19.5 12.5 m S\n"
-void AnnotText::draw(Gfx *gfx, GBool printing) {
+void AnnotText::draw(Gfx *gfx, bool printing) {
double ca = 1;
if (!isVisible (printing))
@@ -2337,7 +2337,7 @@ void AnnotText::draw(Gfx *gfx, GBool printing) {
appearBuilder.append ("q\n");
if (color)
- appearBuilder.setDrawColor(color.get(), gTrue);
+ appearBuilder.setDrawColor(color.get(), true);
else
appearBuilder.append ("1 1 1 rg\n");
if (!icon->cmp("Note"))
@@ -2366,13 +2366,13 @@ void AnnotText::draw(Gfx *gfx, GBool printing) {
double bbox[4];
appearBBox->getBBoxRect(bbox);
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, nullptr);
+ appearance = createForm(appearBuilder.buffer(), bbox, false, nullptr);
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
@@ -2463,7 +2463,7 @@ void AnnotLink::initialize(PDFDoc *docA, Dict *dict) {
}
}
-void AnnotLink::draw(Gfx *gfx, GBool printing) {
+void AnnotLink::draw(Gfx *gfx, bool printing) {
if (!isVisible (printing))
return;
@@ -2505,7 +2505,7 @@ void AnnotFreeText::initialize(PDFDoc *docA, Dict *dict) {
} else {
appearanceString = std::make_unique<GooString>();
error(errSyntaxError, -1, "Bad appearance for annotation");
- ok = gFalse;
+ ok = false;
}
obj1 = dict->lookup("Q");
@@ -2707,15 +2707,15 @@ void AnnotFreeText::generateFreeTextAppearance()
contents = std::make_unique<GooString>();
// Draw box
- GBool doFill = (color && color->getSpace() != AnnotColor::colorTransparent);
- GBool doStroke = (borderWidth != 0);
+ bool doFill = (color && color->getSpace() != AnnotColor::colorTransparent);
+ bool doStroke = (borderWidth != 0);
if (doFill || doStroke) {
if (doStroke) {
- appearBuilder.setDrawColor(da.getFontColor(), gFalse); // Border color: same as font color
+ appearBuilder.setDrawColor(da.getFontColor(), false); // Border color: same as font color
}
appearBuilder.appendf ("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re\n", borderWidth/2, width-borderWidth, height-borderWidth);
if (doFill) {
- appearBuilder.setDrawColor(color.get(), gTrue);
+ appearBuilder.setDrawColor(color.get(), true);
appearBuilder.append(doStroke ? "B\n" : "f\n");
} else {
appearBuilder.append("S\n");
@@ -2768,7 +2768,7 @@ void AnnotFreeText::generateFreeTextAppearance()
}
// Set font state
- appearBuilder.setDrawColor(da.getFontColor(), gTrue);
+ appearBuilder.setDrawColor(da.getFontColor(), true);
appearBuilder.appendf ("BT 1 0 0 1 {0:.2f} {1:.2f} Tm\n", textmargin, height - textmargin - da.getFontPtSize() * font->getDescent());
appearBuilder.setTextFont(da.getFontName(), da.getFontPtSize());
@@ -2777,7 +2777,7 @@ void AnnotFreeText::generateFreeTextAppearance()
while (i < contents->getLength()) {
GooString out;
double linewidth, xpos;
- layoutText(contents.get(), &out, &i, font, &linewidth, textwidth/da.getFontPtSize(), nullptr, gFalse);
+ layoutText(contents.get(), &out, &i, font, &linewidth, textwidth/da.getFontPtSize(), nullptr, false);
linewidth *= da.getFontPtSize();
switch (quadding) {
case quaddingCentered:
@@ -2805,17 +2805,17 @@ void AnnotFreeText::generateFreeTextAppearance()
bbox[3] = rect->y2 - rect->y1;
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, std::move(resourceObj));
+ appearance = createForm(appearBuilder.buffer(), bbox, false, std::move(resourceObj));
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, std::move(resourceObj));
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, std::move(resourceObj));
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
-void AnnotFreeText::draw(Gfx *gfx, GBool printing) {
+void AnnotFreeText::draw(Gfx *gfx, bool printing) {
if (!isVisible (printing))
return;
@@ -2925,7 +2925,7 @@ void AnnotLine::initialize(PDFDoc *docA, Dict *dict) {
if (obj1.isBool()) {
caption = obj1.getBool();
} else {
- caption = gFalse;
+ caption = false;
}
obj1 = dict->lookup("IT");
@@ -3078,7 +3078,7 @@ void AnnotLine::generateLineAppearance()
AnnotAppearanceBuilder appearBuilder;
appearBuilder.append ("q\n");
if (color) {
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
}
appearBuilder.setLineStyleForBorder(border.get());
@@ -3120,7 +3120,7 @@ void AnnotLine::generateLineAppearance()
while (i < contents->getLength()) {
GooString out;
double linewidth;
- layoutText(contents.get(), &out, &i, font, &linewidth, 0, nullptr, gFalse);
+ layoutText(contents.get(), &out, &i, font, &linewidth, 0, nullptr, false);
linewidth *= fontsize;
if (linewidth > captionwidth) {
captionwidth = linewidth;
@@ -3189,7 +3189,7 @@ void AnnotLine::generateLineAppearance()
while (i < contents->getLength()) {
GooString out;
double linewidth, xpos;
- layoutText(contents.get(), &out, &i, font, &linewidth, 0, nullptr, gFalse);
+ layoutText(contents.get(), &out, &i, font, &linewidth, 0, nullptr, false);
linewidth *= fontsize;
xpos = (captionwidth - linewidth) / 2;
appearBuilder.appendf("{0:.2f} {1:.2f} Td\n", xpos - xposPrev, -fontsize);
@@ -3225,17 +3225,17 @@ void AnnotLine::generateLineAppearance()
double bbox[4];
appearBBox->getBBoxRect(bbox);
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, fontResDict);
+ appearance = createForm(appearBuilder.buffer(), bbox, false, fontResDict);
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, fontResDict);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, fontResDict);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
-void AnnotLine::draw(Gfx *gfx, GBool printing) {
+void AnnotLine::draw(Gfx *gfx, bool printing) {
if (!isVisible (printing))
return;
@@ -3329,7 +3329,7 @@ void AnnotTextMarkup::initialize(PDFDoc *docA, Dict *dict) {
quadrilaterals = std::make_unique<AnnotQuadrilaterals>(obj1.getArray(), rect.get());
} else {
error(errSyntaxError, -1, "Bad Annot Text Markup QuadPoints");
- ok = gFalse;
+ ok = false;
}
}
@@ -3378,7 +3378,7 @@ void AnnotTextMarkup::setQuadrilaterals(AnnotQuadrilaterals *quadPoints) {
invalidateAppearance();
}
-void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
+void AnnotTextMarkup::draw(Gfx *gfx, bool printing) {
double ca = 1;
int i;
@@ -3387,7 +3387,7 @@ void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
annotLocker();
if (appearance.isNull() || type == typeHighlight) {
- GBool blendMultiply = gTrue;
+ bool blendMultiply = true;
ca = opacity;
AnnotAppearanceBuilder appearBuilder;
@@ -3405,7 +3405,7 @@ void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
switch (type) {
case typeUnderline:
if (color) {
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
}
appearBuilder.append ("[] 0 d 1 w\n");
@@ -3424,9 +3424,9 @@ void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
break;
case typeStrikeOut:
if (color) {
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
}
- blendMultiply = gFalse;
+ blendMultiply = false;
appearBuilder.append ("[] 0 d 1 w\n");
for (i = 0; i < quadrilaterals->getQuadrilateralsLength(); ++i) {
@@ -3450,7 +3450,7 @@ void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
break;
case typeSquiggly:
if (color) {
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
}
appearBuilder.append ("[] 0 d 1 w\n");
@@ -3477,7 +3477,7 @@ void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
default:
case typeHighlight:
if (color)
- appearBuilder.setDrawColor(color.get(), gTrue);
+ appearBuilder.setDrawColor(color.get(), true);
double biggestBorder = 0;
for (i = 0; i < quadrilaterals->getQuadrilateralsLength(); ++i) {
@@ -3516,17 +3516,17 @@ void AnnotTextMarkup::draw(Gfx *gfx, GBool printing) {
bbox[1] = appearBBox->getPageYMin();
bbox[2] = appearBBox->getPageXMax();
bbox[3] = appearBBox->getPageYMax();
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", 1, blendMultiply ? "Multiply" : nullptr);
if (ca == 1) {
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
} else {
- aStream = createForm(&appearBuf, bbox, gTrue, resDict);
+ aStream = createForm(&appearBuf, bbox, true, resDict);
Dict *resDict2 = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict2);
+ appearance = createForm(&appearBuf, bbox, false, resDict2);
}
}
@@ -3648,7 +3648,7 @@ LinkAction* AnnotWidget::getFormAdditionalAction(FormAdditionalActionsType type)
// Doesn't handle vertical fonts--should it?
void Annot::layoutText(const GooString *text, GooString *outBuf, int *i,
const GfxFont *font, double *width, double widthLimit,
- int *charCount, GBool noReencode)
+ int *charCount, bool noReencode)
{
CharCode c;
Unicode uChar, *uAux;
@@ -3658,8 +3658,8 @@ void Annot::layoutText(const GooString *text, GooString *outBuf, int *i,
if (!text) {
return;
}
- GBool unicode = text->hasUnicodeMarker();
- GBool spacePrev; // previous character was a space
+ bool unicode = text->hasUnicodeMarker();
+ bool spacePrev; // previous character was a space
// State for backtracking when more text has been processed than fits within
// widthLimit. We track for both input (text) and output (outBuf) the offset
@@ -3687,7 +3687,7 @@ void Annot::layoutText(const GooString *text, GooString *outBuf, int *i,
// can backtrack if we exceed the maximum width.
last_i1 = last_i2 = *i;
last_o1 = last_o2 = 0;
- spacePrev = gFalse;
+ spacePrev = false;
outBuf->clear();
while (*i < text->getLength()) {
@@ -3748,9 +3748,9 @@ void Annot::layoutText(const GooString *text, GooString *outBuf, int *i,
last_i1 = *i;
if (!spacePrev)
last_o1 = last_o2;
- spacePrev = gTrue;
+ spacePrev = true;
} else {
- spacePrev = gFalse;
+ spacePrev = false;
}
// Compute width of character just output
@@ -3865,10 +3865,10 @@ void AnnotAppearanceBuilder::writeString(const GooString &str)
// Draw the variable text or caption for a field.
bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da, const GfxResources *resources,
const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect,
- GBool multiline, int comb, int quadding,
- GBool txField, GBool forceZapfDingbats,
+ bool multiline, int comb, int quadding,
+ bool txField, bool forceZapfDingbats,
XRef *xref, bool *addedDingbatsResource,
- GBool password) {
+ bool password) {
GooList *daToks;
GooString *tok;
GooString convertedText;
@@ -3877,7 +3877,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
double fontSize, fontSize2, borderWidth, x, xPrev, y, w, wMax;
int tfPos, tmPos, i, j;
int rot;
- GBool freeText = gFalse; // true if text should be freed before return
+ bool freeText = false; // true if text should be freed before return
GfxFont *fontToFree = nullptr;
//~ if there is no MK entry, this should use the existing content stream,
@@ -3978,7 +3978,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
for (i = 0; i < len; ++i)
newText->append('*');
text = newText;
- freeText = gTrue;
+ freeText = true;
}
// setup
@@ -4359,7 +4359,7 @@ bool AnnotAppearanceBuilder::drawListBox(const FormFieldChoice *fieldChoice, con
}
return false;
}
- Annot::layoutText(fieldChoice->getChoice(i), &convertedText, &j, font, &w, 0.0, nullptr, gFalse);
+ Annot::layoutText(fieldChoice->getChoice(i), &convertedText, &j, font, &w, 0.0, nullptr, false);
if (w > wMax) {
wMax = w;
}
@@ -4397,7 +4397,7 @@ bool AnnotAppearanceBuilder::drawListBox(const FormFieldChoice *fieldChoice, con
// compute text width and start position
j = 0;
- Annot::layoutText(fieldChoice->getChoice(i), &convertedText, &j, font, &w, 0.0, nullptr, gFalse);
+ Annot::layoutText(fieldChoice->getChoice(i), &convertedText, &j, font, &w, 0.0, nullptr, false);
w *= fontSize;
switch (quadding) {
case quaddingLeftJustified:
@@ -4474,7 +4474,7 @@ void AnnotAppearanceBuilder::drawFieldBorder(const FormField *field, const Annot
const double dy = rect->y2 - rect->y1;
// radio buttons with no caption have a round border
- const GBool hasCaption = appearCharacs->getNormalCaption() != nullptr;
+ const bool hasCaption = appearCharacs->getNormalCaption() != nullptr;
if (field->getType() == formButton &&
static_cast<const FormFieldButton*>(field)->getButtonType() == formButtonRadio && !hasCaption) {
double r = 0.5 * (dx < dy ? dx : dy);
@@ -4491,21 +4491,21 @@ void AnnotAppearanceBuilder::drawFieldBorder(const FormField *field, const Annot
case AnnotBorder::borderSolid:
case AnnotBorder::borderUnderlined:
appearBuf->appendf("{0:.2f} w\n", w);
- setDrawColor(aColor, gFalse);
- drawCircle(0.5 * dx, 0.5 * dy, r - 0.5 * w, gFalse);
+ setDrawColor(aColor, false);
+ drawCircle(0.5 * dx, 0.5 * dy, r - 0.5 * w, false);
break;
case AnnotBorder::borderBeveled:
case AnnotBorder::borderInset:
appearBuf->appendf("{0:.2f} w\n", 0.5 * w);
- setDrawColor(aColor, gFalse);
- drawCircle(0.5 * dx, 0.5 * dy, r - 0.25 * w, gFalse);
+ setDrawColor(aColor, false);
+ drawCircle(0.5 * dx, 0.5 * dy, r - 0.25 * w, false);
adjustedColor = AnnotColor(*aColor);
adjustedColor.adjustColor(border->getStyle() == AnnotBorder::borderBeveled ? 1 : -1);
- setDrawColor(&adjustedColor, gFalse);
+ setDrawColor(&adjustedColor, false);
drawCircleTopLeft(0.5 * dx, 0.5 * dy, r - 0.75 * w);
adjustedColor = AnnotColor(*aColor);
adjustedColor.adjustColor(border->getStyle() == AnnotBorder::borderBeveled ? -1 : 1);
- setDrawColor(&adjustedColor, gFalse);
+ setDrawColor(&adjustedColor, false);
drawCircleBottomRight(0.5 * dx, 0.5 * dy, r - 0.75 * w);
break;
}
@@ -4522,7 +4522,7 @@ void AnnotAppearanceBuilder::drawFieldBorder(const FormField *field, const Annot
// fallthrough
case AnnotBorder::borderSolid:
appearBuf->appendf("{0:.2f} w\n", w);
- setDrawColor(aColor, gFalse);
+ setDrawColor(aColor, false);
appearBuf->appendf("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re s\n",
0.5 * w, dx - w, dy - w);
break;
@@ -4530,7 +4530,7 @@ void AnnotAppearanceBuilder::drawFieldBorder(const FormField *field, const Annot
case AnnotBorder::borderInset:
adjustedColor = AnnotColor(*aColor);
adjustedColor.adjustColor(border->getStyle() == AnnotBorder::borderBeveled ? 1 : -1);
- setDrawColor(&adjustedColor, gTrue);
+ setDrawColor(&adjustedColor, true);
appearBuf->append("0 0 m\n");
appearBuf->appendf("0 {0:.2f} l\n", dy);
appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx, dy);
@@ -4540,7 +4540,7 @@ void AnnotAppearanceBuilder::drawFieldBorder(const FormField *field, const Annot
appearBuf->append("f\n");
adjustedColor = AnnotColor(*aColor);
adjustedColor.adjustColor(border->getStyle() == AnnotBorder::borderBeveled ? -1 : 1);
- setDrawColor(&adjustedColor, gTrue);
+ setDrawColor(&adjustedColor, true);
appearBuf->append("0 0 m\n");
appearBuf->appendf("{0:.2f} 0 l\n", dx);
appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx, dy);
@@ -4551,7 +4551,7 @@ void AnnotAppearanceBuilder::drawFieldBorder(const FormField *field, const Annot
break;
case AnnotBorder::borderUnderlined:
appearBuf->appendf("{0:.2f} w\n", w);
- setDrawColor(aColor, gFalse);
+ setDrawColor(aColor, false);
appearBuf->appendf("0 0 m {0:.2f} 0 l s\n", dx);
break;
}
@@ -4597,14 +4597,14 @@ bool AnnotAppearanceBuilder::drawFormFieldButton(const FormFieldButton *field, c
if (appearState && appearState->cmp("Off") != 0 &&
field->getState(appearState->getCString())) {
if (caption) {
- return drawText(caption, da, resources, border, appearCharacs, rect, gFalse, 0, fieldQuadCenter, gFalse, gTrue, xref, addedDingbatsResource, gFalse);
+ return drawText(caption, da, resources, border, appearCharacs, rect, false, 0, fieldQuadCenter, false, true, xref, addedDingbatsResource, false);
} else if (appearCharacs) {
const AnnotColor *aColor = appearCharacs->getBorderColor();
if (aColor) {
const double dx = rect->x2 - rect->x1;
const double dy = rect->y2 - rect->y1;
- setDrawColor(aColor, gTrue);
- drawCircle(0.5 * dx, 0.5 * dy, 0.2 * (dx < dy ? dx : dy), gTrue);
+ setDrawColor(aColor, true);
+ drawCircle(0.5 * dx, 0.5 * dy, 0.2 * (dx < dy ? dx : dy), true);
}
return true;
}
@@ -4613,15 +4613,15 @@ bool AnnotAppearanceBuilder::drawFormFieldButton(const FormFieldButton *field, c
break;
case formButtonPush:
if (caption)
- return drawText(caption, da, resources, border, appearCharacs, rect, gFalse, 0, fieldQuadCenter, gFalse, gFalse, xref, addedDingbatsResource, gFalse);
+ return drawText(caption, da, resources, border, appearCharacs, rect, false, 0, fieldQuadCenter, false, false, xref, addedDingbatsResource, false);
break;
case formButtonCheck:
if (appearState && appearState->cmp("Off") != 0) {
if (!caption) {
GooString checkMark("3");
- return drawText(&checkMark, da, resources, border, appearCharacs, rect, gFalse, 0, fieldQuadCenter, gFalse, gTrue, xref, addedDingbatsResource, gFalse);
+ return drawText(&checkMark, da, resources, border, appearCharacs, rect, false, 0, fieldQuadCenter, false, true, xref, addedDingbatsResource, false);
} else {
- return drawText(caption, da, resources, border, appearCharacs, rect, gFalse, 0, fieldQuadCenter, gFalse, gTrue, xref, addedDingbatsResource, gFalse);
+ return drawText(caption, da, resources, border, appearCharacs, rect, false, 0, fieldQuadCenter, false, true, xref, addedDingbatsResource, false);
}
}
break;
@@ -4643,7 +4643,7 @@ bool AnnotAppearanceBuilder::drawFormFieldText(const FormFieldText *fieldText, c
comb = fieldText->getMaxLen();
return drawText(contents, da, resources, border, appearCharacs, rect,
- fieldText->isMultiline(), comb, quadding, gTrue, gFalse, nullptr, nullptr, fieldText->isPassword());
+ fieldText->isMultiline(), comb, quadding, true, false, nullptr, nullptr, fieldText->isPassword());
}
return true;
@@ -4658,7 +4658,7 @@ bool AnnotAppearanceBuilder::drawFormFieldChoice(const FormFieldChoice *fieldCho
if (fieldChoice->isCombo()) {
selected = fieldChoice->getSelectedChoice();
if (selected) {
- return drawText(selected, da, resources, border, appearCharacs, rect, gFalse, 0, quadding, gTrue, gFalse, nullptr, nullptr, gFalse);
+ return drawText(selected, da, resources, border, appearCharacs, rect, false, 0, quadding, true, false, nullptr, nullptr, false);
//~ Acrobat draws a popup icon on the right side
}
// list box
@@ -4679,7 +4679,7 @@ void AnnotWidget::generateFieldAppearance(bool *addedDingbatsResource) {
if (appearCharacs) {
const AnnotColor *aColor = appearCharacs->getBackColor();
if (aColor) {
- appearBuilder.setDrawColor(aColor, gTrue);
+ appearBuilder.setDrawColor(aColor, true);
appearBuilder.appendf("0 0 {0:.2f} {1:.2f} re f\n",
rect->x2 - rect->x1, rect->y2 - rect->y1);
}
@@ -4767,7 +4767,7 @@ void AnnotWidget::updateAppearanceStream()
}
}
-void AnnotWidget::draw(Gfx *gfx, GBool printing) {
+void AnnotWidget::draw(Gfx *gfx, bool printing) {
if (!isVisible (printing))
return;
@@ -4846,15 +4846,15 @@ void AnnotMovie::initialize(PDFDoc *docA, Dict* dict) {
movie = std::make_unique<Movie>(&movieDict);
if (!movie->isOk()) {
movie = nullptr;
- ok = gFalse;
+ ok = false;
}
} else {
error(errSyntaxError, -1, "Bad Annot Movie");
- ok = gFalse;
+ ok = false;
}
}
-void AnnotMovie::draw(Gfx *gfx, GBool printing) {
+void AnnotMovie::draw(Gfx *gfx, bool printing) {
if (!isVisible (printing))
return;
@@ -4920,7 +4920,7 @@ void AnnotMovie::draw(Gfx *gfx, GBool printing) {
bbox[0] = bbox[1] = 0;
bbox[2] = width;
bbox[3] = height;
- appearance = createForm(appearBuf.get(), bbox, gFalse, resDict2);
+ appearance = createForm(appearBuf.get(), bbox, false, resDict2);
}
}
@@ -4963,7 +4963,7 @@ void AnnotScreen::initialize(PDFDoc *docA, Dict* dict) {
if (action && action->getKind() == actionRendition && page == 0) {
error (errSyntaxError, -1, "Invalid Rendition action: associated screen annotation without P");
action = nullptr;
- ok = gFalse;
+ ok = false;
}
}
@@ -5116,7 +5116,7 @@ void AnnotGeometry::setInteriorColor(std::unique_ptr<AnnotColor> &&new_color) {
invalidateAppearance();
}
-void AnnotGeometry::draw(Gfx *gfx, GBool printing) {
+void AnnotGeometry::draw(Gfx *gfx, bool printing) {
double ca = 1;
if (!isVisible (printing))
@@ -5129,13 +5129,13 @@ void AnnotGeometry::draw(Gfx *gfx, GBool printing) {
AnnotAppearanceBuilder appearBuilder;
appearBuilder.append ("q\n");
if (color)
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
double borderWidth = border->getWidth();
appearBuilder.setLineStyleForBorder(border.get());
if (interiorColor)
- appearBuilder.setDrawColor(interiorColor.get(), gTrue);
+ appearBuilder.setDrawColor(interiorColor.get(), true);
if (type == typeSquare) {
appearBuilder.appendf ("{0:.2f} {1:.2f} {2:.2f} {3:.2f} re\n",
@@ -5202,13 +5202,13 @@ void AnnotGeometry::draw(Gfx *gfx, GBool printing) {
bbox[2] = rect->x2 - rect->x1;
bbox[3] = rect->y2 - rect->y1;
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, nullptr);
+ appearance = createForm(appearBuilder.buffer(), bbox, false, nullptr);
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
@@ -5271,7 +5271,7 @@ void AnnotPolygon::initialize(PDFDoc *docA, Dict* dict) {
} else {
vertices = std::make_unique<AnnotPath>();
error(errSyntaxError, -1, "Bad Annot Polygon Vertices");
- ok = gFalse;
+ ok = false;
}
obj1 = dict->lookup("LE");
@@ -5391,7 +5391,7 @@ void AnnotPolygon::setIntent(AnnotPolygonIntent new_intent) {
update ("IT", Object(objName, intentName));
}
-void AnnotPolygon::draw(Gfx *gfx, GBool printing) {
+void AnnotPolygon::draw(Gfx *gfx, bool printing) {
double ca = 1;
if (!isVisible (printing))
@@ -5406,14 +5406,14 @@ void AnnotPolygon::draw(Gfx *gfx, GBool printing) {
appearBuilder.append ("q\n");
if (color) {
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
}
appearBuilder.setLineStyleForBorder(border.get());
appearBBox->setBorderWidth(std::max(1., border->getWidth()));
if (interiorColor) {
- appearBuilder.setDrawColor(interiorColor.get(), gTrue);
+ appearBuilder.setDrawColor(interiorColor.get(), true);
}
if (vertices->getCoordsLength() != 0) {
@@ -5441,13 +5441,13 @@ void AnnotPolygon::draw(Gfx *gfx, GBool printing) {
double bbox[4];
appearBBox->getBBoxRect(bbox);
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, nullptr);
+ appearance = createForm(appearBuilder.buffer(), bbox, false, nullptr);
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
@@ -5549,7 +5549,7 @@ void AnnotInk::initialize(PDFDoc *docA, Dict* dict) {
inkListLength = 0;
inkList = nullptr;
error(errSyntaxError, -1, "Bad Annot Ink List");
- ok = gFalse;
+ ok = false;
}
obj1 = dict->lookup("BS");
@@ -5602,7 +5602,7 @@ void AnnotInk::setInkList(AnnotPath **paths, int n_paths) {
invalidateAppearance();
}
-void AnnotInk::draw(Gfx *gfx, GBool printing) {
+void AnnotInk::draw(Gfx *gfx, bool printing) {
double ca = 1;
if (!isVisible (printing))
@@ -5617,7 +5617,7 @@ void AnnotInk::draw(Gfx *gfx, GBool printing) {
appearBuilder.append ("q\n");
if (color) {
- appearBuilder.setDrawColor(color.get(), gFalse);
+ appearBuilder.setDrawColor(color.get(), false);
}
appearBuilder.setLineStyleForBorder(border.get());
@@ -5643,13 +5643,13 @@ void AnnotInk::draw(Gfx *gfx, GBool printing) {
double bbox[4];
appearBBox->getBBoxRect(bbox);
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, nullptr);
+ appearance = createForm(appearBuilder.buffer(), bbox, false, nullptr);
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
@@ -5695,7 +5695,7 @@ void AnnotFileAttachment::initialize(PDFDoc *docA, Dict* dict) {
file = obj1.copy();
} else {
error(errSyntaxError, -1, "Bad Annot File Attachment");
- ok = gFalse;
+ ok = false;
}
obj1 = dict->lookup("Name");
@@ -5818,7 +5818,7 @@ void AnnotFileAttachment::initialize(PDFDoc *docA, Dict* dict) {
"6.93 16.141 m 8 21 14.27 21.5 16 21.5 c 18.094 21.504 19.5 21 19.5 19 c\n" \
"19.5 17.699 20.91 17.418 22.5 17.5 c S\n"
-void AnnotFileAttachment::draw(Gfx *gfx, GBool printing) {
+void AnnotFileAttachment::draw(Gfx *gfx, bool printing) {
double ca = 1;
if (!isVisible (printing))
@@ -5832,7 +5832,7 @@ void AnnotFileAttachment::draw(Gfx *gfx, GBool printing) {
appearBuilder.append ("q\n");
if (color)
- appearBuilder.setDrawColor(color.get(), gTrue);
+ appearBuilder.setDrawColor(color.get(), true);
else
appearBuilder.append ("1 1 1 rg\n");
if (!name->cmp("PushPin"))
@@ -5849,13 +5849,13 @@ void AnnotFileAttachment::draw(Gfx *gfx, GBool printing) {
bbox[0] = bbox[1] = 0;
bbox[2] = bbox[3] = 24;
if (ca == 1) {
- appearance = createForm (appearBuilder.buffer(), bbox, gFalse, nullptr);
+ appearance = createForm (appearBuilder.buffer(), bbox, false, nullptr);
} else {
- Object aStream = createForm (appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm (appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
@@ -5892,7 +5892,7 @@ void AnnotSound::initialize(PDFDoc *docA, Dict* dict) {
sound.reset(Sound::parseSound(&obj1));
if (!sound) {
error(errSyntaxError, -1, "Bad Annot Sound");
- ok = gFalse;
+ ok = false;
}
obj1 = dict->lookup("Name");
@@ -5966,7 +5966,7 @@ void AnnotSound::initialize(PDFDoc *docA, Dict* dict) {
"1 J\n" \
"8 4 m 16 4 l S\n"
-void AnnotSound::draw(Gfx *gfx, GBool printing) {
+void AnnotSound::draw(Gfx *gfx, bool printing) {
Object obj;
double ca = 1;
@@ -5981,7 +5981,7 @@ void AnnotSound::draw(Gfx *gfx, GBool printing) {
appearBuilder.append ("q\n");
if (color)
- appearBuilder.setDrawColor(color.get(), gTrue);
+ appearBuilder.setDrawColor(color.get(), true);
else
appearBuilder.append ("1 1 1 rg\n");
if (!name->cmp("Speaker"))
@@ -5994,13 +5994,13 @@ void AnnotSound::draw(Gfx *gfx, GBool printing) {
bbox[0] = bbox[1] = 0;
bbox[2] = bbox[3] = 24;
if (ca == 1) {
- appearance = createForm(appearBuilder.buffer(), bbox, gFalse, nullptr);
+ appearance = createForm(appearBuilder.buffer(), bbox, false, nullptr);
} else {
- Object aStream = createForm(appearBuilder.buffer(), bbox, gTrue, nullptr);
+ Object aStream = createForm(appearBuilder.buffer(), bbox, true, nullptr);
GooString appearBuf("/GS0 gs\n/Fm0 Do");
Dict *resDict = createResourcesDict("Fm0", std::move(aStream), "GS0", ca, nullptr);
- appearance = createForm(&appearBuf, bbox, gFalse, resDict);
+ appearance = createForm(&appearBuf, bbox, false, resDict);
}
}
@@ -6110,14 +6110,14 @@ Annot3D::Activation::Activation(Dict *dict) {
if (obj1.isBool()) {
displayToolbar = obj1.getBool();
} else {
- displayToolbar = gTrue;
+ displayToolbar = true;
}
obj1 = dict->lookup("NP");
if (obj1.isBool()) {
displayNavigation = obj1.getBool();
} else {
- displayNavigation = gFalse;
+ displayNavigation = false;
}
}
@@ -6485,7 +6485,7 @@ Annots::Annots(PDFDoc *docA, int page, Object *annotsObj) {
annot = createAnnot (&obj1, &obj2);
if (annot) {
if (annot->isOk()) {
- annot->setPage(page, gFalse); // Don't change /P
+ annot->setPage(page, false); // Don't change /P
appendAnnot(annot);
}
annot->decRefCnt();
@@ -6502,7 +6502,7 @@ void Annots::appendAnnot(Annot *annot) {
}
}
-GBool Annots::removeAnnot(Annot *annot) {
+bool Annots::removeAnnot(Annot *annot) {
auto idx = std::find(annots.begin(), annots.end(), annot);
if (idx == annots.end()) {
diff --git a/poppler/Annot.h b/poppler/Annot.h
index 7f4d9796..3216f02e 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -264,7 +264,7 @@ public:
protected:
AnnotBorder();
- GBool parseDashArray(Object *dashObj);
+ bool parseDashArray(Object *dashObj);
AnnotBorderType type;
double width;
@@ -443,10 +443,10 @@ public:
void removeAllStreams();
// Test if this AnnotAppearance references the specified stream
- GBool referencesStream(Ref targetStreamRef);
+ bool referencesStream(Ref targetStreamRef);
private:
- static GBool referencesStream(Object *stateObj, Ref targetStreamRef);
+ static bool referencesStream(Object *stateObj, Ref targetStreamRef);
void removeStream(Ref refToStream);
void removeStateStreams(Object *state);
@@ -541,10 +541,10 @@ public:
AnnotAppearanceBuilder(const AnnotAppearanceBuilder &) = delete;
AnnotAppearanceBuilder& operator=(const AnnotAppearanceBuilder &) = delete;
- void setDrawColor(const AnnotColor *color, GBool fill);
+ void setDrawColor(const AnnotColor *color, bool fill);
void setLineStyleForBorder(const AnnotBorder *border);
void setTextFont(const Object &fontName, double fontSize);
- void drawCircle(double cx, double cy, double r, GBool fill);
+ void drawCircle(double cx, double cy, double r, bool fill);
void drawCircleTopLeft(double cx, double cy, double r);
void drawCircleBottomRight(double cx, double cy, double r);
void drawFieldBorder(const FormField *field, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect);
@@ -565,10 +565,10 @@ private:
bool drawFormFieldChoice(const FormFieldChoice *fieldChoice, const Form *form, const GfxResources *resources, const GooString *da, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect);
bool drawText(const GooString *text, const GooString *da, const GfxResources *resources,
const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect,
- GBool multiline, int comb, int quadding,
- GBool txField, GBool forceZapfDingbats,
+ bool multiline, int comb, int quadding,
+ bool txField, bool forceZapfDingbats,
XRef *xref, bool *addedDingbatsResource, // xref and addedDingbatsResource both must not be null if forceZapfDingbats is passed
- GBool password);
+ bool password);
GooString *appearBuf;
};
@@ -651,16 +651,16 @@ public:
Annot(PDFDoc *docA, PDFRectangle *rectA);
Annot(PDFDoc *docA, Object *dictObject);
Annot(PDFDoc *docA, Object *dictObject, Object *obj);
- GBool isOk() { return ok; }
+ bool isOk() { return ok; }
void incRefCnt();
void decRefCnt();
- virtual void draw(Gfx *gfx, GBool printing);
+ virtual void draw(Gfx *gfx, bool printing);
// Get the resource dict of the appearance stream
virtual Object getAppearanceResDict();
- GBool match(Ref *refA)
+ bool match(Ref *refA)
{ return ref.num == refA->num && ref.gen == refA->gen; }
double getXMin();
@@ -686,7 +686,7 @@ public:
// getters
PDFDoc *getDoc() const { return doc; }
XRef *getXRef() const { return xref; }
- GBool getHasRef() const { return hasRef; }
+ bool getHasRef() const { return hasRef; }
Ref getRef() const { return ref; }
AnnotSubtype getType() const { return type; }
PDFRectangle *getRect() const { return rect.get(); }
@@ -705,28 +705,28 @@ public:
int getId() { return ref.num; }
// Check if point is inside the annot rectangle.
- GBool inRect(double x, double y) const;
+ bool inRect(double x, double y) const;
static void layoutText(const GooString *text, GooString *outBuf, int *i, const GfxFont *font,
double *width, double widthLimit, int *charCount,
- GBool noReencode);
+ bool noReencode);
private:
void readArrayNum(Object *pdfArray, int key, double *value);
// write vStr[i:j[ in appearBuf
void initialize (PDFDoc *docA, Dict *dict);
- void setPage (int new_page, GBool updateP); // Called by Page::addAnnot and Annots ctor
+ void setPage (int new_page, bool updateP); // Called by Page::addAnnot and Annots ctor
protected:
virtual ~Annot();
virtual void removeReferencedObjects(); // Called by Page::removeAnnot
- Object createForm(const GooString *appearBuf, double *bbox, GBool transparencyGroup, Dict *resDict);
- Object createForm(const GooString *appearBuf, double *bbox, GBool transparencyGroup, Object &&resDictObject); // overload to support incRef/decRef
+ Object createForm(const GooString *appearBuf, double *bbox, bool transparencyGroup, Dict *resDict);
+ Object createForm(const GooString *appearBuf, double *bbox, bool transparencyGroup, Object &&resDictObject); // overload to support incRef/decRef
Dict *createResourcesDict(const char *formName, Object &&formStream, const char *stateName,
double opacity, const char *blendMode);
- GBool isVisible(GBool printing);
+ bool isVisible(bool printing);
int getRotation() const;
// Updates the field key of the annotation dictionary
@@ -763,7 +763,7 @@ protected:
Ref ref; // object ref identifying this annotation
std::unique_ptr<AnnotBorder> border; // Border, BS
std::unique_ptr<AnnotColor> color; // C
- GBool ok;
+ bool ok;
bool hasRef;
mutable std::recursive_mutex mutex;
@@ -782,14 +782,14 @@ public:
Object *getParentNF() { return &parent; }
void setParent(Object *parentA);
void setParent(Annot *parentA);
- GBool getOpen() const { return open; }
- void setOpen(GBool openA);
+ bool getOpen() const { return open; }
+ void setOpen(bool openA);
protected:
void initialize(PDFDoc *docA, Dict *dict);
Object parent; // Parent
- GBool open; // Open
+ bool open; // Open
};
//------------------------------------------------------------------------
@@ -867,21 +867,21 @@ public:
AnnotText(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotText();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
// getters
- GBool getOpen() const { return open; }
+ bool getOpen() const { return open; }
const GooString *getIcon() const { return icon.get(); }
AnnotTextState getState() const { return state; }
- void setOpen(GBool openA);
+ void setOpen(bool openA);
void setIcon(GooString *new_icon);
private:
void initialize(PDFDoc *docA, Dict *dict);
- GBool open; // Open (Default false)
+ bool open; // Open (Default false)
std::unique_ptr<GooString> icon; // Name (Default Note)
AnnotTextState state; // State (Default Umarked if
// StateModel Marked
@@ -900,7 +900,7 @@ class AnnotMovie: public Annot {
AnnotMovie(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotMovie();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
const GooString* getTitle() const { return title.get(); }
Movie* getMovie() { return movie.get(); }
@@ -960,7 +960,7 @@ public:
AnnotLink(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotLink();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
// getters
LinkAction *getAction() const { return action.get(); }
@@ -1001,7 +1001,7 @@ public:
AnnotFreeText(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotFreeText();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
Object getAppearanceResDict() override;
void setContents(GooString *new_content) override;
@@ -1064,7 +1064,7 @@ public:
AnnotLine(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotLine();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
Object getAppearanceResDict() override;
void setContents(GooString *new_content) override;
@@ -1131,7 +1131,7 @@ public:
AnnotTextMarkup(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotTextMarkup();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
// typeHighlight, typeUnderline, typeSquiggly or typeStrikeOut
void setType(AnnotSubtype new_type);
@@ -1181,7 +1181,7 @@ public:
AnnotGeometry(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotGeometry();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
void setType(AnnotSubtype new_type); // typeSquare or typeCircle
void setInteriorColor(std::unique_ptr<AnnotColor> &&new_color);
@@ -1217,7 +1217,7 @@ public:
AnnotPolygon(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotPolygon();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
void setType(AnnotSubtype new_type); // typePolygon or typePolyLine
void setVertices(AnnotPath *path);
@@ -1292,7 +1292,7 @@ public:
AnnotInk(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotInk();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
void setInkList(AnnotPath **paths, int n_paths);
@@ -1327,7 +1327,7 @@ public:
AnnotFileAttachment(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotFileAttachment();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
// getters
Object *getFile() { return &file; }
@@ -1355,7 +1355,7 @@ public:
AnnotSound(PDFDoc *docA, Object *dictObject, Object *obj);
~AnnotSound();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
// getters
Sound *getSound() { return sound.get(); }
@@ -1390,7 +1390,7 @@ public:
AnnotWidget(PDFDoc *docA, Object *dictObject, Object *obj, FormField *fieldA);
~AnnotWidget();
- void draw(Gfx *gfx, GBool printing) override;
+ void draw(Gfx *gfx, bool printing) override;
void generateFieldAppearance (bool *addDingbatsResource);
void updateAppearanceStream ();
@@ -1459,8 +1459,8 @@ class Annot3D: public Annot {
ActivationAState aState; // AIS (Default L)
ActivationDTrigger dTrigger; // D (Default PI)
ActivationDState dState; // DIS (Default U)
- GBool displayToolbar; // TB (Default true)
- GBool displayNavigation; // NP (Default false);
+ bool displayToolbar; // TB (Default true)
+ bool displayNavigation; // NP (Default false);
};
public:
@@ -1682,7 +1682,7 @@ public:
int getNumAnnots() const { return annots.size(); }
Annot *getAnnot(int i) { return annots[i]; }
void appendAnnot(Annot *annot);
- GBool removeAnnot(Annot *annot);
+ bool removeAnnot(Annot *annot);
private:
Annot* createAnnot(Object* dictObject, Object *obj);
diff --git a/poppler/Array.cc b/poppler/Array.cc
index 5809fb2f..ca4a03d5 100644
--- a/poppler/Array.cc
+++ b/poppler/Array.cc
@@ -84,14 +84,14 @@ Object Array::getNF(int i) const {
return elems[i].copy();
}
-GBool Array::getString(int i, GooString *string) const
+bool Array::getString(int i, GooString *string) const
{
Object obj = getNF(i);
if (obj.isString()) {
string->clear();
string->append(obj.getString());
- return gTrue;
+ return true;
} else {
- return gFalse;
+ return false;
}
}
diff --git a/poppler/Array.h b/poppler/Array.h
index fb2aa798..0eb4e780 100644
--- a/poppler/Array.h
+++ b/poppler/Array.h
@@ -69,7 +69,7 @@ public:
// Accessors.
Object get(int i, int resursion = 0) const;
Object getNF(int i) const;
- GBool getString(int i, GooString *string) const;
+ bool getString(int i, GooString *string) const;
private:
friend class Object; // for incRef/decRef
diff --git a/poppler/BuiltinFont.cc b/poppler/BuiltinFont.cc
index a0e9d094..20ddeccd 100644
--- a/poppler/BuiltinFont.cc
+++ b/poppler/BuiltinFont.cc
@@ -35,7 +35,7 @@ BuiltinFontWidths::~BuiltinFontWidths() {
gfree(tab);
}
-GBool BuiltinFontWidths::getWidth(const char *name, Gushort *width) {
+bool BuiltinFontWidths::getWidth(const char *name, Gushort *width) {
int h;
BuiltinFontWidth *p;
@@ -43,10 +43,10 @@ GBool BuiltinFontWidths::getWidth(const char *name, Gushort *width) {
for (p = tab[h]; p; p = p->next) {
if (!strcmp(p->name, name)) {
*width = p->width;
- return gTrue;
+ return true;
}
}
- return gFalse;
+ return false;
}
int BuiltinFontWidths::hash(const char *name) {
diff --git a/poppler/BuiltinFont.h b/poppler/BuiltinFont.h
index 0c580d18..3821d6ad 100644
--- a/poppler/BuiltinFont.h
+++ b/poppler/BuiltinFont.h
@@ -56,7 +56,7 @@ public:
BuiltinFontWidths(const BuiltinFontWidths &) = delete;
BuiltinFontWidths& operator=(const BuiltinFontWidths &) = delete;
- GBool getWidth(const char *name, Gushort *width);
+ bool getWidth(const char *name, Gushort *width);
private:
diff --git a/poppler/CMap.cc b/poppler/CMap.cc
index a8fea41b..c5db68a4 100644
--- a/poppler/CMap.cc
+++ b/poppler/CMap.cc
@@ -42,7 +42,7 @@
//------------------------------------------------------------------------
struct CMapVectorEntry {
- GBool isVector;
+ bool isVector;
union {
CMapVectorEntry *vector;
CID cid;
@@ -302,11 +302,11 @@ CMap::CMap(GooString *collectionA, GooString *cMapNameA) {
collection = collectionA;
cMapName = cMapNameA;
- isIdent = gFalse;
+ isIdent = false;
wMode = 0;
vector = (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
for (i = 0; i < 256; ++i) {
- vector[i].isVector = gFalse;
+ vector[i].isVector = false;
vector[i].cid = 0;
}
refCnt = 1;
@@ -315,7 +315,7 @@ CMap::CMap(GooString *collectionA, GooString *cMapNameA) {
CMap::CMap(GooString *collectionA, GooString *cMapNameA, int wModeA) {
collection = collectionA;
cMapName = cMapNameA;
- isIdent = gTrue;
+ isIdent = true;
wMode = wModeA;
vector = nullptr;
refCnt = 1;
@@ -366,11 +366,11 @@ void CMap::copyVector(CMapVectorEntry *dest, CMapVectorEntry *src) {
for (i = 0; i < 256; ++i) {
if (src[i].isVector) {
if (!dest[i].isVector) {
- dest[i].isVector = gTrue;
+ dest[i].isVector = true;
dest[i].vector =
(CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
for (j = 0; j < 256; ++j) {
- dest[i].vector[j].isVector = gFalse;
+ dest[i].vector[j].isVector = false;
dest[i].vector[j].cid = 0;
}
}
@@ -395,11 +395,11 @@ void CMap::addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID) {
for (i = nBytes - 1; i >= 1; --i) {
byte = (start >> (8 * i)) & 0xff;
if (!vec[byte].isVector) {
- vec[byte].isVector = gTrue;
+ vec[byte].isVector = true;
vec[byte].vector =
(CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
for (j = 0; j < 256; ++j) {
- vec[byte].vector[j].isVector = gFalse;
+ vec[byte].vector[j].isVector = false;
vec[byte].vector[j].cid = 0;
}
}
@@ -447,7 +447,7 @@ void CMap::decRefCnt() {
}
}
-GBool CMap::match(const GooString *collectionA, const GooString *cMapNameA) {
+bool CMap::match(const GooString *collectionA, const GooString *cMapNameA) {
return !collection->cmp(collectionA) && !cMapName->cmp(cMapNameA);
}
diff --git a/poppler/CMap.h b/poppler/CMap.h
index 17544d4c..4cb7a537 100644
--- a/poppler/CMap.h
+++ b/poppler/CMap.h
@@ -79,7 +79,7 @@ public:
// Return true if this CMap matches the specified <collectionA>, and
// <cMapNameA>.
- GBool match(const GooString *collectionA, const GooString *cMapNameA);
+ bool match(const GooString *collectionA, const GooString *cMapNameA);
// Return the CID corresponding to the character code starting at
// <s>, which contains <len> bytes. Sets *<c> to the char code, and
@@ -106,7 +106,7 @@ private:
GooString *collection;
GooString *cMapName;
- GBool isIdent; // true if this CMap is an identity mapping,
+ bool isIdent; // true if this CMap is an identity mapping,
// or is based on one (via usecmap)
int wMode; // writing mode (0=horizontal, 1=vertical)
CMapVectorEntry *vector; // vector for first byte (NULL for
diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc
index e9cc924e..4114fa7b 100644
--- a/poppler/CairoFontEngine.cc
+++ b/poppler/CairoFontEngine.cc
@@ -65,8 +65,8 @@ CairoFont::CairoFont(Ref refA,
cairo_font_face_t *cairo_font_faceA,
int *codeToGIDA,
Guint codeToGIDLenA,
- GBool substituteA,
- GBool printingA) : ref(refA),
+ bool substituteA,
+ bool printingA) : ref(refA),
cairo_font_face(cairo_font_faceA),
codeToGID(codeToGIDA),
codeToGIDLen(codeToGIDLenA),
@@ -78,8 +78,8 @@ CairoFont::~CairoFont() {
gfree(codeToGID);
}
-GBool
-CairoFont::matches(Ref &other, GBool printingA) {
+bool
+CairoFont::matches(Ref &other, bool printingA) {
return (other.num == ref.num && other.gen == ref.gen);
}
@@ -161,7 +161,7 @@ _ft_done_face_uncached (void *closure)
FT_Done_Face (face);
}
-static GBool
+static bool
_ft_new_face_uncached (FT_Library lib,
const char *filename,
char *font_data,
@@ -174,10 +174,10 @@ _ft_new_face_uncached (FT_Library lib,
if (font_data == nullptr) {
if (FT_New_Face (lib, filename, 0, &face))
- return gFalse;
+ return false;
} else {
if (FT_New_Memory_Face (lib, (unsigned char *)font_data, font_data_len, 0, &face))
- return gFalse;
+ return false;
}
font_face = cairo_ft_font_face_create_for_ft_face (face,
@@ -190,12 +190,12 @@ _ft_new_face_uncached (FT_Library lib,
{
_ft_done_face_uncached (face);
cairo_font_face_destroy (font_face);
- return gFalse;
+ return false;
}
*face_out = face;
*font_face_out = font_face;
- return gTrue;
+ return true;
}
#ifdef CAN_CHECK_OPEN_FACES
@@ -224,15 +224,15 @@ _djb_hash (const unsigned char *bytes, size_t len)
return hash;
}
-static GBool
+static bool
_ft_face_data_equal (struct _ft_face_data *a, struct _ft_face_data *b)
{
if (a->lib != b->lib)
- return gFalse;
+ return false;
if (a->size != b->size)
- return gFalse;
+ return false;
if (a->hash != b->hash)
- return gFalse;
+ return false;
return memcmp (a->bytes, b->bytes, a->size) == 0;
}
@@ -264,7 +264,7 @@ _ft_done_face (void *closure)
gfree (data);
}
-static GBool
+static bool
_ft_new_face (FT_Library lib,
const char *filename,
char *font_data,
@@ -320,7 +320,7 @@ _ft_new_face (FT_Library lib,
}
*face_out = l->face;
*font_face_out = cairo_font_face_reference (l->font_face);
- return gTrue;
+ return true;
}
}
@@ -338,7 +338,7 @@ _ft_new_face (FT_Library lib,
close (tmpl.fd);
}
- return gFalse;
+ return false;
}
l = (struct _ft_face_data *) gmallocn (1, sizeof (struct _ft_face_data));
@@ -359,12 +359,12 @@ _ft_new_face (FT_Library lib,
{
cairo_font_face_destroy (l->font_face);
_ft_done_face (l);
- return gFalse;
+ return false;
}
*face_out = l->face;
*font_face_out = l->font_face;
- return gTrue;
+ return true;
}
#else
#define _ft_new_face _ft_new_face_uncached
@@ -374,17 +374,17 @@ CairoFreeTypeFont::CairoFreeTypeFont(Ref refA,
cairo_font_face_t *cairo_font_faceA,
int *codeToGIDA,
Guint codeToGIDLenA,
- GBool substituteA) : CairoFont(refA,
+ bool substituteA) : CairoFont(refA,
cairo_font_faceA,
codeToGIDA,
codeToGIDLenA,
substituteA,
- gTrue) { }
+ true) { }
CairoFreeTypeFont::~CairoFreeTypeFont() { }
CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
- FT_Library lib, GBool useCIDs) {
+ FT_Library lib, bool useCIDs) {
GooString *fileName;
const char *fileNameC;
char *font_data;
@@ -410,7 +410,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
fileName = nullptr;
fileNameC = nullptr;
- GBool substitute = gFalse;
+ bool substitute = false;
ref = *gfxFont->getID();
fontType = gfxFont->getType();
@@ -432,7 +432,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
} else { // gfxFontLocExternal
fileName = fontLoc->path;
fontType = fontLoc->fontType;
- substitute = gTrue;
+ substitute = true;
}
if (fileName != nullptr) {
@@ -607,7 +607,7 @@ typedef struct _type3_font_info {
GfxFont *font;
PDFDoc *doc;
CairoFontEngine *fontEngine;
- GBool printing;
+ bool printing;
XRef *xref;
} type3_font_info_t;
@@ -696,7 +696,7 @@ _render_type3_glyph (cairo_scaled_font_t *scaled_font,
gfx = new Gfx(info->doc, output_dev, resDict, &box, nullptr);
output_dev->startDoc(info->doc, info->fontEngine);
output_dev->startPage (1, gfx->getState(), gfx->getXRef());
- output_dev->setInType3Char(gTrue);
+ output_dev->setInType3Char(true);
charProc = charProcs->getVal(glyph);
gfx->display(&charProc);
@@ -724,7 +724,7 @@ _render_type3_glyph (cairo_scaled_font_t *scaled_font,
CairoType3Font *CairoType3Font::create(GfxFont *gfxFont, PDFDoc *doc,
CairoFontEngine *fontEngine,
- GBool printing, XRef *xref) {
+ bool printing, XRef *xref) {
type3_font_info_t *info;
cairo_font_face_t *font_face;
Ref ref;
@@ -771,18 +771,18 @@ CairoType3Font::CairoType3Font(Ref refA,
cairo_font_face_t *cairo_font_faceA,
int *codeToGIDA,
Guint codeToGIDLenA,
- GBool printingA, XRef *xref) : CairoFont(refA,
+ bool printingA, XRef *xref) : CairoFont(refA,
cairo_font_faceA,
codeToGIDA,
codeToGIDLenA,
- gFalse,
+ false,
printingA)
{ }
CairoType3Font::~CairoType3Font() { }
-GBool
-CairoType3Font::matches(Ref &other, GBool printingA) {
+bool
+CairoType3Font::matches(Ref &other, bool printingA) {
return (other.num == ref.num && other.gen == ref.gen && printing == printingA);
}
@@ -818,7 +818,7 @@ CairoFontEngine::~CairoFontEngine() {
}
CairoFont *
-CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing, XRef *xref) {
+CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, bool printing, XRef *xref) {
int i, j;
Ref ref;
CairoFont *font;
diff --git a/poppler/CairoFontEngine.h b/poppler/CairoFontEngine.h
index 75049804..b58a2b86 100644
--- a/poppler/CairoFontEngine.h
+++ b/poppler/CairoFontEngine.h
@@ -47,18 +47,18 @@ public:
cairo_font_face_t *face,
int *codeToGID,
Guint codeToGIDLen,
- GBool substitute,
- GBool printing);
+ bool substitute,
+ bool printing);
virtual ~CairoFont();
CairoFont(const CairoFont &) = delete;
CairoFont& operator=(const CairoFont &other) = delete;
- virtual GBool matches(Ref &other, GBool printing);
+ virtual bool matches(Ref &other, bool printing);
cairo_font_face_t *getFontFace(void);
unsigned long getGlyph(CharCode code, Unicode *u, int uLen);
double getSubstitutionCorrection(GfxFont *gfxFont);
- GBool isSubstitute() { return substitute; }
+ bool isSubstitute() { return substitute; }
protected:
Ref ref;
cairo_font_face_t *cairo_font_face;
@@ -66,20 +66,20 @@ protected:
int *codeToGID;
Guint codeToGIDLen;
- GBool substitute;
- GBool printing;
+ bool substitute;
+ bool printing;
};
//------------------------------------------------------------------------
class CairoFreeTypeFont : public CairoFont {
public:
- static CairoFreeTypeFont *create(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs);
+ static CairoFreeTypeFont *create(GfxFont *gfxFont, XRef *xref, FT_Library lib, bool useCIDs);
~CairoFreeTypeFont();
private:
CairoFreeTypeFont(Ref ref, cairo_font_face_t *cairo_font_face,
- int *codeToGID, Guint codeToGIDLen, GBool substitute);
+ int *codeToGID, Guint codeToGIDLen, bool substitute);
};
//------------------------------------------------------------------------
@@ -88,16 +88,16 @@ class CairoType3Font : public CairoFont {
public:
static CairoType3Font *create(GfxFont *gfxFont, PDFDoc *doc,
CairoFontEngine *fontEngine,
- GBool printing, XRef *xref);
+ bool printing, XRef *xref);
~CairoType3Font();
- GBool matches(Ref &other, GBool printing) override;
+ bool matches(Ref &other, bool printing) override;
private:
CairoType3Font(Ref ref,
cairo_font_face_t *cairo_font_face,
int *codeToGID, Guint codeToGIDLen,
- GBool printing, XRef *xref);
+ bool printing, XRef *xref);
};
//------------------------------------------------------------------------
@@ -117,12 +117,12 @@ public:
CairoFontEngine(const CairoFontEngine &) = delete;
CairoFontEngine& operator=(const CairoFontEngine &other) = delete;
- CairoFont *getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing, XRef *xref);
+ CairoFont *getFont(GfxFont *gfxFont, PDFDoc *doc, bool printing, XRef *xref);
private:
CairoFont *fontCache[cairoFontCacheSize];
FT_Library lib;
- GBool useCIDs;
+ bool useCIDs;
mutable std::recursive_mutex mutex;
};
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index a58dab1d..b8a3e491 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -117,18 +117,18 @@ void CairoImage::setImage (cairo_surface_t *image) {
// FT_Library instance; to avoid leaks, just use a single global instance
// initialized the first time it is needed.
FT_Library CairoOutputDev::ft_lib;
-GBool CairoOutputDev::ft_lib_initialized = gFalse;
+bool CairoOutputDev::ft_lib_initialized = false;
CairoOutputDev::CairoOutputDev() {
doc = nullptr;
if (!ft_lib_initialized) {
FT_Init_FreeType(&ft_lib);
- ft_lib_initialized = gTrue;
+ ft_lib_initialized = true;
}
fontEngine = nullptr;
- fontEngine_owner = gFalse;
+ fontEngine_owner = false;
glyphs = nullptr;
fill_pattern = nullptr;
fill_color.r = fill_color.g = fill_color.b = 0;
@@ -141,16 +141,16 @@ CairoOutputDev::CairoOutputDev() {
cairo = nullptr;
currentFont = nullptr;
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
- prescaleImages = gFalse;
+ prescaleImages = false;
#else
- prescaleImages = gTrue;
+ prescaleImages = true;
#endif
- printing = gTrue;
- use_show_text_glyphs = gFalse;
- inUncoloredPattern = gFalse;
- inType3Char = gFalse;
- t3_glyph_has_bbox = gFalse;
- text_matrix_valid = gTrue;
+ printing = true;
+ use_show_text_glyphs = false;
+ inUncoloredPattern = false;
+ inType3Char = false;
+ t3_glyph_has_bbox = false;
+ text_matrix_valid = true;
antialias = CAIRO_ANTIALIAS_DEFAULT;
groupColorSpaceStack = nullptr;
@@ -166,9 +166,9 @@ CairoOutputDev::CairoOutputDev() {
// the SA parameter supposedly defaults to false, but Acrobat
// apparently hardwires it to true
- stroke_adjust = gTrue;
- align_stroke_coords = gFalse;
- adjusted_stroke_width = gFalse;
+ stroke_adjust = true;
+ align_stroke_coords = false;
+ adjusted_stroke_width = false;
xref = nullptr;
}
@@ -261,7 +261,7 @@ void CairoOutputDev::startDoc(PDFDoc *docA,
delete fontEngine;
}
fontEngine = new CairoFontEngine(ft_lib);
- fontEngine_owner = gTrue;
+ fontEngine_owner = true;
}
xref = doc->getXRef();
}
@@ -286,7 +286,7 @@ void CairoOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
void CairoOutputDev::endPage() {
if (text) {
text->endPage();
- text->coalesce(gTrue, 0, gFalse);
+ text->coalesce(true, 0, false);
}
}
@@ -312,7 +312,7 @@ void CairoOutputDev::restoreState(GfxState *state) {
if (cairo_shape)
cairo_restore (cairo_shape);
- text_matrix_valid = gTrue;
+ text_matrix_valid = true;
/* These aren't restored by cairo_restore() since we keep them in
* the output device. */
@@ -353,7 +353,7 @@ void CairoOutputDev::updateAll(GfxState *state) {
updateFillOpacity(state);
updateStrokeOpacity(state);
updateBlendMode(state);
- needFontUpdate = gTrue;
+ needFontUpdate = true;
if (text)
text->updateFont(state);
}
@@ -464,7 +464,7 @@ void CairoOutputDev::updateMiterLimit(GfxState *state) {
void CairoOutputDev::updateLineWidth(GfxState *state) {
LOG(printf ("line width: %f\n", state->getLineWidth()));
- adjusted_stroke_width = gFalse;
+ adjusted_stroke_width = false;
double width = state->getLineWidth();
if (stroke_adjust && !printing) {
double x, y;
@@ -477,7 +477,7 @@ void CairoOutputDev::updateLineWidth(GfxState *state) {
x = y = 1.0;
cairo_device_to_user_distance(cairo, &x, &y);
width = MIN(fabs(x),fabs(y));
- adjusted_stroke_width = gTrue;
+ adjusted_stroke_width = true;
}
} else if (width == 0.0) {
/* Cairo does not support 0 line width == 1 device pixel. Find out
@@ -656,7 +656,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
LOG(printf ("updateFont() font=%s\n", state->getFont()->getName()->getCString()));
- needFontUpdate = gFalse;
+ needFontUpdate = false;
//FIXME: use cairo font engine?
if (text)
@@ -697,12 +697,12 @@ void CairoOutputDev::updateFont(GfxState *state) {
invert_matrix = matrix;
if (cairo_matrix_invert(&invert_matrix)) {
error(errSyntaxWarning, -1, "font matrix not invertible");
- text_matrix_valid = gFalse;
+ text_matrix_valid = false;
return;
}
cairo_set_font_matrix (cairo, &matrix);
- text_matrix_valid = gTrue;
+ text_matrix_valid = true;
}
/* Tolerance in pixels for checking if strokes are horizontal or vertical
@@ -714,7 +714,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y)
{
double x1, y1, x2, y2;
- GBool align = gFalse;
+ bool align = false;
x1 = subpath->getX(i);
y1 = subpath->getY(i);
@@ -726,7 +726,7 @@ void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, do
y2 = subpath->getY(i - 1);
cairo_user_to_device (cairo, &x2, &y2);
if (fabs(x2 - x1) < STROKE_COORD_TOLERANCE || fabs(y2 - y1) < STROKE_COORD_TOLERANCE)
- align = gTrue;
+ align = true;
}
// Does the current coord and next coord form a horiz or vert line?
@@ -735,7 +735,7 @@ void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, do
y2 = subpath->getY(i + 1);
cairo_user_to_device (cairo, &x2, &y2);
if (fabs(x2 - x1) < STROKE_COORD_TOLERANCE || fabs(y2 - y1) < STROKE_COORD_TOLERANCE)
- align = gTrue;
+ align = true;
}
*x = subpath->getX(i);
@@ -809,9 +809,9 @@ void CairoOutputDev::stroke(GfxState *state) {
}
if (adjusted_stroke_width)
- align_stroke_coords = gTrue;
+ align_stroke_coords = true;
doPath (cairo, state, state->getPath());
- align_stroke_coords = gFalse;
+ align_stroke_coords = false;
cairo_set_source (cairo, stroke_pattern);
LOG(printf ("stroke\n"));
if (strokePathClip) {
@@ -887,7 +887,7 @@ void CairoOutputDev::eoFill(GfxState *state) {
}
-GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat, Object *str,
+bool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat, Object *str,
const double *pmat, int paintType, int /*tilingType*/, Dict *resDict,
const double *mat, const double *bbox,
int x0, int y0, int x1, int y1,
@@ -905,14 +905,14 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
double scaleX, scaleY;
int surface_width, surface_height;
StrokePathClip *strokePathTmp;
- GBool adjusted_stroke_width_tmp;
+ bool adjusted_stroke_width_tmp;
cairo_pattern_t *maskTmp;
width = bbox[2] - bbox[0];
height = bbox[3] - bbox[1];
if (xStep != width || yStep != height)
- return gFalse;
+ return false;
/* TODO: implement the other cases here too */
// Find the width and height of the transformed pattern
@@ -934,7 +934,7 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
CAIRO_CONTENT_COLOR_ALPHA,
surface_width, surface_height);
if (cairo_surface_status (surface))
- return gFalse;
+ return false;
old_cairo = cairo;
cairo = cairo_create (surface);
@@ -953,10 +953,10 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
mask = nullptr;
gfx = new Gfx(doc, this, resDict, &box, nullptr, nullptr, nullptr, gfxA);
if (paintType == 2)
- inUncoloredPattern = gTrue;
+ inUncoloredPattern = true;
gfx->display(str);
if (paintType == 2)
- inUncoloredPattern = gFalse;
+ inUncoloredPattern = false;
delete gfx;
strokePathClip = strokePathTmp;
adjusted_stroke_width = adjusted_stroke_width_tmp;
@@ -966,7 +966,7 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
cairo_destroy (cairo);
cairo = old_cairo;
if (cairo_pattern_status (pattern))
- return gFalse;
+ return false;
state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
cairo_rectangle (cairo, xMin, yMin, xMax - xMin, yMax - yMin);
@@ -986,11 +986,11 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
cairo_pattern_destroy (pattern);
- return gTrue;
+ return true;
}
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
-GBool CairoOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading)
+bool CairoOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading)
{
// Function shaded fills are subdivided to rectangles that are the
// following size in device space. Note when printing this size is
@@ -1014,7 +1014,7 @@ GBool CairoOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *sh
mat.y0 = matrix[5];
if (cairo_matrix_invert(&mat)) {
error(errSyntaxWarning, -1, "matrix not invertible\n");
- return gFalse;
+ return false;
}
// get cell size in pattern space
@@ -1085,11 +1085,11 @@ GBool CairoOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *sh
fill(state);
state->clearPath();
- return gTrue;
+ return true;
}
#endif /* CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) */
-GBool CairoOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) {
+bool CairoOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) {
double x0, y0, x1, y1;
double dx, dy;
@@ -1109,15 +1109,15 @@ GBool CairoOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading,
// TODO: use the actual stops in the shading in the case
// of linear interpolation (Type 2 Exponential functions with N=1)
- return gFalse;
+ return false;
}
-GBool CairoOutputDev::axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading)
+bool CairoOutputDev::axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading)
{
return (shading->getExtend0() == shading->getExtend1());
}
-GBool CairoOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax) {
+bool CairoOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax) {
double x0, y0, r0, x1, y1, r1;
double dx, dy, dr;
cairo_matrix_t matrix;
@@ -1153,16 +1153,16 @@ GBool CairoOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shadin
LOG (printf ("radial-sh\n"));
- return gFalse;
+ return false;
}
-GBool CairoOutputDev::radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading)
+bool CairoOutputDev::radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading)
{
return (shading->getExtend0() == shading->getExtend1());
}
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
-GBool CairoOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
+bool CairoOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
{
double x0, y0, x1, y1, x2, y2;
GfxColor color[3];
@@ -1217,10 +1217,10 @@ GBool CairoOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTrian
fill(state);
state->clearPath();
- return gTrue;
+ return true;
}
-GBool CairoOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading)
+bool CairoOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading)
{
int i, j, k;
@@ -1307,7 +1307,7 @@ GBool CairoOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *
fill(state);
state->clearPath();
- return gTrue;
+ return true;
}
#endif /* CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) */
@@ -1509,7 +1509,7 @@ finish:
}
-GBool CairoOutputDev::beginType3Char(GfxState *state, double x, double y,
+bool CairoOutputDev::beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
CharCode code, Unicode *u, int uLen) {
@@ -1535,7 +1535,7 @@ GBool CairoOutputDev::beginType3Char(GfxState *state, double x, double y,
cairo_pattern_destroy(stroke_pattern);
cairo_pattern_reference(fill_pattern);
stroke_pattern = fill_pattern;
- return gFalse;
+ return false;
}
void CairoOutputDev::endType3Char(GfxState *state) {
@@ -1558,7 +1558,7 @@ void CairoOutputDev::type3D1(GfxState *state, double wx, double wy,
t3_glyph_bbox[1] = lly;
t3_glyph_bbox[2] = urx;
t3_glyph_bbox[3] = ury;
- t3_glyph_has_bbox = gTrue;
+ t3_glyph_has_bbox = true;
}
void CairoOutputDev::beginTextObject(GfxState *state) {
@@ -1620,8 +1620,8 @@ cairo_surface_t *cairo_surface_create_similar_clip (cairo_t *cairo, cairo_conten
void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * blendingColorSpace,
- GBool /*isolated*/, GBool knockout,
- GBool forSoftMask) {
+ bool /*isolated*/, bool knockout,
+ bool forSoftMask) {
/* push color space */
ColorSpaceStack* css = new ColorSpaceStack;
css->cs = blendingColorSpace;
@@ -1746,7 +1746,7 @@ static int luminocity(uint32_t x)
/* XXX: do we need to deal with shape here? */
-void CairoOutputDev::setSoftMask(GfxState * state, const double * bbox, GBool alpha,
+void CairoOutputDev::setSoftMask(GfxState * state, const double * bbox, bool alpha,
Function * transferFunc, GfxColor * backdropColor) {
cairo_pattern_destroy(mask);
@@ -1956,7 +1956,7 @@ void CairoOutputDev::getScaledSize(const cairo_matrix_t *matrix,
cairo_filter_t
CairoOutputDev::getFilterForSurface(cairo_surface_t *image,
- GBool interpolate)
+ bool interpolate)
{
if (interpolate)
return CAIRO_FILTER_GOOD;
@@ -1983,8 +1983,8 @@ CairoOutputDev::getFilterForSurface(cairo_surface_t *image,
}
void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool interpolate, GBool inlineImg) {
+ int width, int height, bool invert,
+ bool interpolate, bool inlineImg) {
/* FIXME: Doesn't the image mask support any colorspace? */
cairo_set_source (cairo, fill_pattern);
@@ -2037,8 +2037,8 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
}
void CairoOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg, double *baseMatrix) {
+ int width, int height, bool invert,
+ bool inlineImg, double *baseMatrix) {
/* FIXME: Doesn't the image mask support any colorspace? */
cairo_set_source (cairo, fill_pattern);
@@ -2078,9 +2078,9 @@ void CairoOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stre
//XXX: it is possible that we should only do sub pixel positioning if
// we are rendering fonts */
if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) {
- drawImageMaskPrescaled(state, ref, str, width, height, invert, gFalse, inlineImg);
+ drawImageMaskPrescaled(state, ref, str, width, height, invert, false, inlineImg);
} else {
- drawImageMaskRegular(state, ref, str, width, height, invert, gFalse, inlineImg);
+ drawImageMaskRegular(state, ref, str, width, height, invert, false, inlineImg);
}
if (state->getFillColorSpace()->getMode() == csPattern) {
@@ -2097,7 +2097,7 @@ void CairoOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stre
saveState(state);
double bbox[4] = {0,0,1,1}; // dummy
beginTransparencyGroup(state, bbox, state->getFillColorSpace(),
- gTrue, gFalse, gFalse);
+ true, false, false);
}
void CairoOutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) {
@@ -2110,8 +2110,8 @@ void CairoOutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMat
}
void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool interpolate, GBool inlineImg) {
+ int width, int height, bool invert,
+ bool interpolate, bool inlineImg) {
unsigned char *buffer;
unsigned char *dest;
cairo_surface_t *image;
@@ -2219,8 +2219,8 @@ cleanup:
void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool interpolate, GBool inlineImg) {
+ int width, int height, bool invert,
+ bool interpolate, bool inlineImg) {
unsigned char *buffer;
cairo_surface_t *image;
cairo_pattern_t *pattern;
@@ -2515,10 +2515,10 @@ void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream
void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
Stream *str, int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr, int maskWidth,
- int maskHeight, GBool maskInvert,
- GBool maskInterpolate)
+ int maskHeight, bool maskInvert,
+ bool maskInterpolate)
{
ImageStream *maskImgStr, *imgStr;
ptrdiff_t row_stride;
@@ -2672,11 +2672,11 @@ cleanup:
void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
- GBool maskInterpolate)
+ bool maskInterpolate)
{
ImageStream *maskImgStr, *imgStr;
ptrdiff_t row_stride;
@@ -2833,7 +2833,7 @@ cleanup:
delete imgStr;
}
-GBool CairoOutputDev::getStreamData (Stream *str, char **buffer, int *length)
+bool CairoOutputDev::getStreamData (Stream *str, char **buffer, int *length)
{
int len, i;
char *strBuffer;
@@ -2843,7 +2843,7 @@ GBool CairoOutputDev::getStreamData (Stream *str, char **buffer, int *length)
str->reset();
while (str->getChar() != EOF) len++;
if (len == 0)
- return gFalse;
+ return false;
strBuffer = (char *)gmalloc (len);
@@ -2855,16 +2855,16 @@ GBool CairoOutputDev::getStreamData (Stream *str, char **buffer, int *length)
*buffer = strBuffer;
*length = len;
- return gTrue;
+ return true;
}
-static GBool colorMapHasIdentityDecodeMap(GfxImageColorMap *colorMap)
+static bool colorMapHasIdentityDecodeMap(GfxImageColorMap *colorMap)
{
for (int i = 0; i < colorMap->getNumPixelComps(); i++) {
if (colorMap->getDecodeLow(i) != 0.0 || colorMap->getDecodeHigh(i) != 1.0)
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)
@@ -2897,7 +2897,7 @@ static cairo_status_t setMimeIdFromRef(cairo_surface_t *surface,
#endif
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
-GBool CairoOutputDev::setMimeDataForJBIG2Globals(Stream *str,
+bool CairoOutputDev::setMimeDataForJBIG2Globals(Stream *str,
cairo_surface_t *image)
{
JBIG2Stream *jb2Str = static_cast<JBIG2Stream *>(str);
@@ -2907,14 +2907,14 @@ GBool CairoOutputDev::setMimeDataForJBIG2Globals(Stream *str,
// nothing to do for JBIG2 stream without Globals
if (!globalsStr->isStream())
- return gTrue;
+ return true;
if (setMimeIdFromRef(image, CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID, nullptr,
jb2Str->getGlobalsStreamRef()))
- return gFalse;
+ return false;
if (!getStreamData(globalsStr->getStream(), &globalsBuffer, &globalsLength))
- return gFalse;
+ return false;
if (cairo_surface_set_mime_data (image, CAIRO_MIME_TYPE_JBIG2_GLOBAL,
(const unsigned char*)globalsBuffer,
@@ -2922,15 +2922,15 @@ GBool CairoOutputDev::setMimeDataForJBIG2Globals(Stream *str,
gfree, (void*)globalsBuffer))
{
gfree (globalsBuffer);
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
#endif
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 10)
-GBool CairoOutputDev::setMimeDataForCCITTParams(Stream *str,
+bool CairoOutputDev::setMimeDataForCCITTParams(Stream *str,
cairo_surface_t *image, int height)
{
CCITTFaxStream *ccittStr = static_cast<CCITTFaxStream *>(str);
@@ -2952,10 +2952,10 @@ GBool CairoOutputDev::setMimeDataForCCITTParams(Stream *str,
gfree, (void*)p))
{
gfree (p);
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
#endif
@@ -3064,13 +3064,13 @@ private:
GfxImageColorMap *colorMap;
int *maskColors;
int current_row;
- GBool imageError;
+ bool imageError;
public:
cairo_surface_t *getSourceImage(Stream *str,
int widthA, int height,
int scaledWidth, int scaledHeight,
- GBool printing,
+ bool printing,
GfxImageColorMap *colorMapA,
int *maskColorsA) {
cairo_surface_t *image = nullptr;
@@ -3081,7 +3081,7 @@ public:
maskColors = maskColorsA;
width = widthA;
current_row = -1;
- imageError = gFalse;
+ imageError = false;
/* TODO: Do we want to cache these? */
imgStr = new ImageStream(str, width,
@@ -3196,7 +3196,7 @@ public:
memset(row_data, 0, width*4);
if (!imageError) {
error(errInternal, -1, "Bad image stream");
- imageError = gTrue;
+ imageError = true;
}
} else if (lookup) {
Guchar *p = pix;
@@ -3239,8 +3239,8 @@ public:
void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int widthA, int heightA,
GfxImageColorMap *colorMap,
- GBool interpolate,
- int *maskColors, GBool inlineImg)
+ bool interpolate,
+ int *maskColors, bool inlineImg)
{
cairo_surface_t *image;
cairo_pattern_t *pattern, *maskPattern;
@@ -3397,8 +3397,8 @@ void CairoImageOutputDev::getBBox(GfxState *state, int width, int height,
}
void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool interpolate, GBool inlineImg)
+ int width, int height, bool invert,
+ bool interpolate, bool inlineImg)
{
cairo_t *cr;
cairo_surface_t *surface;
@@ -3427,8 +3427,8 @@ void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *st
}
void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg, double *baseMatrix)
+ int width, int height, bool invert,
+ bool inlineImg, double *baseMatrix)
{
cairo_t *cr;
cairo_surface_t *surface;
@@ -3447,7 +3447,7 @@ void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref,
cairo_translate (cr, 0, height);
cairo_scale (cr, width, -height);
- CairoOutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg, gFalse);
+ CairoOutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg, false);
if (state->getFillColorSpace()->getMode() == csPattern) {
cairo_mask (cairo, mask);
}
@@ -3461,7 +3461,7 @@ void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref,
void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- GBool interpolate, int *maskColors, GBool inlineImg)
+ bool interpolate, int *maskColors, bool inlineImg)
{
cairo_t *cr;
cairo_surface_t *surface;
@@ -3492,11 +3492,11 @@ void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
- GBool maskInterpolate)
+ bool maskInterpolate)
{
cairo_t *cr;
cairo_surface_t *surface;
@@ -3528,10 +3528,10 @@ void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stre
void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
- GBool maskInvert, GBool maskInterpolate)
+ bool maskInvert, bool maskInterpolate)
{
cairo_t *cr;
cairo_surface_t *surface;
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index a484e3b6..00b0d7d1 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -98,35 +98,35 @@ public:
// Does this device use upside-down coordinates?
// (Upside-down means (0,0) is the top left corner of the page.)
- GBool upsideDown() override { return gTrue; }
+ bool upsideDown() override { return true; }
// Does this device use drawChar() or drawString()?
- GBool useDrawChar() override { return gTrue; }
+ bool useDrawChar() override { return true; }
// Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing
// operations.
- GBool useTilingPatternFill() override { return gTrue; }
+ bool useTilingPatternFill() override { return true; }
// Does this device use functionShadedFill(), axialShadedFill(), and
// radialShadedFill()? If this returns false, these shaded fills
// will be reduced to a series of other drawing operations.
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
- GBool useShadedFills(int type) override { return type <= 7; }
+ bool useShadedFills(int type) override { return type <= 7; }
#else
- GBool useShadedFills(int type) override { return type > 1 && type < 4; }
+ bool useShadedFills(int type) override { return type > 1 && type < 4; }
#endif
// Does this device use FillColorStop()?
- GBool useFillColorStop() override { return gTrue; }
+ bool useFillColorStop() override { return true; }
// Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString.
- GBool interpretType3Chars() override { return gFalse; }
+ bool interpretType3Chars() override { return false; }
// Does this device need to clip pages to the crop box even when the
// box is the crop box?
- GBool needClipToCropBox() override { return gTrue; }
+ bool needClipToCropBox() override { return true; }
//----- initialization and control
@@ -166,21 +166,21 @@ public:
void fill(GfxState *state) override;
void eoFill(GfxState *state) override;
void clipToStrokePath(GfxState *state) override;
- GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
+ bool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
const double *pmat, int paintType, int tilingType, Dict *resDict,
const double *mat, const double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep) override;
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
- GBool functionShadedFill(GfxState *state, GfxFunctionShading *shading) override;
+ bool functionShadedFill(GfxState *state, GfxFunctionShading *shading) override;
#endif
- GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) override;
- GBool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) override;
- GBool radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax) override;
- GBool radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading) override;
+ bool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) override;
+ bool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) override;
+ bool radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax) override;
+ bool radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading) override;
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
- GBool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading) override;
- GBool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading) override;
+ bool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading) override;
+ bool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading) override;
#endif
//----- path clipping
@@ -197,7 +197,7 @@ public:
void beginActualText(GfxState *state, const GooString *text) override;
void endActualText(GfxState *state) override;
- GBool beginType3Char(GfxState *state, double x, double y,
+ bool beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
CharCode code, Unicode *u, int uLen) override;
void endType3Char(GfxState *state) override;
@@ -206,49 +206,49 @@ public:
//----- image drawing
void drawImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert, GBool interpolate,
- GBool inlineImg) override;
+ int width, int height, bool invert, bool interpolate,
+ bool inlineImg) override;
void setSoftMaskFromImageMask(GfxState *state,
Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg, double *baseMatrix) override;
+ int width, int height, bool invert,
+ bool inlineImg, double *baseMatrix) override;
void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) override;
void drawImageMaskPrescaled(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert, GBool interpolate,
- GBool inlineImg);
+ int width, int height, bool invert, bool interpolate,
+ bool inlineImg);
void drawImageMaskRegular(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert, GBool interpolate,
- GBool inlineImg);
+ int width, int height, bool invert, bool interpolate,
+ bool inlineImg);
void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- GBool interpolate, int *maskColors, GBool inlineImg) override;
+ bool interpolate, int *maskColors, bool inlineImg) override;
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
- GBool maskInterpolate) override;
+ bool maskInterpolate) override;
void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
- GBool maskInvert, GBool maskInterpolate) override;
+ bool maskInvert, bool maskInterpolate) override;
//----- transparency groups and soft masks
void beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * /*blendingColorSpace*/,
- GBool /*isolated*/, GBool /*knockout*/,
- GBool /*forSoftMask*/) override;
+ bool /*isolated*/, bool /*knockout*/,
+ bool /*forSoftMask*/) override;
void endTransparencyGroup(GfxState * /*state*/) override;
void popTransparencyGroup();
void paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) override;
- void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, GBool /*alpha*/,
+ void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, bool /*alpha*/,
Function * /*transferFunc*/, GfxColor * /*backdropColor*/) override;
void clearSoftMask(GfxState * /*state*/) override;
@@ -262,16 +262,16 @@ public:
// Called to indicate that a new PDF document has been loaded.
void startDoc(PDFDoc *docA, CairoFontEngine *fontEngine = nullptr);
- GBool isReverseVideo() { return gFalse; }
+ bool isReverseVideo() { return false; }
void setCairo (cairo_t *cr);
void setTextPage (TextPage *text);
- void setPrinting (GBool printingA) { printing = printingA; needFontUpdate = gTrue; }
+ void setPrinting (bool printingA) { printing = printingA; needFontUpdate = true; }
void setAntialias(cairo_antialias_t antialias);
- void setInType3Char(GBool inType3CharA) { inType3Char = inType3CharA; }
+ void setInType3Char(bool inType3CharA) { inType3Char = inType3CharA; }
void getType3GlyphWidth (double *wx, double *wy) { *wx = t3_glyph_wx; *wy = t3_glyph_wy; }
- GBool hasType3GlyphBBox () { return t3_glyph_has_bbox; }
+ bool hasType3GlyphBBox () { return t3_glyph_has_bbox; }
double *getType3GlyphBBox () { return t3_glyph_bbox; }
protected:
@@ -281,17 +281,17 @@ protected:
int orig_width, int orig_height,
int *scaledWidth, int *scaledHeight);
cairo_filter_t getFilterForSurface(cairo_surface_t *image,
- GBool interpolate);
- GBool getStreamData (Stream *str, char **buffer, int *length);
+ bool interpolate);
+ bool getStreamData (Stream *str, char **buffer, int *length);
void setMimeData(GfxState *state, Stream *str, Object *ref,
GfxImageColorMap *colorMap, cairo_surface_t *image, int height);
void fillToStrokePathClip(GfxState *state);
void alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y);
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
- GBool setMimeDataForJBIG2Globals (Stream *str, cairo_surface_t *image);
+ bool setMimeDataForJBIG2Globals (Stream *str, cairo_surface_t *image);
#endif
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 10)
- GBool setMimeDataForCCITTParams(Stream *str, cairo_surface_t *image, int height);
+ bool setMimeDataForCCITTParams(Stream *str, cairo_surface_t *image, int height);
#endif
static void setContextAntialias(cairo_t *cr, cairo_antialias_t antialias);
@@ -299,9 +299,9 @@ protected:
cairo_pattern_t *fill_pattern, *stroke_pattern;
double fill_opacity;
double stroke_opacity;
- GBool stroke_adjust;
- GBool adjusted_stroke_width;
- GBool align_stroke_coords;
+ bool stroke_adjust;
+ bool adjusted_stroke_width;
+ bool align_stroke_coords;
CairoFont *currentFont;
XRef *xref;
@@ -321,17 +321,17 @@ protected:
PDFDoc *doc; // the current document
static FT_Library ft_lib;
- static GBool ft_lib_initialized;
+ static bool ft_lib_initialized;
CairoFontEngine *fontEngine;
- GBool fontEngine_owner;
+ bool fontEngine_owner;
cairo_t *cairo;
cairo_matrix_t orig_matrix;
- GBool needFontUpdate; // set when the font needs to be updated
- GBool printing;
- GBool use_show_text_glyphs;
- GBool text_matrix_valid;
+ bool needFontUpdate; // set when the font needs to be updated
+ bool printing;
+ bool use_show_text_glyphs;
+ bool text_matrix_valid;
cairo_glyph_t *glyphs;
int glyphCount;
cairo_text_cluster_t *clusters;
@@ -340,13 +340,13 @@ protected:
int utf8Count;
int utf8Max;
cairo_path_t *textClipPath;
- GBool inUncoloredPattern; // inside a uncolored pattern (PaintType = 2)
- GBool inType3Char; // inside a Type 3 CharProc
+ bool inUncoloredPattern; // inside a uncolored pattern (PaintType = 2)
+ bool inType3Char; // inside a Type 3 CharProc
double t3_glyph_wx, t3_glyph_wy;
- GBool t3_glyph_has_bbox;
+ bool t3_glyph_has_bbox;
double t3_glyph_bbox[4];
cairo_antialias_t antialias;
- GBool prescaleImages;
+ bool prescaleImages;
TextPage *text; // text for the current page
ActualText *actualText;
@@ -358,7 +358,7 @@ protected:
cairo_t *cairo_shape;
int knockoutCount;
struct ColorSpaceStack {
- GBool knockout;
+ bool knockout;
GfxColorSpace *cs;
cairo_matrix_t group_matrix;
struct ColorSpaceStack *next;
@@ -390,34 +390,34 @@ public:
// Does this device use upside-down coordinates?
// (Upside-down means (0,0) is the top left corner of the page.)
- GBool upsideDown() override { return gTrue; }
+ bool upsideDown() override { return true; }
// Does this device use drawChar() or drawString()?
- GBool useDrawChar() override { return gFalse; }
+ bool useDrawChar() override { return false; }
// Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing
// operations.
- GBool useTilingPatternFill() override { return gTrue; }
+ bool useTilingPatternFill() override { return true; }
// Does this device use functionShadedFill(), axialShadedFill(), and
// radialShadedFill()? If this returns false, these shaded fills
// will be reduced to a series of other drawing operations.
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)
- GBool useShadedFills(int type) override { return type <= 7; }
+ bool useShadedFills(int type) override { return type <= 7; }
#else
- GBool useShadedFills(int type) override { return type < 4; }
+ bool useShadedFills(int type) override { return type < 4; }
#endif
// Does this device use FillColorStop()?
- GBool useFillColorStop() override { return gFalse; }
+ bool useFillColorStop() override { return false; }
// Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString.
- GBool interpretType3Chars() override { return gFalse; }
+ bool interpretType3Chars() override { return false; }
// Does this device need non-text content?
- GBool needNonText() override { return gTrue; }
+ bool needNonText() override { return true; }
//----- save/restore graphics state
void saveState(GfxState *state) override { }
@@ -448,17 +448,17 @@ public:
void fill(GfxState *state) override { }
void eoFill(GfxState *state) override { }
void clipToStrokePath(GfxState *state) override { }
- GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
+ bool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
const double *pmat, int paintType, int tilingType, Dict *resDict,
const double *mat, const double *bbox,
int x0, int y0, int x1, int y1,
- double xStep, double yStep) override { return gTrue; }
- GBool axialShadedFill(GfxState *state,
+ double xStep, double yStep) override { return true; }
+ bool axialShadedFill(GfxState *state,
GfxAxialShading *shading,
- double tMin, double tMax) override { return gTrue; }
- GBool radialShadedFill(GfxState *state,
+ double tMin, double tMax) override { return true; }
+ bool radialShadedFill(GfxState *state,
GfxRadialShading *shading,
- double sMin, double sMax) override { return gTrue; }
+ double sMin, double sMax) override { return true; }
//----- path clipping
void clip(GfxState *state) override { }
@@ -466,46 +466,46 @@ public:
//----- image drawing
void drawImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool interpolate, GBool inlineImg) override;
+ int width, int height, bool invert,
+ bool interpolate, bool inlineImg) override;
void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- GBool interpolate, int *maskColors, GBool inlineImg) override;
+ bool interpolate, int *maskColors, bool inlineImg) override;
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
- GBool maskInterpolate) override;
+ bool maskInterpolate) override;
void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
- GBool maskInvert, GBool maskInterpolate) override;
+ bool maskInvert, bool maskInterpolate) override;
void setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg, double *baseMatrix) override;
+ int width, int height, bool invert,
+ bool inlineImg, double *baseMatrix) override;
void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) override {}
//----- transparency groups and soft masks
void beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * /*blendingColorSpace*/,
- GBool /*isolated*/, GBool /*knockout*/,
- GBool /*forSoftMask*/) override {}
+ bool /*isolated*/, bool /*knockout*/,
+ bool /*forSoftMask*/) override {}
void endTransparencyGroup(GfxState * /*state*/) override {}
void paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) override {}
- void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, GBool /*alpha*/,
+ void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, bool /*alpha*/,
Function * /*transferFunc*/, GfxColor * /*backdropColor*/) override {}
void clearSoftMask(GfxState * /*state*/) override {}
//----- Image list
// By default images are not rendred
- void setImageDrawDecideCbk(GBool (*cbk)(int img_id, void *data),
+ void setImageDrawDecideCbk(bool (*cbk)(int img_id, void *data),
void *data) { imgDrawCbk = cbk; imgDrawCbkData = data; }
// Iterate through list of images.
int getNumImages() const { return numImages; }
@@ -519,7 +519,7 @@ private:
CairoImage **images;
int numImages;
int size;
- GBool (*imgDrawCbk)(int img_id, void *data);
+ bool (*imgDrawCbk)(int img_id, void *data);
void *imgDrawCbkData;
};
diff --git a/poppler/CairoRescaleBox.cc b/poppler/CairoRescaleBox.cc
index 59a5c190..d59eefd8 100644
--- a/poppler/CairoRescaleBox.cc
+++ b/poppler/CairoRescaleBox.cc
@@ -263,7 +263,7 @@ static int compute_coverage (int coverage[], int src_length, int dest_length)
}
-GBool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height,
+bool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height,
signed scaled_width, signed scaled_height,
unsigned short int start_column, unsigned short int start_row,
unsigned short int width, unsigned short int height,
@@ -275,7 +275,7 @@ GBool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height,
int *x_coverage = nullptr;
int *y_coverage = nullptr;
uint32_t *temp_buf = nullptr;
- GBool retval = gFalse;
+ bool retval = false;
unsigned int *dest;
int dst_stride;
@@ -365,7 +365,7 @@ GBool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height,
}
// assert (src_y<=orig_height);
- retval = gTrue;
+ retval = true;
cleanup:
free (x_coverage);
diff --git a/poppler/CairoRescaleBox.h b/poppler/CairoRescaleBox.h
index ca307cb7..3c94724a 100644
--- a/poppler/CairoRescaleBox.h
+++ b/poppler/CairoRescaleBox.h
@@ -52,7 +52,7 @@ public:
CairoRescaleBox(const CairoRescaleBox &) = delete;
CairoRescaleBox& operator=(const CairoRescaleBox &) = delete;
- virtual GBool downScaleImage(unsigned orig_width, unsigned orig_height,
+ virtual bool downScaleImage(unsigned orig_width, unsigned orig_height,
signed scaled_width, signed scaled_height,
unsigned short int start_column, unsigned short int start_row,
unsigned short int width, unsigned short int height,
diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc
index 78f419e2..6048cc42 100644
--- a/poppler/Catalog.cc
+++ b/poppler/Catalog.cc
@@ -69,7 +69,7 @@
#define catalogLocker() std::unique_lock<std::recursive_mutex> locker(mutex)
Catalog::Catalog(PDFDoc *docA) {
- ok = gTrue;
+ ok = true;
doc = docA;
xref = doc->getXRef();
numPages = -1;
@@ -94,7 +94,7 @@ Catalog::Catalog(PDFDoc *docA) {
Object catDict = xref->getCatalog();
if (!catDict.isDict()) {
error(errSyntaxError, -1, "Catalog object is wrong type ({0:s})", catDict.getTypeName());
- ok = gFalse;
+ ok = false;
return;
}
// get the AcroForm dictionary
@@ -182,8 +182,8 @@ Page *Catalog::getPage(int i)
catalogLocker();
if (std::size_t(i) > pages.size()) {
- GBool cached = cachePageTree(i);
- if ( cached == gFalse) {
+ bool cached = cachePageTree(i);
+ if ( cached == false) {
return nullptr;
}
}
@@ -196,15 +196,15 @@ Ref *Catalog::getPageRef(int i)
catalogLocker();
if (std::size_t(i) > pages.size()) {
- GBool cached = cachePageTree(i);
- if ( cached == gFalse) {
+ bool cached = cachePageTree(i);
+ if ( cached == false) {
return nullptr;
}
}
return &pages[i-1].second;
}
-GBool Catalog::cachePageTree(int page)
+bool Catalog::cachePageTree(int page)
{
if (pagesList == nullptr) {
@@ -220,11 +220,11 @@ GBool Catalog::cachePageTree(int page)
pagesRef = pagesDictRef.getRef();
} else {
error(errSyntaxError, -1, "Catalog dictionary does not contain a valid \"Pages\" entry");
- return gFalse;
+ return false;
}
} else {
error(errSyntaxError, -1, "Could not find catalog dictionary");
- return gFalse;
+ return false;
}
Object obj = catDict.dictLookup("Pages");
@@ -232,7 +232,7 @@ GBool Catalog::cachePageTree(int page)
// PDF file where the /Type entry is missing.
if (!obj.isDict()) {
error(errSyntaxError, -1, "Top-level pages object is wrong type ({0:s})", obj.getTypeName());
- return gFalse;
+ return false;
}
pages.clear();
@@ -248,16 +248,16 @@ GBool Catalog::cachePageTree(int page)
while(1) {
- if (std::size_t(page) <= pages.size()) return gTrue;
+ if (std::size_t(page) <= pages.size()) return true;
- if (pagesList->empty()) return gFalse;
+ if (pagesList->empty()) return false;
Object pagesDict = pagesList->back().copy();
Object kids = pagesDict.dictLookup("Kids");
if (!kids.isArray()) {
error(errSyntaxError, -1, "Kids object (page {0:uld}) is wrong type ({1:s})",
pages.size()+1, kids.getTypeName());
- return gFalse;
+ return false;
}
int kidsIdx = kidsIdxList->back();
@@ -275,13 +275,13 @@ GBool Catalog::cachePageTree(int page)
if (!kidRef.isRef()) {
error(errSyntaxError, -1, "Kid object (page {0:uld}) is not an indirect reference ({1:s})",
pages.size()+1, kidRef.getTypeName());
- return gFalse;
+ return false;
}
- GBool loop = gFalse;;
+ bool loop = false;;
for (size_t i = 0; i < pagesRefList->size(); i++) {
if (((*pagesRefList)[i]).num == kidRef.getRefNum()) {
- loop = gTrue;
+ loop = true;
break;
}
}
@@ -298,12 +298,12 @@ GBool Catalog::cachePageTree(int page)
kidRef.getRef(), attrs, form);
if (!p->isOk()) {
error(errSyntaxError, -1, "Failed to create page (page {0:uld})", pages.size()+1);
- return gFalse;
+ return false;
}
if (pages.size() >= std::size_t(numPages)) {
error(errSyntaxError, -1, "Page count in top-level pages object is incorrect");
- return gFalse;
+ return false;
}
pages.emplace_back(std::move(p), kidRef.getRef());
@@ -324,7 +324,7 @@ GBool Catalog::cachePageTree(int page)
}
}
- return gFalse;
+ return false;
}
int Catalog::findPage(int num, int gen) {
@@ -672,32 +672,32 @@ GooString *NameTree::getName(int index)
}
}
-GBool Catalog::labelToIndex(GooString *label, int *index)
+bool Catalog::labelToIndex(GooString *label, int *index)
{
char *end;
PageLabelInfo *pli = getPageLabelInfo();
if (pli != nullptr) {
if (!pli->labelToIndex(label, index))
- return gFalse;
+ return false;
} else {
*index = strtol(label->getCString(), &end, 10) - 1;
if (*end != '\0')
- return gFalse;
+ return false;
}
if (*index < 0 || *index >= getNumPages())
- return gFalse;
+ return false;
- return gTrue;
+ return true;
}
-GBool Catalog::indexToLabel(int index, GooString *label)
+bool Catalog::indexToLabel(int index, GooString *label)
{
char buffer[32];
if (index < 0 || index >= getNumPages())
- return gFalse;
+ return false;
PageLabelInfo *pli = getPageLabelInfo();
if (pli != nullptr) {
@@ -705,7 +705,7 @@ GBool Catalog::indexToLabel(int index, GooString *label)
} else {
snprintf(buffer, sizeof (buffer), "%d", index + 1);
label->append(buffer);
- return gTrue;
+ return true;
}
}
diff --git a/poppler/Catalog.h b/poppler/Catalog.h
index 05d2146c..5c638dcf 100644
--- a/poppler/Catalog.h
+++ b/poppler/Catalog.h
@@ -116,7 +116,7 @@ public:
Catalog& operator=(const Catalog &) = delete;
// Is catalog valid?
- GBool isOk() { return ok; }
+ bool isOk() { return ok; }
// Get number of pages.
int getNumPages();
@@ -188,8 +188,8 @@ public:
GooString *getJS(int i);
// Convert between page indices and page labels.
- GBool labelToIndex(GooString *label, int *index);
- GBool indexToLabel(int index, GooString *label);
+ bool labelToIndex(GooString *label, int *index);
+ bool indexToLabel(int index, GooString *label);
Object *getOutline();
@@ -271,13 +271,13 @@ private:
Object acroForm; // AcroForm dictionary
Object viewerPreferences; // ViewerPreference dictionary
OCGs *optContent; // Optional Content groups
- GBool ok; // true if catalog is valid
+ bool ok; // true if catalog is valid
PageLabelInfo *pageLabelInfo; // info about page labels
PageMode pageMode; // page mode
PageLayout pageLayout; // page layout
Object additionalActions; // page additional actions
- GBool cachePageTree(int page); // Cache first <page> pages.
+ bool cachePageTree(int page); // Cache first <page> pages.
Object *findDestInTree(Object *tree, GooString *name, Object *obj);
Object *getNames();
diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc
index ecd620f8..237f8103 100644
--- a/poppler/CharCodeToUnicode.cc
+++ b/poppler/CharCodeToUnicode.cc
@@ -99,25 +99,25 @@ static int hexCharVals[256] = {
// Parse a <len>-byte hex string <s> into *<val>. Returns false on
// error.
-static GBool parseHex(const char *s, int len, Guint *val) {
+static bool parseHex(const char *s, int len, Guint *val) {
int i, x;
*val = 0;
for (i = 0; i < len; ++i) {
x = hexCharVals[s[i] & 0xff];
if (x < 0) {
- return gFalse;
+ return false;
}
*val = (*val << 4) + x;
}
- return gTrue;
+ return true;
}
//------------------------------------------------------------------------
CharCodeToUnicode *CharCodeToUnicode::makeIdentityMapping() {
CharCodeToUnicode *ctu = new CharCodeToUnicode();
- ctu->isIdentity = gTrue;
+ ctu->isIdentity = true;
ctu->mapLen = 1;
ctu->map = (Unicode *)gmallocn(ctu->mapLen, sizeof(Unicode));
return ctu;
@@ -158,7 +158,7 @@ CharCodeToUnicode *CharCodeToUnicode::parseCIDToUnicode(const char *fileName,
}
fclose(f);
- ctu = new CharCodeToUnicode(collection->copy(), mapA, mapLenA, gTrue,
+ ctu = new CharCodeToUnicode(collection->copy(), mapA, mapLenA, true,
nullptr, 0, 0);
gfree(mapA);
return ctu;
@@ -252,7 +252,7 @@ CharCodeToUnicode *CharCodeToUnicode::parseUnicodeToUnicode(
}
fclose(f);
- ctu = new CharCodeToUnicode(fileName->copy(), mapA, len, gTrue,
+ ctu = new CharCodeToUnicode(fileName->copy(), mapA, len, true,
sMapA, sMapLenA, sMapSizeA);
gfree(mapA);
gfree(uBuf);
@@ -260,7 +260,7 @@ CharCodeToUnicode *CharCodeToUnicode::parseUnicodeToUnicode(
}
CharCodeToUnicode *CharCodeToUnicode::make8BitToUnicode(Unicode *toUnicode) {
- return new CharCodeToUnicode(nullptr, toUnicode, 256, gTrue, nullptr, 0, 0);
+ return new CharCodeToUnicode(nullptr, toUnicode, 256, true, nullptr, 0, 0);
}
CharCodeToUnicode *CharCodeToUnicode::parseCMap(GooString *buf, int nBits) {
@@ -480,7 +480,7 @@ CharCodeToUnicode::CharCodeToUnicode() {
sMap = nullptr;
sMapLen = sMapSize = 0;
refCnt = 1;
- isIdentity = gFalse;
+ isIdentity = false;
}
CharCodeToUnicode::CharCodeToUnicode(GooString *tagA) {
@@ -495,11 +495,11 @@ CharCodeToUnicode::CharCodeToUnicode(GooString *tagA) {
sMap = nullptr;
sMapLen = sMapSize = 0;
refCnt = 1;
- isIdentity = gFalse;
+ isIdentity = false;
}
CharCodeToUnicode::CharCodeToUnicode(GooString *tagA, Unicode *mapA,
- CharCode mapLenA, GBool copyMap,
+ CharCode mapLenA, bool copyMap,
CharCodeToUnicodeString *sMapA,
int sMapLenA, int sMapSizeA) {
tag = tagA;
@@ -514,7 +514,7 @@ CharCodeToUnicode::CharCodeToUnicode(GooString *tagA, Unicode *mapA,
sMapLen = sMapLenA;
sMapSize = sMapSizeA;
refCnt = 1;
- isIdentity = gFalse;
+ isIdentity = false;
}
CharCodeToUnicode::~CharCodeToUnicode() {
@@ -538,7 +538,7 @@ void CharCodeToUnicode::decRefCnt() {
}
}
-GBool CharCodeToUnicode::match(GooString *tagA) {
+bool CharCodeToUnicode::match(GooString *tagA) {
return tag && !tag->cmp(tagA);
}
diff --git a/poppler/CharCodeToUnicode.h b/poppler/CharCodeToUnicode.h
index 062f5a26..0f998b1d 100644
--- a/poppler/CharCodeToUnicode.h
+++ b/poppler/CharCodeToUnicode.h
@@ -81,7 +81,7 @@ public:
void decRefCnt();
// Return true if this mapping matches the specified <tagA>.
- GBool match(GooString *tagA);
+ bool match(GooString *tagA);
// Set the mapping for <c>.
void setMapping(CharCode c, Unicode *u, int len);
@@ -105,7 +105,7 @@ private:
CharCodeToUnicode();
CharCodeToUnicode(GooString *tagA);
CharCodeToUnicode(GooString *tagA, Unicode *mapA,
- CharCode mapLenA, GBool copyMap,
+ CharCode mapLenA, bool copyMap,
CharCodeToUnicodeString *sMapA,
int sMapLenA, int sMapSizeA);
@@ -115,7 +115,7 @@ private:
CharCodeToUnicodeString *sMap;
int sMapLen, sMapSize;
std::atomic_int refCnt;
- GBool isIdentity;
+ bool isIdentity;
};
//------------------------------------------------------------------------
diff --git a/poppler/CurlPDFDocBuilder.cc b/poppler/CurlPDFDocBuilder.cc
index 4dae58e7..8405109c 100644
--- a/poppler/CurlPDFDocBuilder.cc
+++ b/poppler/CurlPDFDocBuilder.cc
@@ -34,17 +34,17 @@ CurlPDFDocBuilder::buildPDFDoc(const GooString &uri,
}
BaseStream *str = new CachedFileStream(
- cachedFile, 0, gFalse, cachedFile->getLength(), Object(objNull));
+ cachedFile, 0, false, cachedFile->getLength(), Object(objNull));
return new PDFDoc(str, ownerPassword, userPassword, guiDataA);
}
-GBool CurlPDFDocBuilder::supports(const GooString &uri)
+bool CurlPDFDocBuilder::supports(const GooString &uri)
{
if (uri.cmpN("http://", 7) == 0 || uri.cmpN("https://", 8) == 0) {
- return gTrue;
+ return true;
} else {
- return gFalse;
+ return false;
}
}
diff --git a/poppler/CurlPDFDocBuilder.h b/poppler/CurlPDFDocBuilder.h
index 37c73a1c..ce421e21 100644
--- a/poppler/CurlPDFDocBuilder.h
+++ b/poppler/CurlPDFDocBuilder.h
@@ -26,7 +26,7 @@ public:
PDFDoc *buildPDFDoc(const GooString &uri, GooString *ownerPassword = nullptr,
GooString *userPassword = nullptr, void *guiDataA = nullptr) override;
- GBool supports(const GooString &uri) override;
+ bool supports(const GooString &uri) override;
};
diff --git a/poppler/DCTStream.cc b/poppler/DCTStream.cc
index 4665ca83..b7bc1c68 100644
--- a/poppler/DCTStream.cc
+++ b/poppler/DCTStream.cc
@@ -260,6 +260,6 @@ GooString *DCTStream::getPSFilter(int psLevel, const char *indent) {
return s;
}
-GBool DCTStream::isBinary(GBool last) {
- return str->isBinary(gTrue);
+bool DCTStream::isBinary(bool last) {
+ return str->isBinary(true);
}
diff --git a/poppler/DCTStream.h b/poppler/DCTStream.h
index 41a4759d..6bb81cc4 100644
--- a/poppler/DCTStream.h
+++ b/poppler/DCTStream.h
@@ -62,12 +62,12 @@ public:
int getChar() override;
int lookChar() override;
GooString *getPSFilter(int psLevel, const char *indent) override;
- GBool isBinary(GBool last = gTrue) override;
+ bool isBinary(bool last = true) override;
private:
void init();
- GBool hasGetChars() override { return true; }
+ bool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
int colorXform;
diff --git a/poppler/DateInfo.cc b/poppler/DateInfo.cc
index b2251004..d0988f24 100644
--- a/poppler/DateInfo.cc
+++ b/poppler/DateInfo.cc
@@ -30,10 +30,10 @@
#include <string.h>
/* See PDF Reference 1.3, Section 3.8.2 for PDF Date representation */
-GBool parseDateString(const char *dateString, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute)
+bool parseDateString(const char *dateString, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute)
{
- if ( dateString == nullptr ) return gFalse;
- if ( strlen(dateString) < 2 ) return gFalse;
+ if ( dateString == nullptr ) return false;
+ if ( strlen(dateString) < 2 ) return false;
if ( dateString[0] == 'D' && dateString[1] == ':' )
dateString += 2;
@@ -64,16 +64,16 @@ GBool parseDateString(const char *dateString, int *year, int *month, int *day, i
}
else
{
- return gFalse;
+ return false;
}
}
- if (*year <= 0) return gFalse;
+ if (*year <= 0) return false;
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
// Convert time to PDF date string
diff --git a/poppler/DateInfo.h b/poppler/DateInfo.h
index 90570d42..653e677c 100644
--- a/poppler/DateInfo.h
+++ b/poppler/DateInfo.h
@@ -28,7 +28,7 @@
#include "goo/GooString.h"
#include <time.h>
-GBool parseDateString(const char *string, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute);
+bool parseDateString(const char *string, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute);
/* Converts the time_t into a PDF Date format string.
* If timet is NULL, current time is used.
diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
index e679f299..8c1196b0 100644
--- a/poppler/Decrypt.cc
+++ b/poppler/Decrypt.cc
@@ -40,15 +40,15 @@
static void rc4InitKey(Guchar *key, int keyLen, Guchar *state);
static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c);
-static GBool aesReadBlock(Stream *str, Guchar *in, GBool addPadding);
+static bool aesReadBlock(Stream *str, Guchar *in, bool addPadding);
-static void aesKeyExpansion(DecryptAESState *s, Guchar *objKey, int objKeyLen, GBool decrypt);
+static void aesKeyExpansion(DecryptAESState *s, Guchar *objKey, int objKeyLen, bool decrypt);
static void aesEncryptBlock(DecryptAESState *s, Guchar *in);
-static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last);
+static void aesDecryptBlock(DecryptAESState *s, Guchar *in, bool last);
-static void aes256KeyExpansion(DecryptAES256State *s, Guchar *objKey, int objKeyLen, GBool decrypt);
+static void aes256KeyExpansion(DecryptAES256State *s, Guchar *objKey, int objKeyLen, bool decrypt);
static void aes256EncryptBlock(DecryptAES256State *s, Guchar *in);
-static void aes256DecryptBlock(DecryptAES256State *s, Guchar *in, GBool last);
+static void aes256DecryptBlock(DecryptAES256State *s, Guchar *in, bool last);
static void sha256(Guchar *msg, int msgLen, Guchar *hash);
static void sha384(Guchar *msg, int msgLen, Guchar *hash);
@@ -67,13 +67,13 @@ static const Guchar passwordPad[32] = {
// Decrypt
//------------------------------------------------------------------------
-GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
+bool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
const GooString *ownerKey, const GooString *userKey,
const GooString *ownerEnc, const GooString *userEnc,
int permissions, const GooString *fileID,
const GooString *ownerPassword, const GooString *userPassword,
- Guchar *fileKey, GBool encryptMetadata,
- GBool *ownerPasswordOk) {
+ Guchar *fileKey, bool encryptMetadata,
+ bool *ownerPasswordOk) {
DecryptAES256State state;
Guchar test[127 + 56], test2[32];
GooString *userPassword2;
@@ -82,7 +82,7 @@ GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
Guchar fx, fy;
int len, i, j;
- *ownerPasswordOk = gFalse;
+ *ownerPasswordOk = false;
if (encRevision == 5 || encRevision == 6) {
@@ -112,18 +112,18 @@ GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
//test contains the initial SHA-256 hash input K.
revision6Hash(ownerPassword, test, userKey->getCString());
}
- aes256KeyExpansion(&state, test, 32, gTrue);
+ aes256KeyExpansion(&state, test, 32, true);
for (i = 0; i < 16; ++i) {
state.cbc[i] = 0;
}
- aes256DecryptBlock(&state, (Guchar *)ownerEnc->getCString(), gFalse);
+ aes256DecryptBlock(&state, (Guchar *)ownerEnc->getCString(), false);
memcpy(fileKey, state.buf, 16);
aes256DecryptBlock(&state, (Guchar *)ownerEnc->getCString() + 16,
- gFalse);
+ false);
memcpy(fileKey + 16, state.buf, 16);
- *ownerPasswordOk = gTrue;
- return gTrue;
+ *ownerPasswordOk = true;
+ return true;
}
}
@@ -153,21 +153,21 @@ GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
//user key is not used in computing intermediate user key.
revision6Hash(userPassword, test, nullptr);
}
- aes256KeyExpansion(&state, test, 32, gTrue);
+ aes256KeyExpansion(&state, test, 32, true);
for (i = 0; i < 16; ++i) {
state.cbc[i] = 0;
}
- aes256DecryptBlock(&state, (Guchar *)userEnc->getCString(), gFalse);
+ aes256DecryptBlock(&state, (Guchar *)userEnc->getCString(), false);
memcpy(fileKey, state.buf, 16);
aes256DecryptBlock(&state, (Guchar *)userEnc->getCString() + 16,
- gFalse);
+ false);
memcpy(fileKey + 16, state.buf, 16);
- return gTrue;
+ return true;
}
}
- return gFalse;
+ return false;
} else {
// try using the supplied owner password to generate the user password
@@ -208,9 +208,9 @@ GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
if (makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
permissions, fileID, userPassword2, fileKey,
encryptMetadata)) {
- *ownerPasswordOk = gTrue;
+ *ownerPasswordOk = true;
delete userPassword2;
- return gTrue;
+ return true;
}
delete userPassword2;
}
@@ -222,18 +222,18 @@ GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
}
}
-GBool Decrypt::makeFileKey2(int encVersion, int encRevision, int keyLength,
+bool Decrypt::makeFileKey2(int encVersion, int encRevision, int keyLength,
const GooString *ownerKey, const GooString *userKey,
int permissions, const GooString *fileID,
const GooString *userPassword, Guchar *fileKey,
- GBool encryptMetadata) {
+ bool encryptMetadata) {
Guchar *buf;
Guchar test[32];
Guchar fState[256];
Guchar tmpKey[16];
Guchar fx, fy;
int len, i, j;
- GBool ok;
+ bool ok;
// generate file key
buf = (Guchar *)gmalloc(72 + fileID->getLength());
@@ -293,7 +293,7 @@ GBool Decrypt::makeFileKey2(int encVersion, int encRevision, int keyLength,
md5(buf, 32 + fileID->getLength(), buf);
ok = memcmp(test, buf, 16) == 0;
} else {
- ok = gFalse;
+ ok = false;
}
gfree(buf);
@@ -355,7 +355,7 @@ BaseCryptStream::BaseCryptStream(Stream *strA, const Guchar *fileKey, CryptAlgor
}
charactersRead = 0;
- autoDelete = gTrue;
+ autoDelete = true;
}
BaseCryptStream::~BaseCryptStream() {
@@ -384,11 +384,11 @@ int BaseCryptStream::getChar() {
return c;
}
-GBool BaseCryptStream::isBinary(GBool last) {
+bool BaseCryptStream::isBinary(bool last) {
return str->isBinary(last);
}
-void BaseCryptStream::setAutoDelete(GBool val) {
+void BaseCryptStream::setAutoDelete(bool val) {
autoDelete = val;
}
@@ -425,16 +425,16 @@ void EncryptStream::reset() {
rc4InitKey(objKey, objKeyLength, state.rc4.state);
break;
case cryptAES:
- aesKeyExpansion(&state.aes, objKey, objKeyLength, gFalse);
+ aesKeyExpansion(&state.aes, objKey, objKeyLength, false);
memcpy(state.aes.buf, state.aes.cbc, 16); // Copy CBC IV to buf
state.aes.bufIdx = 0;
- state.aes.paddingReached = gFalse;
+ state.aes.paddingReached = false;
break;
case cryptAES256:
- aes256KeyExpansion(&state.aes256, objKey, objKeyLength, gFalse);
+ aes256KeyExpansion(&state.aes256, objKey, objKeyLength, false);
memcpy(state.aes256.buf, state.aes256.cbc, 16); // Copy CBC IV to buf
state.aes256.bufIdx = 0;
- state.aes256.paddingReached = gFalse;
+ state.aes256.paddingReached = false;
break;
case cryptNone:
break;
@@ -458,7 +458,7 @@ int EncryptStream::lookChar() {
break;
case cryptAES:
if (state.aes.bufIdx == 16 && !state.aes.paddingReached) {
- state.aes.paddingReached = !aesReadBlock(str, in, gTrue);
+ state.aes.paddingReached = !aesReadBlock(str, in, true);
aesEncryptBlock(&state.aes, in);
}
if (state.aes.bufIdx == 16) {
@@ -469,7 +469,7 @@ int EncryptStream::lookChar() {
break;
case cryptAES256:
if (state.aes256.bufIdx == 16 && !state.aes256.paddingReached) {
- state.aes256.paddingReached = !aesReadBlock(str, in, gTrue);
+ state.aes256.paddingReached = !aesReadBlock(str, in, true);
aes256EncryptBlock(&state.aes256, in);
}
if (state.aes256.bufIdx == 16) {
@@ -507,14 +507,14 @@ void DecryptStream::reset() {
rc4InitKey(objKey, objKeyLength, state.rc4.state);
break;
case cryptAES:
- aesKeyExpansion(&state.aes, objKey, objKeyLength, gTrue);
+ aesKeyExpansion(&state.aes, objKey, objKeyLength, true);
for (i = 0; i < 16; ++i) {
state.aes.cbc[i] = str->getChar();
}
state.aes.bufIdx = 16;
break;
case cryptAES256:
- aes256KeyExpansion(&state.aes256, objKey, objKeyLength, gTrue);
+ aes256KeyExpansion(&state.aes256, objKey, objKeyLength, true);
for (i = 0; i < 16; ++i) {
state.aes256.cbc[i] = str->getChar();
}
@@ -541,7 +541,7 @@ int DecryptStream::lookChar() {
break;
case cryptAES:
if (state.aes.bufIdx == 16) {
- if (aesReadBlock(str, in, gFalse)) {
+ if (aesReadBlock(str, in, false)) {
aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
}
}
@@ -553,7 +553,7 @@ int DecryptStream::lookChar() {
break;
case cryptAES256:
if (state.aes256.bufIdx == 16) {
- if (aesReadBlock(str, in, gFalse)) {
+ if (aesReadBlock(str, in, false)) {
aes256DecryptBlock(&state.aes256, in, str->lookChar() == EOF);
}
}
@@ -610,8 +610,8 @@ static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
// AES decryption
//------------------------------------------------------------------------
-// Returns gFalse if EOF was reached, gTrue otherwise
-static GBool aesReadBlock(Stream *str, Guchar *in, GBool addPadding)
+// Returns false if EOF was reached, true otherwise
+static bool aesReadBlock(Stream *str, Guchar *in, bool addPadding)
{
int c, i;
@@ -624,7 +624,7 @@ static GBool aesReadBlock(Stream *str, Guchar *in, GBool addPadding)
}
if (i == 16) {
- return gTrue;
+ return true;
} else {
if (addPadding) {
c = 16 - i;
@@ -632,7 +632,7 @@ static GBool aesReadBlock(Stream *str, Guchar *in, GBool addPadding)
in[i++] = (Guchar)c;
}
}
- return gFalse;
+ return false;
}
}
@@ -872,7 +872,7 @@ static inline void addRoundKey(Guchar *state, Guint *w) {
}
static void aesKeyExpansion(DecryptAESState *s,
- Guchar *objKey, int /*objKeyLen*/, GBool decrypt) {
+ Guchar *objKey, int /*objKeyLen*/, bool decrypt) {
Guint temp;
int i, round;
@@ -935,7 +935,7 @@ static void aesEncryptBlock(DecryptAESState *s, Guchar *in) {
s->bufIdx = 0;
}
-static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last) {
+static void aesDecryptBlock(DecryptAESState *s, Guchar *in, bool last) {
int c, round, n, i;
// initial state
@@ -994,7 +994,7 @@ static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last) {
//------------------------------------------------------------------------
static void aes256KeyExpansion(DecryptAES256State *s,
- Guchar *objKey, int objKeyLen, GBool decrypt) {
+ Guchar *objKey, int objKeyLen, bool decrypt) {
Guint temp;
int i, round;
@@ -1059,7 +1059,7 @@ static void aes256EncryptBlock(DecryptAES256State *s, Guchar *in) {
s->bufIdx = 0;
}
-static void aes256DecryptBlock(DecryptAES256State *s, Guchar *in, GBool last) {
+static void aes256DecryptBlock(DecryptAES256State *s, Guchar *in, bool last) {
int c, round, n, i;
// initial state
@@ -1728,8 +1728,8 @@ static void revision6Hash(const GooString *inputPassword, Guchar *K, const char
memcpy(state.cbc,K + 16,16);
memcpy(state.buf, state.cbc, 16); // Copy CBC IV to buf
state.bufIdx = 0;
- state.paddingReached = gFalse;
- aesKeyExpansion(&state,aesKey,16,gFalse);
+ state.paddingReached = false;
+ aesKeyExpansion(&state,aesKey,16,false);
for(int i = 0; i < (4 * sequenceLength); i++) {
aesEncryptBlock(&state,K1 + (16 * i));
diff --git a/poppler/Decrypt.h b/poppler/Decrypt.h
index a92859c4..c974d0a9 100644
--- a/poppler/Decrypt.h
+++ b/poppler/Decrypt.h
@@ -45,21 +45,21 @@ public:
// and returns true if either is correct. Sets <ownerPasswordOk> if
// the owner password was correct. Either or both of the passwords
// may be NULL, which is treated as an empty string.
- static GBool makeFileKey(int encVersion, int encRevision, int keyLength,
+ static bool makeFileKey(int encVersion, int encRevision, int keyLength,
const GooString *ownerKey, const GooString *userKey,
const GooString *ownerEnc, const GooString *userEnc,
int permissions, const GooString *fileID,
const GooString *ownerPassword, const GooString *userPassword,
- Guchar *fileKey, GBool encryptMetadata,
- GBool *ownerPasswordOk);
+ Guchar *fileKey, bool encryptMetadata,
+ bool *ownerPasswordOk);
private:
- static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
+ static bool makeFileKey2(int encVersion, int encRevision, int keyLength,
const GooString *ownerKey, const GooString *userKey,
int permissions, const GooString *fileID,
const GooString *userPassword, Guchar *fileKey,
- GBool encryptMetadata);
+ bool encryptMetadata);
};
//------------------------------------------------------------------------
@@ -83,7 +83,7 @@ struct DecryptAESState {
Guchar state[16];
Guchar cbc[16];
Guchar buf[16];
- GBool paddingReached; // encryption only
+ bool paddingReached; // encryption only
int bufIdx;
};
@@ -92,7 +92,7 @@ struct DecryptAES256State {
Guchar state[16];
Guchar cbc[16];
Guchar buf[16];
- GBool paddingReached; // encryption only
+ bool paddingReached; // encryption only
int bufIdx;
};
@@ -107,9 +107,9 @@ public:
int getChar() override;
int lookChar() override = 0;
Goffset getPos() override;
- GBool isBinary(GBool last) override;
+ bool isBinary(bool last) override;
Stream *getUndecodedStream() override { return this; }
- void setAutoDelete(GBool val);
+ void setAutoDelete(bool val);
protected:
CryptAlgorithm algo;
@@ -117,7 +117,7 @@ protected:
Guchar objKey[32];
Goffset charactersRead; // so that getPos() can be correct
int nextCharBuff; // EOF means not read yet
- GBool autoDelete;
+ bool autoDelete;
union {
DecryptRC4State rc4;
diff --git a/poppler/Dict.cc b/poppler/Dict.cc
index 9f3f9f43..768d70b1 100644
--- a/poppler/Dict.cc
+++ b/poppler/Dict.cc
@@ -154,11 +154,11 @@ void Dict::set(const char *key, Object &&val) {
}
-GBool Dict::is(const char *type) const {
+bool Dict::is(const char *type) const {
if (const auto *entry = find("Type")) {
return entry->second.isName(type);
}
- return gFalse;
+ return false;
}
Object Dict::lookup(const char *key, int recursion) const {
@@ -175,7 +175,7 @@ Object Dict::lookupNF(const char *key) const {
return Object(objNull);
}
-GBool Dict::lookupInt(const char *key, const char *alt_key, int *value) const
+bool Dict::lookupInt(const char *key, const char *alt_key, int *value) const
{
auto obj1 = lookup(key);
if (obj1.isNull() && alt_key != nullptr) {
@@ -183,11 +183,11 @@ GBool Dict::lookupInt(const char *key, const char *alt_key, int *value) const
}
if (obj1.isInt()) {
*value = obj1.getInt();
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
-GBool Dict::hasKey(const char *key) const {
+bool Dict::hasKey(const char *key) const {
return find(key) != nullptr;
}
diff --git a/poppler/Dict.h b/poppler/Dict.h
index 893f3981..bdb08cd7 100644
--- a/poppler/Dict.h
+++ b/poppler/Dict.h
@@ -71,13 +71,13 @@ public:
void remove(const char *key);
// Check if dictionary is of specified type.
- GBool is(const char *type) const;
+ bool is(const char *type) const;
// Look up an entry and return the value. Returns a null object
// if <key> is not in the dictionary.
Object lookup(const char *key, int recursion = 0) const;
Object lookupNF(const char *key) const;
- GBool lookupInt(const char *key, const char *alt_key, int *value) const;
+ bool lookupInt(const char *key, const char *alt_key, int *value) const;
// Iterative accessors.
const char *getKey(int i) const { return entries[i].first.c_str(); }
@@ -91,7 +91,7 @@ public:
XRef *getXRef() const { return xref; }
- GBool hasKey(const char *key) const;
+ bool hasKey(const char *key) const;
private:
friend class Object; // for incRef/decRef
diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index 2628c363..7479c2d2 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -78,31 +78,31 @@ EmbFile::~EmbFile()
delete m_mimetype;
}
-GBool EmbFile::save(const char *path) {
+bool EmbFile::save(const char *path) {
FILE *f;
- GBool ret;
+ bool ret;
if (!(f = fopen(path, "wb"))) {
- return gFalse;
+ return false;
}
ret = save2(f);
fclose(f);
return ret;
}
-GBool EmbFile::save2(FILE *f) {
+bool EmbFile::save2(FILE *f) {
int c;
m_objStr.streamReset();
while ((c = m_objStr.streamGetChar()) != EOF) {
fputc(c, f);
}
- return gTrue;
+ return true;
}
FileSpec::FileSpec(const Object *fileSpecA)
{
- ok = gTrue;
+ ok = true;
fileName = nullptr;
platformFileName = nullptr;
embFile = nullptr;
@@ -111,7 +111,7 @@ FileSpec::FileSpec(const Object *fileSpecA)
Object obj1 = getFileSpecName(fileSpecA);
if (!obj1.isString()) {
- ok = gFalse;
+ ok = false;
error(errSyntaxError, -1, "Invalid FileSpec");
return;
}
@@ -123,7 +123,7 @@ FileSpec::FileSpec(const Object *fileSpecA)
if (obj1.isDict()) {
fileStream = obj1.dictLookupNF("F");
if (!fileStream.isRef()) {
- ok = gFalse;
+ ok = false;
fileStream.setToNull();
error(errSyntaxError, -1, "Invalid FileSpec: Embedded file stream is not an indirect reference");
return;
diff --git a/poppler/FileSpec.h b/poppler/FileSpec.h
index d156c884..58c9e481 100644
--- a/poppler/FileSpec.h
+++ b/poppler/FileSpec.h
@@ -33,11 +33,11 @@ public:
const GooString *mimeType() const { return m_mimetype; }
Object *streamObject() { return &m_objStr; }
Stream *stream() { return isOk() ? m_objStr.getStream() : nullptr; }
- GBool isOk() const { return m_objStr.isStream(); }
- GBool save(const char *path);
+ bool isOk() const { return m_objStr.isStream(); }
+ bool save(const char *path);
private:
- GBool save2(FILE *f);
+ bool save2(FILE *f);
int m_size;
GooString *m_createDate;
@@ -55,7 +55,7 @@ public:
FileSpec(const FileSpec &) = delete;
FileSpec& operator=(const FileSpec &) = delete;
- GBool isOk() const { return ok; }
+ bool isOk() const { return ok; }
const GooString *getFileName() const { return fileName; }
GooString *getFileNameForPlatform();
@@ -63,7 +63,7 @@ public:
EmbFile *getEmbeddedFile();
private:
- GBool ok;
+ bool ok;
Object fileSpec;
diff --git a/poppler/FlateEncoder.cc b/poppler/FlateEncoder.cc
index a0a7c45b..bd4b36dd 100644
--- a/poppler/FlateEncoder.cc
+++ b/poppler/FlateEncoder.cc
@@ -23,7 +23,7 @@ FlateEncoder::FlateEncoder(Stream *strA):
int zlib_status;
outBufPtr = outBufEnd = outBuf;
- inBufEof = outBufEof = gFalse;
+ inBufEof = outBufEof = false;
zlib_stream.zalloc = Z_NULL;
zlib_stream.zfree = Z_NULL;
@@ -32,7 +32,7 @@ FlateEncoder::FlateEncoder(Stream *strA):
zlib_status = deflateInit(&zlib_stream, Z_DEFAULT_COMPRESSION);
if (zlib_status != Z_OK) {
- inBufEof = outBufEof = gTrue;
+ inBufEof = outBufEof = true;
error(errInternal, -1, "Internal: deflateInit() failed in FlateEncoder::FlateEncoder()");
}
@@ -53,14 +53,14 @@ void FlateEncoder::reset() {
str->reset();
outBufPtr = outBufEnd = outBuf;
- inBufEof = outBufEof = gFalse;
+ inBufEof = outBufEof = false;
deflateEnd(&zlib_stream);
zlib_status = deflateInit(&zlib_stream, Z_DEFAULT_COMPRESSION);
if (zlib_status != Z_OK) {
- inBufEof = outBufEof = gTrue;
+ inBufEof = outBufEof = true;
error(errInternal, -1, "Internal: deflateInit() failed in FlateEncoder::reset()");
}
@@ -68,7 +68,7 @@ void FlateEncoder::reset() {
zlib_stream.avail_out = 1; /* anything but 0 to trigger a read */
}
-GBool FlateEncoder::fillBuf() {
+bool FlateEncoder::fillBuf() {
int n;
unsigned int starting_avail_out;
int zlib_status;
@@ -76,7 +76,7 @@ GBool FlateEncoder::fillBuf() {
/* If the output is done, don't try to read more. */
if (outBufEof) {
- return gFalse;
+ return false;
}
/* The output buffer should be empty. */
@@ -108,7 +108,7 @@ GBool FlateEncoder::fillBuf() {
n = (inBufEof? 0: str->doGetChars(inBufSize, inBuf));
if (n == 0) {
- inBufEof = gTrue;
+ inBufEof = true;
}
zlib_stream.next_in = inBuf;
@@ -126,9 +126,9 @@ GBool FlateEncoder::fillBuf() {
if (zlib_status == Z_STREAM_ERROR ||
zlib_stream.avail_out > starting_avail_out) {
/* Unrecoverable error */
- inBufEof = outBufEof = gTrue;
+ inBufEof = outBufEof = true;
error(errInternal, -1, "Internal: deflate() failed in FlateEncoder::fillBuf()");
- return gFalse;
+ return false;
}
} while (zlib_stream.avail_out == outBufSize && !inBufEof);
@@ -136,7 +136,7 @@ GBool FlateEncoder::fillBuf() {
outBufEnd = &outBuf[ outBufSize ] - zlib_stream.avail_out;
if (inBufEof && zlib_stream.avail_out != 0) {
- outBufEof = gTrue;
+ outBufEof = true;
}
return outBufPtr < outBufEnd;
diff --git a/poppler/FlateEncoder.h b/poppler/FlateEncoder.h
index 69053c9c..b9d6e509 100644
--- a/poppler/FlateEncoder.h
+++ b/poppler/FlateEncoder.h
@@ -49,8 +49,8 @@ public:
int lookChar() override
{ return (outBufPtr >= outBufEnd && !fillBuf()) ? EOF : (*outBufPtr & 0xff); }
GooString *getPSFilter(int psLevel, const char *indent) override { return nullptr; }
- GBool isBinary(GBool last = gTrue) override { return gTrue; }
- GBool isEncoder() override { return gTrue; }
+ bool isBinary(bool last = true) override { return true; }
+ bool isEncoder() override { return true; }
private:
@@ -60,11 +60,11 @@ private:
Guchar outBuf[ outBufSize ];
Guchar *outBufPtr;
Guchar *outBufEnd;
- GBool inBufEof;
- GBool outBufEof;
+ bool inBufEof;
+ bool outBufEof;
z_stream zlib_stream;
- GBool fillBuf();
+ bool fillBuf();
};
#endif
diff --git a/poppler/FlateStream.cc b/poppler/FlateStream.cc
index e861acb8..dca20d63 100644
--- a/poppler/FlateStream.cc
+++ b/poppler/FlateStream.cc
@@ -133,8 +133,8 @@ GooString *FlateStream::getPSFilter(int psLevel, const char *indent) {
return s;
}
-GBool FlateStream::isBinary(GBool last) {
- return str->isBinary(gTrue);
+bool FlateStream::isBinary(bool last) {
+ return str->isBinary(true);
}
#endif
diff --git a/poppler/FlateStream.h b/poppler/FlateStream.h
index 117196ec..c8ab0763 100644
--- a/poppler/FlateStream.h
+++ b/poppler/FlateStream.h
@@ -44,7 +44,7 @@ public:
virtual int getRawChar() override;
virtual void getRawChars(int nChars, int *buffer) override;
virtual GooString *getPSFilter(int psLevel, const char *indent) override;
- virtual GBool isBinary(GBool last = gTrue) override;
+ virtual bool isBinary(bool last = true) override;
private:
inline int doGetRawChar() {
diff --git a/poppler/FontInfo.cc b/poppler/FontInfo.cc
index a3884b07..e64fa158 100644
--- a/poppler/FontInfo.cc
+++ b/poppler/FontInfo.cc
@@ -172,7 +172,7 @@ FontInfo::FontInfo(GfxFont *font, XRef *xref) {
// check for an embedded font
if (font->getType() == fontType3) {
- emb = gTrue;
+ emb = true;
} else {
emb = font->getEmbeddedFontID(&embRef);
}
@@ -191,7 +191,7 @@ FontInfo::FontInfo(GfxFont *font, XRef *xref) {
encoding = font->getEncodingName()->copy();
// look for a ToUnicode map
- hasToUnicode = gFalse;
+ hasToUnicode = false;
Object fontObj = xref->fetch(fontRef.num, fontRef.gen);
if (fontObj.isDict()) {
hasToUnicode = fontObj.dictLookup("ToUnicode").isStream();
@@ -199,7 +199,7 @@ FontInfo::FontInfo(GfxFont *font, XRef *xref) {
// check for a font subset name: capital letters followed by a '+'
// sign
- subset = gFalse;
+ subset = false;
if (name) {
int i;
for (i = 0; i < name->getLength(); ++i) {
diff --git a/poppler/FontInfo.h b/poppler/FontInfo.h
index f6501466..48eaefd6 100644
--- a/poppler/FontInfo.h
+++ b/poppler/FontInfo.h
@@ -63,9 +63,9 @@ public:
GooString *getFile() { return file; };
GooString *getEncoding() { return encoding; };
Type getType() { return type; };
- GBool getEmbedded() { return emb; };
- GBool getSubset() { return subset; };
- GBool getToUnicode() { return hasToUnicode; };
+ bool getEmbedded() { return emb; };
+ bool getSubset() { return subset; };
+ bool getToUnicode() { return hasToUnicode; };
Ref getRef() { return fontRef; };
Ref getEmbRef() { return embRef; };
@@ -75,9 +75,9 @@ private:
GooString *file;
GooString *encoding;
Type type;
- GBool emb;
- GBool subset;
- GBool hasToUnicode;
+ bool emb;
+ bool subset;
+ bool hasToUnicode;
Ref fontRef;
Ref embRef;
};
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 808e59f9..50ed0120 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -115,8 +115,8 @@ void FormWidget::createWidgetAnnotation() {
widget = new AnnotWidget(doc, &obj, &obj1, field);
}
-GBool FormWidget::inRect(double x, double y) const {
- return widget ? widget->inRect(x, y) : gFalse;
+bool FormWidget::inRect(double x, double y) const {
+ return widget ? widget->inRect(x, y) : false;
}
void FormWidget::getRect(double *x1, double *y1, double *x2, double *y2) const {
@@ -228,7 +228,7 @@ void FormWidgetButton::updateWidgetAppearance()
// The appearance stream must NOT be regenerated for this widget type
}
-void FormWidgetButton::setState (GBool astate)
+void FormWidgetButton::setState (bool astate)
{
//pushButtons don't have state
if (parent()->getButtonType() == formButtonPush)
@@ -242,9 +242,9 @@ void FormWidgetButton::setState (GBool astate)
// Parent will call setAppearanceState()
}
-GBool FormWidgetButton::getState () const
+bool FormWidgetButton::getState () const
{
- return onStr ? parent()->getState(onStr->getCString()) : gFalse;
+ return onStr ? parent()->getState(onStr->getCString()) : false;
}
FormFieldButton *FormWidgetButton::parent() const
@@ -624,7 +624,7 @@ FormField::FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField *par
defaultAppearance = nullptr;
fullyQualifiedName = nullptr;
quadding = quaddingLeftJustified;
- hasQuadding = gFalse;
+ hasQuadding = false;
ref = aref;
@@ -707,7 +707,7 @@ FormField::FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField *par
obj1 = Form::fieldLookup(dict, "Q");
if (obj1.isInt()) {
quadding = static_cast<VariableTextQuadding>(obj1.getInt());
- hasQuadding = gTrue;
+ hasQuadding = true;
}
obj1 = dict->lookup("T");
@@ -846,7 +846,7 @@ GooString* FormField::getFullyQualifiedName() {
Object parent;
const GooString *parent_name;
GooString *full_name;
- GBool unicode_encoded = gFalse;
+ bool unicode_encoded = false;
if (fullyQualifiedName)
return fullyQualifiedName;
@@ -872,7 +872,7 @@ GooString* FormField::getFullyQualifiedName() {
} else {
full_name->insert(0, '.'); // 1-byte ascii period
if (parent_name->hasUnicodeMarker()) {
- unicode_encoded = gTrue;
+ unicode_encoded = true;
full_name = convertToUtf16(full_name);
full_name->insert(0, parent_name->getCString() + 2, parent_name->getLength() - 2); // Remove the unicode BOM
} else {
@@ -895,7 +895,7 @@ GooString* FormField::getFullyQualifiedName() {
}
} else {
if (partialName->hasUnicodeMarker()) {
- unicode_encoded = gTrue;
+ unicode_encoded = true;
full_name = convertToUtf16(full_name);
full_name->append(partialName->getCString() + 2, partialName->getLength() - 2); // Remove the unicode BOM
} else {
@@ -1051,28 +1051,28 @@ void FormFieldButton::fillChildrenSiblingsID()
}
}
-GBool FormFieldButton::setState(const char *state)
+bool FormFieldButton::setState(const char *state)
{
// A check button could behave as a radio button
// when it's in a set of more than 1 buttons
if (btype != formButtonRadio && btype != formButtonCheck)
- return gFalse;
+ return false;
if (terminal && parent && parent->getType() == formButton && appearanceState.isNull()) {
// It's button in a set, set state on parent
if (static_cast<FormFieldButton*>(parent)->setState(state)) {
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
- GBool isOn = strcmp(state, "Off") != 0;
+ bool isOn = strcmp(state, "Off") != 0;
if (!isOn && noAllOff)
- return gFalse; // Don't allow to set all radio to off
+ return false; // Don't allow to set all radio to off
const char *current = getAppearanceState();
- GBool currentFound = gFalse, newFound = gFalse;
+ bool currentFound = false, newFound = false;
for (int i = 0; i < numChildren; i++) {
FormWidgetButton *widget;
@@ -1093,12 +1093,12 @@ GBool FormFieldButton::setState(const char *state)
widget->setAppearanceState("Off");
if (!isOn)
break;
- currentFound = gTrue;
+ currentFound = true;
}
if (isOn && strcmp(state, onStr) == 0) {
widget->setAppearanceState(state);
- newFound = gTrue;
+ newFound = true;
}
if (currentFound && newFound)
@@ -1107,14 +1107,14 @@ GBool FormFieldButton::setState(const char *state)
updateState(state);
- return gTrue;
+ return true;
}
-GBool FormFieldButton::getState(const char *state) const {
+bool FormFieldButton::getState(const char *state) const {
if (appearanceState.isName(state))
- return gTrue;
+ return true;
- return (parent && parent->getType() == formButton) ? static_cast<FormFieldButton*>(parent)->getState(state) : gFalse;
+ return (parent && parent->getType() == formButton) ? static_cast<FormFieldButton*>(parent)->getState(state) : false;
}
void FormFieldButton::updateState(const char *state) {
@@ -1378,16 +1378,16 @@ FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, For
// seems to expect the exportVal instead of the optionName and so we do too.
obj1 = Form::fieldLookup(dict, "V");
if (obj1.isString()) {
- GBool optionFound = gFalse;
+ bool optionFound = false;
for (int i = 0; i < numChoices; i++) {
if (choices[i].exportVal) {
if (choices[i].exportVal->cmp(obj1.getString()) == 0) {
- optionFound = gTrue;
+ optionFound = true;
}
} else if (choices[i].optionName) {
if (choices[i].optionName->cmp(obj1.getString()) == 0) {
- optionFound = gTrue;
+ optionFound = true;
}
}
@@ -1405,15 +1405,15 @@ FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, For
for (int i = 0; i < numChoices; i++) {
for (int j = 0; j < obj1.arrayGetLength(); j++) {
Object obj2 = obj1.arrayGet(j);
- GBool matches = gFalse;
+ bool matches = false;
if (choices[i].exportVal) {
if (choices[i].exportVal->cmp(obj2.getString()) == 0) {
- matches = gTrue;
+ matches = true;
}
} else if (choices[i].optionName) {
if (choices[i].optionName->cmp(obj2.getString()) == 0) {
- matches = gTrue;
+ matches = true;
}
}
diff --git a/poppler/Form.h b/poppler/Form.h
index 76af74d3..43f07164 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -89,7 +89,7 @@ public:
virtual ~FormWidget();
// Check if point is inside the field bounding rect
- GBool inRect(double x, double y) const;
+ bool inRect(double x, double y) const;
// Get the field bounding rect
void getRect(double *x1, double *y1, double *x2, double *y2) const;
@@ -112,7 +112,7 @@ public:
const GooString *getMappingName() const;
GooString *getFullyQualifiedName();
- GBool isModified () const;
+ bool isModified () const;
bool isReadOnly() const;
void setReadOnly(bool value);
@@ -168,8 +168,8 @@ public:
FormButtonType getButtonType() const;
- void setState (GBool state);
- GBool getState () const;
+ void setState (bool state);
+ bool getState () const;
const char* getOnStr() const;
void setAppearanceState(const char *state);
@@ -300,7 +300,7 @@ public:
bool isReadOnly () const { return readOnly; }
GooString* getDefaultAppearance() const { return defaultAppearance; }
- GBool hasTextQuadding() const { return hasQuadding; }
+ bool hasTextQuadding() const { return hasQuadding; }
VariableTextQuadding getTextQuadding() const { return quadding; }
const GooString *getPartialName() const { return partialName; }
@@ -345,7 +345,7 @@ public:
// Variable Text
GooString *defaultAppearance;
- GBool hasQuadding;
+ bool hasQuadding;
VariableTextQuadding quadding;
private:
@@ -365,9 +365,9 @@ public:
bool noToggleToOff () const { return noAllOff; }
- // returns gTrue if the state modification is accepted
- GBool setState (const char *state);
- GBool getState(const char *state) const;
+ // returns true if the state modification is accepted
+ bool setState (const char *state);
+ bool getState(const char *state) const;
const char *getAppearanceState() const { return appearanceState.isName() ? appearanceState.getName() : nullptr; }
@@ -560,7 +560,7 @@ public:
static FormField *createFieldFromDict (Object* obj, PDFDoc *docA, const Ref& aref, FormField *parent, std::set<int> *usedParents);
Object *getObj () const { return acroForm; }
- GBool getNeedAppearances () const { return needAppearances; }
+ bool getNeedAppearances () const { return needAppearances; }
int getNumFields() const { return numFields; }
FormField* getRootField(int i) const { return rootFields[i]; }
const GooString* getDefaultAppearance() const { return defaultAppearance; }
@@ -581,7 +581,7 @@ private:
PDFDoc *doc;
XRef* xref;
Object *acroForm;
- GBool needAppearances;
+ bool needAppearances;
GfxResources *defaultResources;
Object resDict;
std::vector<Ref> calculateOrder;
diff --git a/poppler/Function.cc b/poppler/Function.cc
index b8f5fdc7..c70c32d2 100644
--- a/poppler/Function.cc
+++ b/poppler/Function.cc
@@ -112,7 +112,7 @@ Function::Function(const Function *func) {
hasRange = func->hasRange;
}
-GBool Function::init(Dict *dict) {
+bool Function::init(Dict *dict) {
Object obj1;
int i;
@@ -120,58 +120,58 @@ GBool Function::init(Dict *dict) {
obj1 = dict->lookup("Domain");
if (!obj1.isArray()) {
error(errSyntaxError, -1, "Function is missing domain");
- return gFalse;
+ return false;
}
m = obj1.arrayGetLength() / 2;
if (m > funcMaxInputs) {
error(errSyntaxError, -1, "Functions with more than {0:d} inputs are unsupported",
funcMaxInputs);
- return gFalse;
+ return false;
}
for (i = 0; i < m; ++i) {
Object obj2 = obj1.arrayGet(2*i);
if (!obj2.isNum()) {
error(errSyntaxError, -1, "Illegal value in function domain array");
- return gFalse;
+ return false;
}
domain[i][0] = obj2.getNum();
obj2 = obj1.arrayGet(2*i+1);
if (!obj2.isNum()) {
error(errSyntaxError, -1, "Illegal value in function domain array");
- return gFalse;
+ return false;
}
domain[i][1] = obj2.getNum();
}
//----- Range
- hasRange = gFalse;
+ hasRange = false;
n = 0;
obj1 = dict->lookup("Range");
if (obj1.isArray()) {
- hasRange = gTrue;
+ hasRange = true;
n = obj1.arrayGetLength() / 2;
if (n > funcMaxOutputs) {
error(errSyntaxError, -1, "Functions with more than {0:d} outputs are unsupported",
funcMaxOutputs);
- return gFalse;
+ return false;
}
for (i = 0; i < n; ++i) {
Object obj2 = obj1.arrayGet(2*i);
if (!obj2.isNum()) {
error(errSyntaxError, -1, "Illegal value in function range array");
- return gFalse;
+ return false;
}
range[i][0] = obj2.getNum();
obj2 = obj1.arrayGet(2*i+1);
if (!obj2.isNum()) {
error(errSyntaxError, -1, "Illegal value in function range array");
- return gFalse;
+ return false;
}
range[i][1] = obj2.getNum();
}
}
- return gTrue;
+ return true;
}
//------------------------------------------------------------------------
@@ -189,7 +189,7 @@ IdentityFunction::IdentityFunction() {
domain[i][0] = 0;
domain[i][1] = 1;
}
- hasRange = gFalse;
+ hasRange = false;
}
IdentityFunction::~IdentityFunction() {
@@ -221,7 +221,7 @@ SampledFunction::SampledFunction(Object *funcObj, Dict *dict) {
idxOffset = nullptr;
samples = nullptr;
sBuf = nullptr;
- ok = gFalse;
+ ok = false;
//----- initialize the generic stuff
if (!init(dict)) {
@@ -397,7 +397,7 @@ SampledFunction::SampledFunction(Object *funcObj, Dict *dict) {
}
transform(in, cacheOut);
- ok = gTrue;
+ ok = true;
}
SampledFunction::~SampledFunction() {
@@ -518,18 +518,18 @@ void SampledFunction::transform(const double *in, double *out) const {
}
}
-GBool SampledFunction::hasDifferentResultSet(const Function *func) const {
+bool SampledFunction::hasDifferentResultSet(const Function *func) const {
if (func->getType() == 0) {
SampledFunction *compTo = (SampledFunction *) func;
if (compTo->getSampleNumber() != nSamples)
- return gTrue;
+ return true;
const double *compSamples = compTo->getSamples();
for (int i = 0; i < nSamples; i++) {
if (samples[i] != compSamples[i])
- return gTrue;
+ return true;
}
}
- return gFalse;
+ return false;
}
//------------------------------------------------------------------------
@@ -539,7 +539,7 @@ GBool SampledFunction::hasDifferentResultSet(const Function *func) const {
ExponentialFunction::ExponentialFunction(Object *funcObj, Dict *dict) {
Object obj1;
- ok = gFalse;
+ ok = false;
//----- initialize the generic stuff
if (!init(dict)) {
@@ -611,7 +611,7 @@ ExponentialFunction::ExponentialFunction(Object *funcObj, Dict *dict) {
e = obj1.getNum();
isLinear = fabs(e-1.) < 1e-10;
- ok = gTrue;
+ ok = true;
}
ExponentialFunction::~ExponentialFunction() {
@@ -658,7 +658,7 @@ StitchingFunction::StitchingFunction(Object *funcObj, Dict *dict, std::set<int>
Object obj1;
int i;
- ok = gFalse;
+ ok = false;
funcs = nullptr;
bounds = nullptr;
encode = nullptr;
@@ -754,7 +754,7 @@ StitchingFunction::StitchingFunction(Object *funcObj, Dict *dict, std::set<int>
}
n = funcs[0]->getOutputSize();
- ok = gTrue;
+ ok = true;
return;
}
@@ -945,7 +945,7 @@ enum PSObjectType {
struct PSObject {
PSObjectType type;
union {
- GBool booln; // boolean (stack only)
+ bool booln; // boolean (stack only)
int intg; // integer (stack and code)
double real; // real (stack and code)
PSOp op; // operator (code only)
@@ -960,7 +960,7 @@ public:
PSStack() {sp = psStackSize; }
void clear() { sp = psStackSize; }
- void pushBool(GBool booln)
+ void pushBool(bool booln)
{
if (checkOverflow()) {
stack[--sp].type = psBool;
@@ -981,12 +981,12 @@ public:
stack[sp].real = real;
}
}
- GBool popBool()
+ bool popBool()
{
if (checkUnderflow() && checkType(psBool, psBool)) {
return stack[sp++].booln;
}
- return gFalse;
+ return false;
}
int popInt()
{
@@ -1006,14 +1006,14 @@ public:
}
return 0;
}
- GBool empty() { return sp == psStackSize; }
- GBool topIsInt() { return sp < psStackSize && stack[sp].type == psInt; }
- GBool topTwoAreInts()
+ bool empty() { return sp == psStackSize; }
+ bool topIsInt() { return sp < psStackSize && stack[sp].type == psInt; }
+ bool topTwoAreInts()
{ return sp < psStackSize - 1 &&
stack[sp].type == psInt &&
stack[sp+1].type == psInt; }
- GBool topIsReal() { return sp < psStackSize && stack[sp].type == psReal; }
- GBool topTwoAreNums()
+ bool topIsReal() { return sp < psStackSize && stack[sp].type == psReal; }
+ bool topTwoAreNums()
{ return sp < psStackSize - 1 &&
(stack[sp].type == psInt || stack[sp].type == psReal) &&
(stack[sp+1].type == psInt || stack[sp+1].type == psReal); }
@@ -1045,29 +1045,29 @@ public:
private:
- GBool checkOverflow(int n = 1)
+ bool checkOverflow(int n = 1)
{
if (sp - n < 0) {
error(errSyntaxError, -1, "Stack overflow in PostScript function");
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
- GBool checkUnderflow()
+ bool checkUnderflow()
{
if (sp == psStackSize) {
error(errSyntaxError, -1, "Stack underflow in PostScript function");
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
- GBool checkType(PSObjectType t1, PSObjectType t2)
+ bool checkType(PSObjectType t1, PSObjectType t2)
{
if (stack[sp].type != t1 && stack[sp].type != t2) {
error(errSyntaxError, -1, "Type mismatch in PostScript function");
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
PSObject stack[psStackSize];
int sp;
@@ -1142,7 +1142,7 @@ PostScriptFunction::PostScriptFunction(Object *funcObj, Dict *dict) {
code = nullptr;
codeString = nullptr;
codeSize = 0;
- ok = gFalse;
+ ok = false;
//----- initialize the generic stuff
if (!init(dict)) {
@@ -1184,7 +1184,7 @@ PostScriptFunction::PostScriptFunction(Object *funcObj, Dict *dict) {
}
transform(in, cacheOut);
- ok = gTrue;
+ ok = true;
err2:
str->close();
@@ -1257,23 +1257,23 @@ void PostScriptFunction::transform(const double *in, double *out) const {
}
}
-GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
+bool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
GooString *tok;
- GBool isReal;
+ bool isReal;
int opPtr, elsePtr;
int a, b, mid, cmp;
while (1) {
if (!(tok = getToken(str))) {
error(errSyntaxError, -1, "Unexpected end of PostScript function stream");
- return gFalse;
+ return false;
}
const char *p = tok->getCString();
if (isdigit(*p) || *p == '.' || *p == '-') {
- isReal = gFalse;
+ isReal = false;
for (; *p; ++p) {
if (*p == '.') {
- isReal = gTrue;
+ isReal = true;
break;
}
}
@@ -1293,22 +1293,22 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
*codePtr += 3;
resizeCode(opPtr + 2);
if (!parseCode(str, codePtr)) {
- return gFalse;
+ return false;
}
if (!(tok = getToken(str))) {
error(errSyntaxError, -1, "Unexpected end of PostScript function stream");
- return gFalse;
+ return false;
}
if (!tok->cmp("{")) {
elsePtr = *codePtr;
if (!parseCode(str, codePtr)) {
delete tok;
- return gFalse;
+ return false;
}
delete tok;
if (!(tok = getToken(str))) {
error(errSyntaxError, -1, "Unexpected end of PostScript function stream");
- return gFalse;
+ return false;
}
} else {
elsePtr = -1;
@@ -1317,7 +1317,7 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
if (elsePtr >= 0) {
error(errSyntaxError, -1,
"Got 'if' operator with two blocks in PostScript function");
- return gFalse;
+ return false;
}
code[opPtr].type = psOperator;
code[opPtr].op = psOpIf;
@@ -1327,7 +1327,7 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
if (elsePtr < 0) {
error(errSyntaxError, -1,
"Got 'ifelse' operator with one block in PostScript function");
- return gFalse;
+ return false;
}
code[opPtr].type = psOperator;
code[opPtr].op = psOpIfelse;
@@ -1339,7 +1339,7 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
error(errSyntaxError, -1,
"Expected if/ifelse operator in PostScript function");
delete tok;
- return gFalse;
+ return false;
}
delete tok;
} else if (!tok->cmp("}")) {
@@ -1370,7 +1370,7 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
"Unknown operator '{0:t}' in PostScript function",
tok);
delete tok;
- return gFalse;
+ return false;
}
delete tok;
resizeCode(*codePtr);
@@ -1379,16 +1379,16 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
++*codePtr;
}
}
- return gTrue;
+ return true;
}
GooString *PostScriptFunction::getToken(Stream *str) {
GooString *s;
int c;
- GBool comment;
+ bool comment;
s = new GooString();
- comment = gFalse;
+ comment = false;
while (1) {
if ((c = str->getChar()) == EOF) {
break;
@@ -1396,10 +1396,10 @@ GooString *PostScriptFunction::getToken(Stream *str) {
codeString->append(c);
if (comment) {
if (c == '\x0a' || c == '\x0d') {
- comment = gFalse;
+ comment = false;
}
} else if (c == '%') {
- comment = gTrue;
+ comment = true;
} else if (!isspace(c)) {
break;
}
@@ -1440,7 +1440,7 @@ void PostScriptFunction::resizeCode(int newSize) {
void PostScriptFunction::exec(PSStack *stack, int codePtr) const {
int i1, i2;
double r1, r2, result;
- GBool b1, b2;
+ bool b1, b2;
while (1) {
switch (code[codePtr].type) {
@@ -1552,7 +1552,7 @@ void PostScriptFunction::exec(PSStack *stack, int codePtr) const {
stack->pushReal(pow(r1, r2));
break;
case psOpFalse:
- stack->pushBool(gFalse);
+ stack->pushBool(false);
break;
case psOpFloor:
if (!stack->topIsInt()) {
@@ -1710,7 +1710,7 @@ void PostScriptFunction::exec(PSStack *stack, int codePtr) const {
}
break;
case psOpTrue:
- stack->pushBool(gTrue);
+ stack->pushBool(true);
break;
case psOpTruncate:
if (!stack->topIsInt()) {
diff --git a/poppler/Function.h b/poppler/Function.h
index 87480dcc..16d91401 100644
--- a/poppler/Function.h
+++ b/poppler/Function.h
@@ -58,7 +58,7 @@ public:
static Function *parse(Object *funcObj);
// Initialize the entries common to all function types.
- GBool init(Dict *dict);
+ bool init(Dict *dict);
virtual Function *copy() const = 0;
@@ -78,13 +78,13 @@ public:
double getDomainMax(int i) const { return domain[i][1]; }
double getRangeMin(int i) const { return range[i][0]; }
double getRangeMax(int i) const { return range[i][1]; }
- GBool getHasRange() const { return hasRange; }
- virtual GBool hasDifferentResultSet(const Function *func) const { return gFalse; }
+ bool getHasRange() const { return hasRange; }
+ virtual bool hasDifferentResultSet(const Function *func) const { return false; }
// Transform an input tuple into an output tuple.
virtual void transform(const double *in, double *out) const = 0;
- virtual GBool isOk() const = 0;
+ virtual bool isOk() const = 0;
protected:
static Function *parse(Object *funcObj, std::set<int> *usedParents);
@@ -96,7 +96,7 @@ protected:
domain[funcMaxInputs][2];
double // min and max values for function range
range[funcMaxOutputs][2];
- GBool hasRange; // set if range is defined
+ bool hasRange; // set if range is defined
};
//------------------------------------------------------------------------
@@ -111,7 +111,7 @@ public:
Function *copy() const override { return new IdentityFunction(); }
int getType() const override { return -1; }
void transform(const double *in, double *out) const override;
- GBool isOk() const override { return gTrue; }
+ bool isOk() const override { return true; }
private:
};
@@ -128,8 +128,8 @@ public:
Function *copy() const override { return new SampledFunction(this); }
int getType() const override { return 0; }
void transform(const double *in, double *out) const override;
- GBool isOk() const override { return ok; }
- GBool hasDifferentResultSet(const Function *func) const override;
+ bool isOk() const override { return ok; }
+ bool hasDifferentResultSet(const Function *func) const override;
int getSampleSize(int i) const { return sampleSize[i]; }
double getEncodeMin(int i) const { return encode[i][0]; }
@@ -157,7 +157,7 @@ private:
double *sBuf; // buffer for the transform function
mutable double cacheIn[funcMaxInputs];
mutable double cacheOut[funcMaxOutputs];
- GBool ok;
+ bool ok;
};
//------------------------------------------------------------------------
@@ -172,7 +172,7 @@ public:
Function *copy() const override { return new ExponentialFunction(this); }
int getType() const override { return 2; }
void transform(const double *in, double *out) const override;
- GBool isOk() const override { return ok; }
+ bool isOk() const override { return ok; }
const double *getC0() const { return c0; }
const double *getC1() const { return c1; }
@@ -186,7 +186,7 @@ private:
double c1[funcMaxOutputs];
double e;
bool isLinear;
- GBool ok;
+ bool ok;
};
//------------------------------------------------------------------------
@@ -201,7 +201,7 @@ public:
Function *copy() const override { return new StitchingFunction(this); }
int getType() const override { return 3; }
void transform(const double *in, double *out) const override;
- GBool isOk() const override { return ok; }
+ bool isOk() const override { return ok; }
int getNumFuncs() const { return k; }
const Function *getFunc(int i) const { return funcs[i]; }
@@ -218,7 +218,7 @@ private:
double *bounds;
double *encode;
double *scale;
- GBool ok;
+ bool ok;
};
//------------------------------------------------------------------------
@@ -233,14 +233,14 @@ public:
Function *copy() const override { return new PostScriptFunction(this); }
int getType() const override { return 4; }
void transform(const double *in, double *out) const override;
- GBool isOk() const override { return ok; }
+ bool isOk() const override { return ok; }
const GooString *getCodeString() const { return codeString; }
private:
PostScriptFunction(const PostScriptFunction *func);
- GBool parseCode(Stream *str, int *codePtr);
+ bool parseCode(Stream *str, int *codePtr);
GooString *getToken(Stream *str);
void resizeCode(int newSize);
void exec(PSStack *stack, int codePtr) const;
@@ -250,7 +250,7 @@ private:
int codeSize;
mutable double cacheIn[funcMaxInputs];
mutable double cacheOut[funcMaxOutputs];
- GBool ok;
+ bool ok;
};
#endif
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 1c055e63..3dfc08e8 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -302,7 +302,7 @@ Operator Gfx::opTab[] = {
#define numOps (sizeof(opTab) / sizeof(Operator))
-static inline GBool isSameGfxColor(const GfxColor &colorA, const GfxColor &colorB, Guint nComps, double delta) {
+static inline bool isSameGfxColor(const GfxColor &colorA, const GfxColor &colorB, Guint nComps, double delta) {
for (Guint k = 0; k < nComps; ++k) {
if (abs(colorA.c[k] - colorB.c[k]) > delta) {
return false;
@@ -532,7 +532,7 @@ Object GfxResources::lookupGStateNF(const char *name) {
Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
double hDPI, double vDPI, const PDFRectangle *box,
const PDFRectangle *cropBox, int rotate,
- GBool (*abortCheckCbkA)(void *data),
+ bool (*abortCheckCbkA)(void *data),
void *abortCheckCbkDataA, XRef *xrefA)
{
int i;
@@ -540,7 +540,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
doc = docA;
xref = (xrefA == nullptr) ? doc->getXRef() : xrefA;
catalog = doc->getCatalog();
- subPage = gFalse;
+ subPage = false;
printCommands = globalParams->getPrintCommands();
profileCommands = globalParams->getProfileCommands();
mcStack = nullptr;
@@ -554,7 +554,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
state = new GfxState(hDPI, vDPI, box, rotate, out->upsideDown());
stackHeight = 1;
pushStateGuard();
- fontChanged = gFalse;
+ fontChanged = false;
clip = clipNone;
ignoreUndef = 0;
out->startPage(pageNum, state, xref);
@@ -564,7 +564,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
baseMatrix[i] = state->getCTM()[i];
}
formDepth = 0;
- ocState = gTrue;
+ ocState = true;
parser = nullptr;
abortCheckCbk = abortCheckCbkA;
abortCheckCbkData = abortCheckCbkDataA;
@@ -587,7 +587,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
const PDFRectangle *box, const PDFRectangle *cropBox,
- GBool (*abortCheckCbkA)(void *data),
+ bool (*abortCheckCbkA)(void *data),
void *abortCheckCbkDataA, Gfx *gfxA)
{
int i;
@@ -601,7 +601,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
xref = doc->getXRef();
}
catalog = doc->getCatalog();
- subPage = gTrue;
+ subPage = true;
printCommands = globalParams->getPrintCommands();
profileCommands = globalParams->getProfileCommands();
mcStack = nullptr;
@@ -612,17 +612,17 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
// initialize
out = outA;
- state = new GfxState(72, 72, box, 0, gFalse);
+ state = new GfxState(72, 72, box, 0, false);
stackHeight = 1;
pushStateGuard();
- fontChanged = gFalse;
+ fontChanged = false;
clip = clipNone;
ignoreUndef = 0;
for (i = 0; i < 6; ++i) {
baseMatrix[i] = state->getCTM()[i];
}
formDepth = 0;
- ocState = gTrue;
+ ocState = true;
parser = nullptr;
abortCheckCbk = abortCheckCbkA;
abortCheckCbkData = abortCheckCbkDataA;
@@ -695,7 +695,7 @@ Gfx::~Gfx() {
}
}
-void Gfx::display(Object *obj, GBool topLevel) {
+void Gfx::display(Object *obj, bool topLevel) {
int i;
if (obj->isArray()) {
@@ -710,13 +710,13 @@ void Gfx::display(Object *obj, GBool topLevel) {
error(errSyntaxError, -1, "Weird page contents");
return;
}
- parser = new Parser(xref, new Lexer(xref, obj), gFalse);
+ parser = new Parser(xref, new Lexer(xref, obj), false);
go(topLevel);
delete parser;
parser = nullptr;
}
-void Gfx::go(GBool topLevel) {
+void Gfx::go(bool topLevel) {
Object obj;
Object args[maxArgs];
int numArgs, i;
@@ -729,7 +729,7 @@ void Gfx::go(GBool topLevel) {
numArgs = 0;
obj = parser->getObj();
while (!obj.isEOF()) {
- commandAborted = gFalse;
+ commandAborted = false;
// got a command - execute it
if (obj.isCmd()) {
@@ -774,7 +774,7 @@ void Gfx::go(GBool topLevel) {
if (commandAborted) {
// don't propogate; recursive drawing comes from Form XObjects which
// should probably be drawn in a separate context anyway for caching
- commandAborted = gFalse;
+ commandAborted = false;
break;
}
@@ -846,7 +846,7 @@ void Gfx::execOp(Object *cmd, Object args[], int numArgs) {
if (op->numArgs >= 0) {
if (numArgs < op->numArgs) {
error(errSyntaxError, getPos(), "Too few ({0:d}) args to '{1:s}' operator", numArgs, name);
- commandAborted = gTrue;
+ commandAborted = true;
return;
}
if (numArgs > op->numArgs) {
@@ -898,7 +898,7 @@ Operator *Gfx::findOp(const char *name) {
return &opTab[a];
}
-GBool Gfx::checkArg(Object *arg, TchkType type) {
+bool Gfx::checkArg(Object *arg, TchkType type) {
switch (type) {
case tchkBool: return arg->isBool();
case tchkInt: return arg->isInt();
@@ -908,9 +908,9 @@ GBool Gfx::checkArg(Object *arg, TchkType type) {
case tchkArray: return arg->isArray();
case tchkProps: return arg->isDict() || arg->isName();
case tchkSCN: return arg->isNum() || arg->isName();
- case tchkNone: return gFalse;
+ case tchkNone: return false;
}
- return gFalse;
+ return false;
}
Goffset Gfx::getPos() {
@@ -936,7 +936,7 @@ void Gfx::opConcat(Object args[], int numArgs) {
out->updateCTM(state, args[0].getNum(), args[1].getNum(),
args[2].getNum(), args[3].getNum(),
args[4].getNum(), args[5].getNum());
- fontChanged = gTrue;
+ fontChanged = true;
}
void Gfx::opSetDash(Object args[], int numArgs) {
@@ -989,11 +989,11 @@ void Gfx::opSetLineWidth(Object args[], int numArgs) {
void Gfx::opSetExtGState(Object args[], int numArgs) {
Object obj1, obj2;
GfxBlendMode mode;
- GBool haveFillOP;
+ bool haveFillOP;
Function *funcs[4];
GfxColor backdropColor;
- GBool haveBackdropColor;
- GBool alpha, isolated, knockout;
+ bool haveBackdropColor;
+ bool alpha, isolated, knockout;
double opac;
int i;
@@ -1161,9 +1161,9 @@ void Gfx::opSetExtGState(Object args[], int numArgs) {
} else if (obj2.isDict()) {
Object obj3 = obj2.dictLookup("S");
if (obj3.isName("Alpha")) {
- alpha = gTrue;
+ alpha = true;
} else { // "Luminosity"
- alpha = gFalse;
+ alpha = false;
}
funcs[0] = nullptr;
obj3 = obj2.dictLookup("TR");
@@ -1200,7 +1200,7 @@ void Gfx::opSetExtGState(Object args[], int numArgs) {
Object obj4 = obj3.streamGetDict()->lookup("Group");
if (obj4.isDict()) {
GfxColorSpace *blendingColorSpace = nullptr;
- isolated = knockout = gFalse;
+ isolated = knockout = false;
Object obj5 = obj4.dictLookup("CS");
if (!obj5.isNull()) {
blendingColorSpace = GfxColorSpace::parse(res, &obj5, out, state);
@@ -1249,7 +1249,7 @@ void Gfx::opSetExtGState(Object args[], int numArgs) {
Ref r = fargs0.getRef();
font = GfxFont::makeFont(xref,args[0].getName(),r,fobj.getDict());
state->setFont(font,fargs1.getNum());
- fontChanged = gTrue;
+ fontChanged = true;
}
}
} else {
@@ -1296,9 +1296,9 @@ void Gfx::opSetExtGState(Object args[], int numArgs) {
}
}
-void Gfx::doSoftMask(Object *str, GBool alpha,
+void Gfx::doSoftMask(Object *str, bool alpha,
GfxColorSpace *blendingColorSpace,
- GBool isolated, GBool knockout,
+ bool isolated, bool knockout,
Function *transferFunc, GfxColor *backdropColor) {
Dict *dict, *resDict;
double m[6], bbox[4];
@@ -1354,7 +1354,7 @@ void Gfx::doSoftMask(Object *str, GBool alpha,
// draw it
++formDepth;
- drawForm(str, resDict, m, bbox, gTrue, gTrue,
+ drawForm(str, resDict, m, bbox, true, true,
blendingColorSpace, isolated, knockout,
alpha, transferFunc, backdropColor);
--formDepth;
@@ -1806,7 +1806,7 @@ void Gfx::opFill(Object args[], int numArgs) {
if (state->isPath()) {
if (ocState) {
if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gFalse);
+ doPatternFill(false);
} else {
out->fill(state);
}
@@ -1823,7 +1823,7 @@ void Gfx::opEOFill(Object args[], int numArgs) {
if (state->isPath()) {
if (ocState) {
if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gTrue);
+ doPatternFill(true);
} else {
out->eoFill(state);
}
@@ -1840,7 +1840,7 @@ void Gfx::opFillStroke(Object args[], int numArgs) {
if (state->isPath()) {
if (ocState) {
if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gFalse);
+ doPatternFill(false);
} else {
out->fill(state);
}
@@ -1863,7 +1863,7 @@ void Gfx::opCloseFillStroke(Object args[], int numArgs) {
state->closePath();
if (ocState) {
if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gFalse);
+ doPatternFill(false);
} else {
out->fill(state);
}
@@ -1885,7 +1885,7 @@ void Gfx::opEOFillStroke(Object args[], int numArgs) {
if (state->isPath()) {
if (ocState) {
if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gTrue);
+ doPatternFill(true);
} else {
out->eoFill(state);
}
@@ -1908,7 +1908,7 @@ void Gfx::opCloseEOFillStroke(Object args[], int numArgs) {
state->closePath();
if (ocState) {
if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gTrue);
+ doPatternFill(true);
} else {
out->eoFill(state);
}
@@ -1922,7 +1922,7 @@ void Gfx::opCloseEOFillStroke(Object args[], int numArgs) {
doEndPath();
}
-void Gfx::doPatternFill(GBool eoFill) {
+void Gfx::doPatternFill(bool eoFill) {
GfxPattern *pattern;
// this is a bit of a kludge -- patterns can be really slow, so we
@@ -1937,10 +1937,10 @@ void Gfx::doPatternFill(GBool eoFill) {
}
switch (pattern->getType()) {
case 1:
- doTilingPatternFill((GfxTilingPattern *)pattern, gFalse, eoFill, gFalse);
+ doTilingPatternFill((GfxTilingPattern *)pattern, false, eoFill, false);
break;
case 2:
- doShadingPatternFill((GfxShadingPattern *)pattern, gFalse, eoFill, gFalse);
+ doShadingPatternFill((GfxShadingPattern *)pattern, false, eoFill, false);
break;
default:
error(errSyntaxError, getPos(), "Unknown pattern type ({0:d}) in fill",
@@ -1964,10 +1964,10 @@ void Gfx::doPatternStroke() {
}
switch (pattern->getType()) {
case 1:
- doTilingPatternFill((GfxTilingPattern *)pattern, gTrue, gFalse, gFalse);
+ doTilingPatternFill((GfxTilingPattern *)pattern, true, false, false);
break;
case 2:
- doShadingPatternFill((GfxShadingPattern *)pattern, gTrue, gFalse, gFalse);
+ doShadingPatternFill((GfxShadingPattern *)pattern, true, false, false);
break;
default:
error(errSyntaxError, getPos(), "Unknown pattern type ({0:d}) in stroke",
@@ -1991,10 +1991,10 @@ void Gfx::doPatternText() {
}
switch (pattern->getType()) {
case 1:
- doTilingPatternFill((GfxTilingPattern *)pattern, gFalse, gFalse, gTrue);
+ doTilingPatternFill((GfxTilingPattern *)pattern, false, false, true);
break;
case 2:
- doShadingPatternFill((GfxShadingPattern *)pattern, gFalse, gFalse, gTrue);
+ doShadingPatternFill((GfxShadingPattern *)pattern, false, false, true);
break;
default:
error(errSyntaxError, getPos(), "Unknown pattern type ({0:d}) in fill",
@@ -2004,7 +2004,7 @@ void Gfx::doPatternText() {
}
void Gfx::doPatternImageMask(Object *ref, Stream *str, int width, int height,
- GBool invert, GBool inlineImg) {
+ bool invert, bool inlineImg) {
saveState();
out->setSoftMaskFromImageMask(state, ref, str,
@@ -2023,7 +2023,7 @@ void Gfx::doPatternImageMask(Object *ref, Stream *str, int width, int height,
}
void Gfx::doTilingPatternFill(GfxTilingPattern *tPat,
- GBool stroke, GBool eoFill, GBool text) {
+ bool stroke, bool eoFill, bool text) {
GfxPatternColorSpace *patCS;
GfxColorSpace *cs;
GfxColor color;
@@ -2207,14 +2207,14 @@ void Gfx::doTilingPatternFill(GfxTilingPattern *tPat,
m1[4] = m[4];
m1[5] = m[5];
{
- bool shouldDrawPattern = gTrue;
+ bool shouldDrawPattern = true;
std::set<int>::iterator patternRefIt;
const int patternRefNum = tPat->getPatternRefNum();
if (patternRefNum != -1) {
if (formsDrawing.find(patternRefNum) == formsDrawing.end()) {
patternRefIt = formsDrawing.insert(patternRefNum).first;
} else {
- shouldDrawPattern = gFalse;
+ shouldDrawPattern = false;
}
}
if (shouldDrawPattern) {
@@ -2250,7 +2250,7 @@ void Gfx::doTilingPatternFill(GfxTilingPattern *tPat,
}
void Gfx::doShadingPatternFill(GfxShadingPattern *sPat,
- GBool stroke, GBool eoFill, GBool text) {
+ bool stroke, bool eoFill, bool text) {
GfxShading *shading;
GfxState *savedState;
const double *ctm, *btm, *ptm;
@@ -2346,9 +2346,9 @@ void Gfx::doShadingPatternFill(GfxShadingPattern *sPat,
}
#if 1 //~tmp: turn off anti-aliasing temporarily
- GBool vaa = out->getVectorAntialias();
+ bool vaa = out->getVectorAntialias();
if (vaa) {
- out->setVectorAntialias(gFalse);
+ out->setVectorAntialias(false);
}
#endif
@@ -2375,7 +2375,7 @@ void Gfx::doShadingPatternFill(GfxShadingPattern *sPat,
#if 1 //~tmp: turn off anti-aliasing temporarily
if (vaa) {
- out->setVectorAntialias(gTrue);
+ out->setVectorAntialias(true);
}
#endif
@@ -2417,9 +2417,9 @@ void Gfx::opShFill(Object args[], int numArgs) {
out->updateFillColorSpace(state);
#if 1 //~tmp: turn off anti-aliasing temporarily
- GBool vaa = out->getVectorAntialias();
+ bool vaa = out->getVectorAntialias();
if (vaa) {
- out->setVectorAntialias(gFalse);
+ out->setVectorAntialias(false);
}
#endif
@@ -2446,7 +2446,7 @@ void Gfx::opShFill(Object args[], int numArgs) {
#if 1 //~tmp: turn off anti-aliasing temporarily
if (vaa) {
- out->setVectorAntialias(gTrue);
+ out->setVectorAntialias(true);
}
#endif
@@ -2599,7 +2599,7 @@ void Gfx::doAxialShFill(GfxAxialShading *shading) {
double xMin, yMin, xMax, yMax;
double x0, y0, x1, y1;
double dx, dy, mul;
- GBool dxZero, dyZero;
+ bool dxZero, dyZero;
double bboxIntersections[4];
double tMin, tMax, tx, ty;
double s[4], sMin, sMax, tmp;
@@ -2610,7 +2610,7 @@ void Gfx::doAxialShFill(GfxAxialShading *shading) {
GfxColor color0 = {}, color1 = {};
int nComps;
int i, j, k;
- GBool needExtend = gTrue;
+ bool needExtend = true;
// get the clip region bbox
state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
@@ -2911,10 +2911,10 @@ void Gfx::doRadialShFill(GfxRadialShading *shading) {
double xa, ya, xb, yb, ra, rb;
double ta, tb, sa, sb;
double sz, xz, yz, sMin, sMax;
- GBool enclosed;
+ bool enclosed;
int ia, ib, k, n;
double theta, alpha, angle, t;
- GBool needExtend = gTrue;
+ bool needExtend = true;
// get the shading info
shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
@@ -2925,11 +2925,11 @@ void Gfx::doRadialShFill(GfxRadialShading *shading) {
// Compute the point at which r(s) = 0; check for the enclosed
// circles case; and compute the angles for the tangent lines.
if (x0 == x1 && y0 == y1) {
- enclosed = gTrue;
+ enclosed = true;
theta = 0; // make gcc happy
sz = 0; // make gcc happy
} else if (r0 == r1) {
- enclosed = gFalse;
+ enclosed = false;
theta = 0;
sz = 0; // make gcc happy
} else {
@@ -3644,7 +3644,7 @@ void Gfx::opBeginText(Object args[], int numArgs) {
state->textMoveTo(0, 0);
out->updateTextMat(state);
out->updateTextPos(state);
- fontChanged = gTrue;
+ fontChanged = true;
}
void Gfx::opEndText(Object args[], int numArgs) {
@@ -3667,7 +3667,7 @@ void Gfx::opSetFont(Object args[], int numArgs) {
// unsetting the font (drawing no text) is better than using the
// previous one and drawing random glyphs from it
state->setFont(nullptr, args[1].getNum());
- fontChanged = gTrue;
+ fontChanged = true;
return;
}
if (printCommands) {
@@ -3680,7 +3680,7 @@ void Gfx::opSetFont(Object args[], int numArgs) {
font->incRefCnt();
state->setFont(font, args[1].getNum());
- fontChanged = gTrue;
+ fontChanged = true;
}
void Gfx::opSetTextLeading(Object args[], int numArgs) {
@@ -3705,7 +3705,7 @@ void Gfx::opSetWordSpacing(Object args[], int numArgs) {
void Gfx::opSetHorizScaling(Object args[], int numArgs) {
state->setHorizScaling(args[0].getNum());
out->updateHorizScaling(state);
- fontChanged = gTrue;
+ fontChanged = true;
}
//------------------------------------------------------------------------
@@ -3739,7 +3739,7 @@ void Gfx::opSetTextMatrix(Object args[], int numArgs) {
state->textMoveTo(0, 0);
out->updateTextMat(state);
out->updateTextPos(state);
- fontChanged = gTrue;
+ fontChanged = true;
}
void Gfx::opTextNextLine(Object args[], int numArgs) {
@@ -3762,7 +3762,7 @@ void Gfx::opShowText(Object args[], int numArgs) {
}
if (fontChanged) {
out->updateFont(state);
- fontChanged = gFalse;
+ fontChanged = false;
}
out->beginStringOp(state);
doShowText(args[0].getString());
@@ -3781,7 +3781,7 @@ void Gfx::opMoveShowText(Object args[], int numArgs) {
}
if (fontChanged) {
out->updateFont(state);
- fontChanged = gFalse;
+ fontChanged = false;
}
tx = state->getLineX();
ty = state->getLineY() - state->getLeading();
@@ -3804,7 +3804,7 @@ void Gfx::opMoveSetShowText(Object args[], int numArgs) {
}
if (fontChanged) {
out->updateFont(state);
- fontChanged = gFalse;
+ fontChanged = false;
}
state->setWordSpace(args[0].getNum());
state->setCharSpace(args[1].getNum());
@@ -3833,7 +3833,7 @@ void Gfx::opShowSpaceText(Object args[], int numArgs) {
}
if (fontChanged) {
out->updateFont(state);
- fontChanged = gFalse;
+ fontChanged = false;
}
out->beginStringOp(state);
wMode = state->getFont()->getWMode();
@@ -3887,7 +3887,7 @@ void Gfx::doShowText(const GooString *s) {
GfxState *savedState;
const char *p;
int render;
- GBool patternFill;
+ bool patternFill;
int len, n, uLen, nChars, nSpaces;
font = state->getFont();
@@ -3901,7 +3901,7 @@ void Gfx::doShowText(const GooString *s) {
render = state->getRender();
if (!(render & 1) &&
state->getFillColorSpace()->getMode() == csPattern) {
- patternFill = gTrue;
+ patternFill = true;
saveState();
// disable fill, enable clipping, leave stroke unchanged
if ((render ^ (render >> 1)) & 1) {
@@ -3912,7 +3912,7 @@ void Gfx::doShowText(const GooString *s) {
state->setRender(render);
out->updateRender(state);
} else {
- patternFill = gFalse;
+ patternFill = false;
}
state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
@@ -3983,7 +3983,7 @@ void Gfx::doShowText(const GooString *s) {
}
}
if (displayCharProc) {
- display(&charProc, gFalse);
+ display(&charProc, false);
if (refNum != -1) {
charProcDrawing.erase(charProcDrawingIt);
@@ -4157,18 +4157,18 @@ void Gfx::opXObject(Object args[], int numArgs) {
if (obj2.isName("Image")) {
if (out->needNonText()) {
Object refObj = res->lookupXObjectNF(name);
- doImage(&refObj, obj1.getStream(), gFalse);
+ doImage(&refObj, obj1.getStream(), false);
}
} else if (obj2.isName("Form")) {
Object refObj = res->lookupXObjectNF(name);
- GBool shouldDoForm = gTrue;
+ bool shouldDoForm = true;
std::set<int>::iterator drawingFormIt;
if (refObj.isRef()) {
const int num = refObj.getRef().num;
if (formsDrawing.find(num) == formsDrawing.end()) {
drawingFormIt = formsDrawing.insert(num).first;
} else {
- shouldDoForm = gFalse;
+ shouldDoForm = false;
}
}
if (shouldDoForm) {
@@ -4197,20 +4197,20 @@ void Gfx::opXObject(Object args[], int numArgs) {
#endif
}
-void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
+void Gfx::doImage(Object *ref, Stream *str, bool inlineImg) {
Dict *dict, *maskDict;
int width, height;
int bits, maskBits;
- GBool interpolate;
+ bool interpolate;
StreamColorSpaceMode csMode;
- GBool mask;
- GBool invert;
+ bool mask;
+ bool invert;
GfxColorSpace *colorSpace, *maskColorSpace;
- GBool haveColorKeyMask, haveExplicitMask, haveSoftMask;
+ bool haveColorKeyMask, haveExplicitMask, haveSoftMask;
int maskColors[2*gfxColorMaxComps] = {};
int maskWidth, maskHeight;
- GBool maskInvert;
- GBool maskInterpolate;
+ bool maskInvert;
+ bool maskInterpolate;
Stream *maskStr;
Object obj1;
int i, n;
@@ -4264,15 +4264,15 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
if (obj1.isBool())
interpolate = obj1.getBool();
else
- interpolate = gFalse;
- maskInterpolate = gFalse;
+ interpolate = false;
+ maskInterpolate = false;
// image or mask?
obj1 = dict->lookup("ImageMask");
if (obj1.isNull()) {
obj1 = dict->lookup("IM");
}
- mask = gFalse;
+ mask = false;
if (obj1.isBool())
mask = obj1.getBool();
else if (!obj1.isNull())
@@ -4299,7 +4299,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
// check for inverted mask
if (bits != 1)
goto err1;
- invert = gFalse;
+ invert = false;
obj1 = dict->lookup("Decode");
if (obj1.isNull()) {
obj1 = dict->lookup("D");
@@ -4310,7 +4310,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
// Table 4.39 says /Decode must be [1 0] or [0 1]. Adobe
// accepts [1.0 0.0] as well.
if (obj2.isNum() && obj2.getNum() >= 0.9)
- invert = gTrue;
+ invert = true;
} else if (!obj1.isNull()) {
goto err1;
}
@@ -4400,10 +4400,10 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
}
// get the mask
- haveColorKeyMask = haveExplicitMask = haveSoftMask = gFalse;
+ haveColorKeyMask = haveExplicitMask = haveSoftMask = false;
maskStr = nullptr; // make gcc happy
maskWidth = maskHeight = 0; // make gcc happy
- maskInvert = gFalse; // make gcc happy
+ maskInvert = false; // make gcc happy
std::unique_ptr<GfxImageColorMap> maskColorMap;
Object maskObj = dict->lookup("Mask");
Object smaskObj = dict->lookup("SMask");
@@ -4437,7 +4437,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
if (obj1.isBool())
maskInterpolate = obj1.getBool();
else
- maskInterpolate = gFalse;
+ maskInterpolate = false;
obj1 = maskDict->lookup("BitsPerComponent");
if (obj1.isNull()) {
obj1 = maskDict->lookup("BPC");
@@ -4494,7 +4494,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
}
}
}
- haveSoftMask = gTrue;
+ haveSoftMask = true;
} else if (maskObj.isArray()) {
// color key mask
for (i = 0;
@@ -4511,7 +4511,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
goto err1;
}
}
- haveColorKeyMask = gTrue;
+ haveColorKeyMask = true;
} else if (maskObj.isStream()) {
// explicit mask
if (inlineImg) {
@@ -4542,7 +4542,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
if (obj1.isBool())
maskInterpolate = obj1.getBool();
else
- maskInterpolate = gFalse;
+ maskInterpolate = false;
obj1 = maskDict->lookup("ImageMask");
if (obj1.isNull()) {
obj1 = maskDict->lookup("IM");
@@ -4550,7 +4550,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
if (!obj1.isBool() || !obj1.getBool()) {
goto err1;
}
- maskInvert = gFalse;
+ maskInvert = false;
obj1 = maskDict->lookup("Decode");
if (obj1.isNull()) {
obj1 = maskDict->lookup("D");
@@ -4560,12 +4560,12 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
// Table 4.39 says /Decode must be [1 0] or [0 1]. Adobe
// accepts [1.0 0.0] as well.
if (obj2.isNum() && obj2.getNum() >= 0.9) {
- maskInvert = gTrue;
+ maskInvert = true;
}
} else if (!obj1.isNull()) {
goto err1;
}
- haveExplicitMask = gTrue;
+ haveExplicitMask = true;
}
// if drawing is disabled, skip over inline image data
@@ -4604,14 +4604,14 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
error(errSyntaxError, getPos(), "Bad image parameters");
}
-GBool Gfx::checkTransparencyGroup(Dict *resDict) {
+bool Gfx::checkTransparencyGroup(Dict *resDict) {
// check the effect of compositing objects as a group:
// look for ExtGState entries with ca != 1 or CA != 1 or BM != normal
- GBool transpGroup = gFalse;
+ bool transpGroup = false;
double opac;
if (resDict == nullptr)
- return gFalse;
+ return false;
pushResources(resDict);
Object extGStates = resDict->lookup("ExtGState");
if (extGStates.isDict()) {
@@ -4625,7 +4625,7 @@ GBool Gfx::checkTransparencyGroup(Dict *resDict) {
if (!obj2.isNull()) {
if (state->parseBlendMode(&obj2, &mode)) {
if (mode != gfxBlendNormal)
- transpGroup = gTrue;
+ transpGroup = true;
} else {
error(errSyntaxError, getPos(), "Invalid blend mode in ExtGState");
}
@@ -4635,14 +4635,14 @@ GBool Gfx::checkTransparencyGroup(Dict *resDict) {
opac = obj2.getNum();
opac = opac < 0 ? 0 : opac > 1 ? 1 : opac;
if (opac != 1)
- transpGroup = gTrue;
+ transpGroup = true;
}
obj2 = obj1.dictLookup("CA");
if (obj2.isNum()) {
opac = obj2.getNum();
opac = opac < 0 ? 0 : opac > 1 ? 1 : opac;
if (opac != 1)
- transpGroup = gTrue;
+ transpGroup = true;
}
// alpha is shape
obj2 = obj1.dictLookup("AIS");
@@ -4653,7 +4653,7 @@ GBool Gfx::checkTransparencyGroup(Dict *resDict) {
obj2 = obj1.dictLookup("SMask");
if (!transpGroup && !obj2.isNull()) {
if (!obj2.isName("None")) {
- transpGroup = gTrue;
+ transpGroup = true;
}
}
}
@@ -4665,11 +4665,11 @@ GBool Gfx::checkTransparencyGroup(Dict *resDict) {
void Gfx::doForm(Object *str) {
Dict *dict;
- GBool transpGroup, isolated, knockout;
+ bool transpGroup, isolated, knockout;
GfxColorSpace *blendingColorSpace;
double m[6], bbox[4];
Dict *resDict;
- GBool ocSaved;
+ bool ocSaved;
Object obj1;
int i;
@@ -4692,7 +4692,7 @@ void Gfx::doForm(Object *str) {
obj1 = dict->lookupNF("OC");
if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&obj1)) {
if (out->needCharCount()) {
- ocState = gFalse;
+ ocState = false;
} else {
return;
}
@@ -4734,7 +4734,7 @@ void Gfx::doForm(Object *str) {
resDict = resObj.isDict() ? resObj.getDict() : nullptr;
// check for a transparency group
- transpGroup = isolated = knockout = gFalse;
+ transpGroup = isolated = knockout = false;
blendingColorSpace = nullptr;
obj1 = dict->lookup("Group");
if (obj1.isDict()) {
@@ -4759,7 +4759,7 @@ void Gfx::doForm(Object *str) {
// draw it
++formDepth;
drawForm(str, resDict, m, bbox,
- transpGroup, gFalse, blendingColorSpace, isolated, knockout);
+ transpGroup, false, blendingColorSpace, isolated, knockout);
--formDepth;
if (blendingColorSpace) {
@@ -4770,10 +4770,10 @@ void Gfx::doForm(Object *str) {
}
void Gfx::drawForm(Object *str, Dict *resDict, const double *matrix, const double *bbox,
- GBool transpGroup, GBool softMask,
+ bool transpGroup, bool softMask,
GfxColorSpace *blendingColorSpace,
- GBool isolated, GBool knockout,
- GBool alpha, Function *transferFunc,
+ bool isolated, bool knockout,
+ bool alpha, Function *transferFunc,
GfxColor *backdropColor) {
Parser *oldParser;
GfxState *savedState;
@@ -4835,7 +4835,7 @@ void Gfx::drawForm(Object *str, Dict *resDict, const double *matrix, const doubl
GfxState *stateBefore = state;
// draw the form
- display(str, gFalse);
+ display(str, false);
if (stateBefore != state) {
if (state->isParentState(stateBefore)) {
@@ -4891,7 +4891,7 @@ void Gfx::opBeginImage(Object args[], int numArgs) {
// display the image
if (str) {
- doImage(nullptr, str, gTrue);
+ doImage(nullptr, str, true);
// skip 'EI' tag
c1 = str->getUndecodedStream()->getChar();
@@ -4929,7 +4929,7 @@ Stream *Gfx::buildImageStream() {
// make stream
if (parser->getStream()) {
- str = new EmbedStream(parser->getStream(), std::move(dict), gFalse, 0, gTrue);
+ str = new EmbedStream(parser->getStream(), std::move(dict), false, 0, true);
str = str->addFilters(str->getDict());
} else {
str = nullptr;
@@ -4985,7 +4985,7 @@ enum GfxMarkedContentKind {
struct MarkedContentStack {
GfxMarkedContentKind kind;
- GBool ocSuppressed; // are we ignoring content based on OptionalContent?
+ bool ocSuppressed; // are we ignoring content based on OptionalContent?
MarkedContentStack *next; // next object on stack
};
@@ -4997,13 +4997,13 @@ void Gfx::popMarkedContent() {
void Gfx::pushMarkedContent() {
MarkedContentStack *mc = new MarkedContentStack();
- mc->ocSuppressed = gFalse;
+ mc->ocSuppressed = false;
mc->kind = gfxMCOther;
mc->next = mcStack;
mcStack = mc;
}
-GBool Gfx::contentIsHidden() {
+bool Gfx::contentIsHidden() {
MarkedContentStack *mc = mcStack;
bool hidden = mc && mc->ocSuppressed;
while (!hidden && mc && mc->next) {
@@ -5345,7 +5345,7 @@ void Gfx::saveState() {
void Gfx::restoreState() {
if (stackHeight <= bottomGuard() || !state->hasSaves()) {
error(errSyntaxError, -1, "Restoring state when no valid states to pop");
- commandAborted = gTrue;
+ commandAborted = true;
return;
}
state = state->restore();
@@ -5360,7 +5360,7 @@ GfxState *Gfx::saveStateStack() {
out->saveState(state);
oldState = state;
- state = state->copy(gTrue);
+ state = state->copy(true);
return oldState;
}
diff --git a/poppler/Gfx.h b/poppler/Gfx.h
index d25411e0..f966e8f6 100644
--- a/poppler/Gfx.h
+++ b/poppler/Gfx.h
@@ -152,13 +152,13 @@ public:
Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
double hDPI, double vDPI, const PDFRectangle *box,
const PDFRectangle *cropBox, int rotate,
- GBool (*abortCheckCbkA)(void *data) = nullptr,
+ bool (*abortCheckCbkA)(void *data) = nullptr,
void *abortCheckCbkDataA = nullptr, XRef *xrefA = nullptr);
// Constructor for a sub-page object.
Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
const PDFRectangle *box, const PDFRectangle *cropBox,
- GBool (*abortCheckCbkA)(void *data) = nullptr,
+ bool (*abortCheckCbkA)(void *data) = nullptr,
void *abortCheckCbkDataA = nullptr, Gfx *gfxA = nullptr);
#ifdef USE_CMS
void initDisplayProfile();
@@ -171,7 +171,7 @@ public:
XRef *getXRef() { return xref; }
// Interpret a stream or array of streams.
- void display(Object *obj, GBool topLevel = gTrue);
+ void display(Object *obj, bool topLevel = true);
// Display an annotation, given its appearance (a Form XObject),
// border style, and bounding box (in default user space).
@@ -193,13 +193,13 @@ public:
// Get the current graphics state object.
GfxState *getState() { return state; }
- GBool checkTransparencyGroup(Dict *resDict);
+ bool checkTransparencyGroup(Dict *resDict);
void drawForm(Object *str, Dict *resDict, const double *matrix, const double *bbox,
- GBool transpGroup = gFalse, GBool softMask = gFalse,
+ bool transpGroup = false, bool softMask = false,
GfxColorSpace *blendingColorSpace = nullptr,
- GBool isolated = gFalse, GBool knockout = gFalse,
- GBool alpha = gFalse, Function *transferFunc = nullptr,
+ bool isolated = false, bool knockout = false,
+ bool alpha = false, Function *transferFunc = nullptr,
GfxColor *backdropColor = nullptr);
void pushResources(Dict *resDict);
@@ -211,23 +211,23 @@ private:
XRef *xref; // the xref table for this PDF file
Catalog *catalog; // the Catalog for this PDF file
OutputDev *out; // output device
- GBool subPage; // is this a sub-page object?
- GBool printCommands; // print the drawing commands (for debugging)
- GBool profileCommands; // profile the drawing commands (for debugging)
- GBool commandAborted; // did the previous command abort the drawing?
+ bool subPage; // is this a sub-page object?
+ bool printCommands; // print the drawing commands (for debugging)
+ bool profileCommands; // profile the drawing commands (for debugging)
+ bool commandAborted; // did the previous command abort the drawing?
GfxResources *res; // resource stack
int updateLevel;
GfxState *state; // current graphics state
int stackHeight; // the height of the current graphics stack
std::vector<int> stateGuards; // a stack of state limits; to guard against unmatched pops
- GBool fontChanged; // set if font or text matrix has changed
+ bool fontChanged; // set if font or text matrix has changed
GfxClipType clip; // do a clip?
int ignoreUndef; // current BX/EX nesting level
double baseMatrix[6]; // default matrix for most recent
// page/form/pattern
int formDepth;
- GBool ocState; // true if drawing is enabled, false if
+ bool ocState; // true if drawing is enabled, false if
// disabled
MarkedContentStack *mcStack; // current BMC/EMC stack
@@ -237,16 +237,16 @@ private:
std::set<int> formsDrawing; // the forms/patterns that are being drawn
std::set<int> charProcDrawing; // the charProc that are being drawn
- GBool // callback to check for an abort
+ bool // callback to check for an abort
(*abortCheckCbk)(void *data);
void *abortCheckCbkData;
static Operator opTab[]; // table of operators
- void go(GBool topLevel);
+ void go(bool topLevel);
void execOp(Object *cmd, Object args[], int numArgs);
Operator *findOp(const char *name);
- GBool checkArg(Object *arg, TchkType type);
+ bool checkArg(Object *arg, TchkType type);
Goffset getPos();
int bottomGuard();
@@ -262,9 +262,9 @@ private:
void opSetMiterLimit(Object args[], int numArgs);
void opSetLineWidth(Object args[], int numArgs);
void opSetExtGState(Object args[], int numArgs);
- void doSoftMask(Object *str, GBool alpha,
+ void doSoftMask(Object *str, bool alpha,
GfxColorSpace *blendingColorSpace,
- GBool isolated, GBool knockout,
+ bool isolated, bool knockout,
Function *transferFunc, GfxColor *backdropColor);
void opSetRenderingIntent(Object args[], int numArgs);
@@ -301,15 +301,15 @@ private:
void opCloseFillStroke(Object args[], int numArgs);
void opEOFillStroke(Object args[], int numArgs);
void opCloseEOFillStroke(Object args[], int numArgs);
- void doPatternFill(GBool eoFill);
+ void doPatternFill(bool eoFill);
void doPatternStroke();
void doPatternText();
void doPatternImageMask(Object *ref, Stream *str, int width, int height,
- GBool invert, GBool inlineImg);
+ bool invert, bool inlineImg);
void doTilingPatternFill(GfxTilingPattern *tPat,
- GBool stroke, GBool eoFill, GBool text);
+ bool stroke, bool eoFill, bool text);
void doShadingPatternFill(GfxShadingPattern *sPat,
- GBool stroke, GBool eoFill, GBool text);
+ bool stroke, bool eoFill, bool text);
void opShFill(Object args[], int numArgs);
void doFunctionShFill(GfxFunctionShading *shading);
void doFunctionShFill1(GfxFunctionShading *shading,
@@ -364,7 +364,7 @@ private:
// XObject operators
void opXObject(Object args[], int numArgs);
- void doImage(Object *ref, Stream *str, GBool inlineImg);
+ void doImage(Object *ref, Stream *str, bool inlineImg);
void doForm(Object *str);
// in-line image operators
@@ -387,7 +387,7 @@ private:
void opMarkPoint(Object args[], int numArgs);
GfxState *saveStateStack();
void restoreStateStack(GfxState *oldState);
- GBool contentIsHidden();
+ bool contentIsHidden();
void pushMarkedContent();
void popMarkedContent();
};
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 20388519..a23d46f3 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -170,8 +170,8 @@ static const char *base14SubstFonts[14] = {
//------------------------------------------------------------------------
static int parseCharName(char *charName, Unicode *uBuf, int uLen,
- GBool names, GBool ligatures,
- GBool numeric, GBool hex, GBool variants);
+ bool names, bool ligatures,
+ bool numeric, bool hex, bool variants);
//------------------------------------------------------------------------
@@ -234,7 +234,7 @@ GfxFont *GfxFont::makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict
GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA,
GfxFontType typeA, Ref embFontIDA) {
- ok = gFalse;
+ ok = false;
tag = new GooString(tagA);
id = idA;
name = nameA;
@@ -246,7 +246,7 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA,
weight = WeightNotDefined;
refCnt = 1;
encodingName = new GooString("");
- hasToUnicode = gFalse;
+ hasToUnicode = false;
}
GfxFont::~GfxFont() {
@@ -286,15 +286,15 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
GfxFontType t, expectedType;
FoFiIdentifierType fft;
Dict *fontDict2;
- GBool isType0, err;
+ bool isType0, err;
t = fontUnknownType;
embID->num = embID->gen = -1;
- err = gFalse;
+ err = false;
Object subtype = fontDict->lookup("Subtype");
expectedType = fontUnknownType;
- isType0 = gFalse;
+ isType0 = false;
if (subtype.isName("Type1") || subtype.isName("MMType1")) {
expectedType = fontType1;
} else if (subtype.isName("Type1C")) {
@@ -304,7 +304,7 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
} else if (subtype.isName("TrueType")) {
expectedType = fontTrueType;
} else if (subtype.isName("Type0")) {
- isType0 = gTrue;
+ isType0 = true;
} else {
error(errSyntaxWarning, -1, "Unknown font type: '{0:s}'",
subtype.isName() ? subtype.getName() : "???");
@@ -344,7 +344,7 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
if (obj3.isRef()) {
*embID = obj3.getRef();
if (expectedType != fontType1) {
- err = gTrue;
+ err = true;
}
}
if (embID->num == -1 && (obj3 = fontDesc.dictLookupNF("FontFile2"), obj3.isRef())) {
@@ -352,7 +352,7 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
if (isType0) {
expectedType = fontCIDType2;
} else if (expectedType != fontTrueType) {
- err = gTrue;
+ err = true;
}
}
if (embID->num == -1 && (obj3 = fontDesc.dictLookupNF("FontFile3"), obj3.isRef())) {
@@ -362,26 +362,26 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
subtype = obj4.streamGetDict()->lookup("Subtype");
if (subtype.isName("Type1")) {
if (expectedType != fontType1) {
- err = gTrue;
+ err = true;
expectedType = isType0 ? fontCIDType0 : fontType1;
}
} else if (subtype.isName("Type1C")) {
if (expectedType == fontType1) {
expectedType = fontType1C;
} else if (expectedType != fontType1C) {
- err = gTrue;
+ err = true;
expectedType = isType0 ? fontCIDType0C : fontType1C;
}
} else if (subtype.isName("TrueType")) {
if (expectedType != fontTrueType) {
- err = gTrue;
+ err = true;
expectedType = isType0 ? fontCIDType2 : fontTrueType;
}
} else if (subtype.isName("CIDFontType0C")) {
if (expectedType == fontCIDType0) {
expectedType = fontCIDType0C;
} else {
- err = gTrue;
+ err = true;
expectedType = isType0 ? fontCIDType0C : fontType1C;
}
} else if (subtype.isName("OpenType")) {
@@ -394,7 +394,7 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
} else if (expectedType == fontCIDType2) {
expectedType = fontCIDType2OT;
} else {
- err = gTrue;
+ err = true;
}
} else {
error(errSyntaxError, -1, "Unknown font type '{0:s}'",
@@ -445,7 +445,7 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) {
}
if (t != expectedType) {
- err = gTrue;
+ err = true;
}
if (err) {
@@ -583,7 +583,7 @@ CharCodeToUnicode *GfxFont::readToUnicodeCMap(Dict *fontDict, int nBits,
} else {
ctu = CharCodeToUnicode::parseCMap(buf, nBits);
}
- hasToUnicode = gTrue;
+ hasToUnicode = true;
delete buf;
return ctu;
}
@@ -593,7 +593,7 @@ GfxFontLoc *GfxFont::locateFont(XRef *xref, PSOutputDev *ps) {
SysFontType sysFontType;
GooString *path, *base14Name, *substName;
int substIdx, fontNum;
- GBool embed;
+ bool embed;
if (type == fontType3) {
return nullptr;
@@ -601,12 +601,12 @@ GfxFontLoc *GfxFont::locateFont(XRef *xref, PSOutputDev *ps) {
//----- embedded font
if (embFontID.num >= 0) {
- embed = gTrue;
+ embed = true;
Object refObj(embFontID.num, embFontID.gen);
Object embFontObj = refObj.fetch(xref);
if (!embFontObj.isStream()) {
error(errSyntaxError, -1, "Embedded font object is wrong type");
- embed = gFalse;
+ embed = false;
}
if (embed) {
if (ps) {
@@ -671,7 +671,7 @@ GfxFontLoc *GfxFont::locateFont(XRef *xref, PSOutputDev *ps) {
if (!ps && !isCIDFont() && ((Gfx8BitFont *)this)->base14) {
base14Name = new GooString(((Gfx8BitFont *)this)->base14->base14Name);
if ((path = globalParams->findBase14FontFile(base14Name, this))) {
- if ((fontLoc = getExternalFont(path, gFalse))) {
+ if ((fontLoc = getExternalFont(path, false))) {
delete base14Name;
return fontLoc;
}
@@ -740,7 +740,7 @@ GfxFontLoc *GfxFont::locateFont(XRef *xref, PSOutputDev *ps) {
path = globalParams->findFontFile(substName);
delete substName;
if (path) {
- if ((fontLoc = getExternalFont(path, gFalse))) {
+ if ((fontLoc = getExternalFont(path, false))) {
error(errSyntaxWarning, -1, "Substituting font '{0:s}' for '{1:s}'",
base14SubstFonts[substIdx], name ? name->getCString() : "");
name = new GooString(base14SubstFonts[substIdx]);
@@ -765,10 +765,10 @@ GfxFontLoc *GfxFont::locateBase14Font(GooString *base14Name) {
if (!path) {
return nullptr;
}
- return getExternalFont(path, gFalse);
+ return getExternalFont(path, false);
}
-GfxFontLoc *GfxFont::getExternalFont(GooString *path, GBool cid) {
+GfxFontLoc *GfxFont::getExternalFont(GooString *path, bool cid) {
FoFiIdentifierType fft;
GfxFontType fontType;
GfxFontLoc *fontLoc;
@@ -868,7 +868,7 @@ const char *GfxFont::getAlternateName(const char *name) {
// Parse character names of the form 'Axx', 'xx', 'Ann', 'ABnn', or
// 'nn', where 'A' and 'B' are any letters, 'xx' is two hex digits,
// and 'nn' is decimal digits.
-static GBool parseNumericName(const char *s, GBool hex, unsigned int *u) {
+static bool parseNumericName(const char *s, bool hex, unsigned int *u) {
char *endptr;
// Strip leading alpha characters.
@@ -883,7 +883,7 @@ static GBool parseNumericName(const char *s, GBool hex, unsigned int *u) {
if (n == 3 && isalpha(*s)) {
++s;
} else if (n != 2) {
- return gFalse;
+ return false;
}
} else {
// Strip up to two alpha characters.
@@ -894,7 +894,7 @@ static GBool parseNumericName(const char *s, GBool hex, unsigned int *u) {
int v = strtol(s, &endptr, hex ? 16 : 10);
if (endptr == s)
- return gFalse;
+ return false;
// Skip trailing junk characters.
while (*endptr != '\0' && !isalnum(*endptr))
@@ -903,24 +903,24 @@ static GBool parseNumericName(const char *s, GBool hex, unsigned int *u) {
if (*endptr == '\0') {
if (u)
*u = v;
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
-// Returns gTrue if the font has character names like xx or Axx which
+// Returns true if the font has character names like xx or Axx which
// should be parsed for hex or decimal values.
-static GBool testForNumericNames(Dict *fontDict, GBool hex) {
- GBool numeric = gTrue;
+static bool testForNumericNames(Dict *fontDict, bool hex) {
+ bool numeric = true;
Object enc = fontDict->lookup("Encoding");
if (!enc.isDict()) {
- return gFalse;
+ return false;
}
Object diff = enc.dictLookup("Differences");
if (!diff.isArray()) {
- return gFalse;
+ return false;
}
for (int i = 0; i < diff.arrayGetLength() && numeric; ++i) {
@@ -928,13 +928,13 @@ static GBool testForNumericNames(Dict *fontDict, GBool hex) {
if (obj.isInt()) {
// All sequences must start between character codes 0 and 5.
if (obj.getInt() > 5)
- numeric = gFalse;
+ numeric = false;
} else if (obj.isName()) {
// All character names must sucessfully parse.
if (!parseNumericName(obj.getName(), hex, nullptr))
- numeric = gFalse;
+ numeric = false;
} else {
- numeric = gFalse;
+ numeric = false;
}
}
@@ -947,15 +947,15 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
GooString *name2;
BuiltinFont *builtinFont;
const char **baseEnc;
- GBool baseEncFromFontFile;
+ bool baseEncFromFontFile;
char *buf;
int len;
FoFiType1 *ffT1;
FoFiType1C *ffT1C;
int code;
char *charName;
- GBool missing, hex;
- GBool numeric;
+ bool missing, hex;
+ bool numeric;
Unicode toUnicode[256];
Unicode uBuf[8];
double mul;
@@ -1087,33 +1087,33 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
// FontDict.Encoding.Differences.
// check FontDict for base encoding
- hasEncoding = gFalse;
- usesMacRomanEnc = gFalse;
+ hasEncoding = false;
+ usesMacRomanEnc = false;
baseEnc = nullptr;
- baseEncFromFontFile = gFalse;
+ baseEncFromFontFile = false;
obj1 = fontDict->lookup("Encoding");
if (obj1.isDict()) {
Object obj2 = obj1.dictLookup("BaseEncoding");
if (obj2.isName("MacRomanEncoding")) {
- hasEncoding = gTrue;
- usesMacRomanEnc = gTrue;
+ hasEncoding = true;
+ usesMacRomanEnc = true;
baseEnc = macRomanEncoding;
} else if (obj2.isName("MacExpertEncoding")) {
- hasEncoding = gTrue;
+ hasEncoding = true;
baseEnc = macExpertEncoding;
} else if (obj2.isName("WinAnsiEncoding")) {
- hasEncoding = gTrue;
+ hasEncoding = true;
baseEnc = winAnsiEncoding;
}
} else if (obj1.isName("MacRomanEncoding")) {
- hasEncoding = gTrue;
- usesMacRomanEnc = gTrue;
+ hasEncoding = true;
+ usesMacRomanEnc = true;
baseEnc = macRomanEncoding;
} else if (obj1.isName("MacExpertEncoding")) {
- hasEncoding = gTrue;
+ hasEncoding = true;
baseEnc = macExpertEncoding;
} else if (obj1.isName("WinAnsiEncoding")) {
- hasEncoding = gTrue;
+ hasEncoding = true;
baseEnc = winAnsiEncoding;
}
@@ -1134,7 +1134,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
}
if (!baseEnc) {
baseEnc = (const char **)ffT1->getEncoding();
- baseEncFromFontFile = gTrue;
+ baseEncFromFontFile = true;
}
}
gfree(buf);
@@ -1150,7 +1150,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
}
if (!baseEnc) {
baseEnc = (const char **)ffT1C->getEncoding();
- baseEncFromFontFile = gTrue;
+ baseEncFromFontFile = true;
}
}
gfree(buf);
@@ -1161,7 +1161,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
if (!baseEnc) {
if (builtinFont && embFontID.num < 0) {
baseEnc = builtinFont->defaultBaseEnc;
- hasEncoding = gTrue;
+ hasEncoding = true;
} else if (type == fontTrueType) {
baseEnc = winAnsiEncoding;
} else {
@@ -1201,7 +1201,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
for (i = 0; i < 256; ++i) {
if (!enc[i] && standardEncoding[i]) {
enc[i] = (char *)standardEncoding[i];
- encFree[i] = gFalse;
+ encFree[i] = false;
}
}
}
@@ -1211,7 +1211,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
Object obj2 = obj1.dictLookup("Differences");
if (obj2.isArray()) {
encodingName->Set("Custom");
- hasEncoding = gTrue;
+ hasEncoding = true;
code = 0;
for (i = 0; i < obj2.arrayGetLength(); ++i) {
Object obj3 = obj2.arrayGet(i);
@@ -1223,7 +1223,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
gfree(enc[code]);
}
enc[code] = copyString(obj3.getName());
- encFree[code] = gTrue;
+ encFree[code] = true;
}
++code;
} else {
@@ -1240,8 +1240,8 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
//----- build the mapping to Unicode -----
// pass 1: use the name-to-Unicode mapping table
- missing = hex = gFalse;
- GBool isZapfDingbats = name && name->endsWith("ZapfDingbats");
+ missing = hex = false;
+ bool isZapfDingbats = name && name->endsWith("ZapfDingbats");
for (code = 0; code < 256; ++code) {
if ((charName = enc[code])) {
if (isZapfDingbats) {
@@ -1267,9 +1267,9 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
// number like a0
((charName[1] >= 'a' && charName[1] <= 'f') ||
(charName[1] >= 'A' && charName[1] <= 'F')))) {
- hex = gTrue;
+ hex = true;
}
- missing = gTrue;
+ missing = true;
}
} else {
toUnicode[code] = 0;
@@ -1299,11 +1299,11 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
if (!toUnicode[code]) {
if ((charName = enc[code]) && strcmp(charName, ".notdef")
&& (n = parseCharName(charName, uBuf, sizeof(uBuf)/sizeof(*uBuf),
- gFalse, // don't check simple names (pass 1)
- gTrue, // do check ligatures
+ false, // don't check simple names (pass 1)
+ true, // do check ligatures
numeric,
hex,
- gTrue))) { // do check variants
+ true))) { // do check variants
ctu->setMapping((CharCode)code, uBuf, n);
continue;
}
@@ -1401,7 +1401,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
}
}
- ok = gTrue;
+ ok = true;
}
Gfx8BitFont::~Gfx8BitFont() {
@@ -1420,8 +1420,8 @@ Gfx8BitFont::~Gfx8BitFont() {
// Algorithmic comments are excerpted from that document to aid
// maintainability.
static int parseCharName(char *charName, Unicode *uBuf, int uLen,
- GBool names, GBool ligatures,
- GBool numeric, GBool hex, GBool variants)
+ bool names, bool ligatures,
+ bool numeric, bool hex, bool variants)
{
if (uLen <= 0) {
error(errInternal, -1, "Zero-length output buffer (recursion overflow?) in "
@@ -1437,7 +1437,7 @@ static int parseCharName(char *charName, Unicode *uBuf, int uLen,
} else if (var_part != nullptr) {
// parse names of the form 7.oldstyle, P.swash, s.sc, etc.
char *main_part = copyString(charName, var_part - charName);
- GBool namesRecurse = gTrue, variantsRecurse = gFalse;
+ bool namesRecurse = true, variantsRecurse = false;
int n = parseCharName(main_part, uBuf, uLen, namesRecurse, ligatures,
numeric, hex, variantsRecurse);
gfree(main_part);
@@ -1455,7 +1455,7 @@ static int parseCharName(char *charName, Unicode *uBuf, int uLen,
if ((lig_end = strchr(lig_part, '_')))
*lig_end = '\0';
if (lig_part[0] != '\0') {
- GBool namesRecurse = gTrue, ligaturesRecurse = gFalse;
+ bool namesRecurse = true, ligaturesRecurse = false;
if ((m = parseCharName(lig_part, uBuf + n, uLen - n, namesRecurse,
ligaturesRecurse, numeric, hex, variants)))
n += m;
@@ -1549,7 +1549,7 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) {
int *map;
int cmapPlatform, cmapEncoding;
int unicodeCmap, macRomanCmap, msSymbolCmap, cmap;
- GBool useMacRoman, useUnicode;
+ bool useMacRoman, useUnicode;
char *charName;
Unicode u;
int code, i, n;
@@ -1598,22 +1598,22 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) {
}
}
cmap = 0;
- useMacRoman = gFalse;
- useUnicode = gFalse;
+ useMacRoman = false;
+ useUnicode = false;
if (hasEncoding || type == fontType1) {
if (unicodeCmap >= 0) {
cmap = unicodeCmap;
- useUnicode = gTrue;
+ useUnicode = true;
} else if (usesMacRomanEnc && macRomanCmap >= 0) {
cmap = macRomanCmap;
- useMacRoman = gTrue;
+ useMacRoman = true;
} else if ((flags & fontSymbolic) && msSymbolCmap >= 0) {
cmap = msSymbolCmap;
} else if ((flags & fontSymbolic) && macRomanCmap >= 0) {
cmap = macRomanCmap;
} else if (macRomanCmap >= 0) {
cmap = macRomanCmap;
- useMacRoman = gTrue;
+ useMacRoman = true;
}
} else {
if (msSymbolCmap >= 0) {
@@ -1729,7 +1729,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
collection = nullptr;
cMap = nullptr;
ctu = nullptr;
- ctuUsesCharCode = gTrue;
+ ctuUsesCharCode = true;
widths.defWidth = 1.0;
widths.defHeight = -1.0;
widths.defVY = 0.880;
@@ -1774,7 +1774,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
// look for a ToUnicode CMap
if (!(ctu = readToUnicodeCMap(fontDict, 16, nullptr))) {
- ctuUsesCharCode = gFalse;
+ ctuUsesCharCode = false;
// use an identity mapping for the "Adobe-Identity" and
// "Adobe-UCS" collections
@@ -1985,7 +1985,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
cmpWidthExcepVFunctor());
}
- ok = gTrue;
+ ok = true;
}
GfxCIDFont::~GfxCIDFont() {
@@ -2088,7 +2088,7 @@ const GooString *GfxCIDFont::getCollection() const {
}
int GfxCIDFont::mapCodeToGID(FoFiTrueType *ff, int cmapi,
- Unicode unicode, GBool wmode) {
+ Unicode unicode, bool wmode) {
Gushort gid = ff->mapCodeToGID(cmapi,unicode);
if (wmode) {
Gushort vgid = ff->mapToVertGID(gid);
@@ -2301,23 +2301,23 @@ int *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
if (humap != nullptr) {
for (i = 0;i < N_UCS_CANDIDATES
&& gid == 0 && (unicode = humap[code*N_UCS_CANDIDATES+i]) != 0;i++) {
- gid = mapCodeToGID(ff,cmap,unicode,gFalse);
+ gid = mapCodeToGID(ff,cmap,unicode,false);
}
}
if (gid == 0 && vumap != nullptr) {
unicode = vumap[code];
if (unicode != 0) {
- gid = mapCodeToGID(ff,cmap,unicode,gTrue);
+ gid = mapCodeToGID(ff,cmap,unicode,true);
if (gid == 0 && tumap != nullptr) {
if ((unicode = tumap[code]) != 0) {
- gid = mapCodeToGID(ff,cmap,unicode,gTrue);
+ gid = mapCodeToGID(ff,cmap,unicode,true);
}
}
}
}
if (gid == 0 && tumap != nullptr) {
if ((unicode = tumap[code]) != 0) {
- gid = mapCodeToGID(ff,cmap,unicode,gFalse);
+ gid = mapCodeToGID(ff,cmap,unicode,false);
}
}
if (gid == 0) {
diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index bad8af5f..5a52e058 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -180,7 +180,7 @@ public:
GfxFont(const GfxFont &) = delete;
GfxFont& operator=(const GfxFont &other) = delete;
- GBool isOk() const { return ok; }
+ bool isOk() const { return ok; }
void incRefCnt();
void decRefCnt();
@@ -192,7 +192,7 @@ public:
const Ref *getID() const { return &id; }
// Does this font match the tag?
- GBool matches(const char *tagA) const { return !tag->cmp(tagA); }
+ bool matches(const char *tagA) const { return !tag->cmp(tagA); }
// Get font family name.
GooString *getFamily() const { return family; }
@@ -209,21 +209,21 @@ public:
// Get font type.
GfxFontType getType() const { return type; }
- virtual GBool isCIDFont() const { return gFalse; }
+ virtual bool isCIDFont() const { return false; }
// Get embedded font ID, i.e., a ref for the font file stream.
// Returns false if there is no embedded font.
- GBool getEmbeddedFontID(Ref *embID) const
+ bool getEmbeddedFontID(Ref *embID) const
{ *embID = embFontID; return embFontID.num >= 0; }
// Invalidate an embedded font
// Returns false if there is no embedded font.
- GBool invalidateEmbeddedFont() {
+ bool invalidateEmbeddedFont() {
if (embFontID.num >= 0) {
embFontID.num = -1;
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
// Get the PostScript font name for the embedded font. Returns
@@ -232,11 +232,11 @@ public:
// Get font descriptor flags.
int getFlags() const { return flags; }
- GBool isFixedWidth() const { return flags & fontFixedWidth; }
- GBool isSerif() const { return flags & fontSerif; }
- GBool isSymbolic() const { return flags & fontSymbolic; }
- GBool isItalic() const { return flags & fontItalic; }
- GBool isBold() const { return flags & fontBold; }
+ bool isFixedWidth() const { return flags & fontFixedWidth; }
+ bool isSerif() const { return flags & fontSerif; }
+ bool isSymbolic() const { return flags & fontSymbolic; }
+ bool isItalic() const { return flags & fontItalic; }
+ bool isBold() const { return flags & fontBold; }
// Return the Unicode map.
virtual const CharCodeToUnicode *getToUnicode() const = 0;
@@ -275,7 +275,7 @@ public:
double *dx, double *dy, double *ox, double *oy) const = 0;
// Does this font have a toUnicode map?
- GBool hasToUnicodeCMap() const { return hasToUnicode; }
+ bool hasToUnicodeCMap() const { return hasToUnicode; }
// Return the name of the encoding
GooString *getEncodingName() const { return encodingName; }
@@ -293,7 +293,7 @@ protected:
void readFontDescriptor(XRef *xref, Dict *fontDict);
CharCodeToUnicode *readToUnicodeCMap(Dict *fontDict, int nBits,
CharCodeToUnicode *ctu);
- static GfxFontLoc *getExternalFont(GooString *path, GBool cid);
+ static GfxFontLoc *getExternalFont(GooString *path, bool cid);
GooString *tag; // PDF font tag
Ref id; // reference (used as unique ID)
@@ -311,8 +311,8 @@ protected:
double ascent; // max height above baseline
double descent; // max depth below baseline
int refCnt;
- GBool ok;
- GBool hasToUnicode;
+ bool ok;
+ bool hasToUnicode;
GooString *encodingName;
};
@@ -340,10 +340,10 @@ public:
const char *getCharName(int code) const { return enc[code]; }
// Returns true if the PDF font specified an encoding.
- GBool getHasEncoding() const { return hasEncoding; }
+ bool getHasEncoding() const { return hasEncoding; }
// Returns true if the PDF font specified MacRomanEncoding.
- GBool getUsesMacRomanEnc() const { return usesMacRomanEnc; }
+ bool getUsesMacRomanEnc() const { return usesMacRomanEnc; }
// Get width of a character.
double getWidth(Guchar c) const { return widths[c]; }
@@ -370,8 +370,8 @@ private:
char encFree[256]; // boolean for each char name: if set,
// the string is malloc'ed
CharCodeToUnicode *ctu; // char code --> Unicode
- GBool hasEncoding;
- GBool usesMacRomanEnc;
+ bool hasEncoding;
+ bool usesMacRomanEnc;
double widths[256]; // character widths
Object charProcs; // Type 3 CharProcs dictionary
Object resources; // Type 3 Resources dictionary
@@ -389,7 +389,7 @@ public:
GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
GfxFontType typeA, Ref embFontIDA, Dict *fontDict);
- GBool isCIDFont() const override { return gTrue; }
+ bool isCIDFont() const override { return true; }
int getNextChar(const char *s, int len, CharCode *code,
Unicode **u, int *uLen,
@@ -417,13 +417,13 @@ private:
~GfxCIDFont();
int mapCodeToGID(FoFiTrueType *ff, int cmapi,
- Unicode unicode, GBool wmode);
+ Unicode unicode, bool wmode);
double getWidth(CID cid) const; // Get width of a character.
GooString *collection; // collection name
CMap *cMap; // char code --> CID
CharCodeToUnicode *ctu; // CID --> Unicode
- GBool ctuUsesCharCode; // true: ctu maps char code to Unicode;
+ bool ctuUsesCharCode; // true: ctu maps char code to Unicode;
// false: ctu maps CID to Unicode
GfxFontCIDWidths widths; // character widths
int *cidToGID; // CID --> GID mapping (for embedded
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 09fc9793..b8f93429 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -68,12 +68,12 @@
//------------------------------------------------------------------------
-GBool Matrix::invertTo(Matrix *other) const
+bool Matrix::invertTo(Matrix *other) const
{
const double det_denominator = determinant();
if (unlikely(det_denominator == 0)) {
*other = {1, 0, 0, 1, 0, 0};
- return gFalse;
+ return false;
}
const double det = 1 / det_denominator;
@@ -84,7 +84,7 @@ GBool Matrix::invertTo(Matrix *other) const
other->m[4] = (m[2] * m[5] - m[3] * m[4]) * det;
other->m[5] = (m[1] * m[4] - m[0] * m[5]) * det;
- return gTrue;
+ return true;
}
void Matrix::translate(double tx, double ty)
@@ -477,13 +477,13 @@ static void CMSError(cmsContext /*contextId*/, cmsUInt32Number /*ecode*/, const
int GfxColorSpace::setupColorProfiles()
{
- static GBool initialized = gFalse;
+ static bool initialized = false;
cmsHTRANSFORM transform;
unsigned int nChannels;
// do only once
if (initialized) return 0;
- initialized = gTrue;
+ initialized = true;
// set error handlor
cmsSetLogErrorHandler(CMSError);
@@ -2351,7 +2351,7 @@ void GfxICCBasedColorSpace::getCMYK(const GfxColor *color, GfxCMYK *cmyk) const
#endif
}
-GBool GfxICCBasedColorSpace::useGetRGBLine() const {
+bool GfxICCBasedColorSpace::useGetRGBLine() const {
#ifdef USE_CMS
return lineTransform != nullptr || alt->useGetRGBLine();
#else
@@ -2359,7 +2359,7 @@ GBool GfxICCBasedColorSpace::useGetRGBLine() const {
#endif
}
-GBool GfxICCBasedColorSpace::useGetCMYKLine() const {
+bool GfxICCBasedColorSpace::useGetCMYKLine() const {
#ifdef USE_CMS
return lineTransform != nullptr || alt->useGetCMYKLine();
#else
@@ -2367,7 +2367,7 @@ GBool GfxICCBasedColorSpace::useGetCMYKLine() const {
#endif
}
-GBool GfxICCBasedColorSpace::useGetDeviceNLine() const {
+bool GfxICCBasedColorSpace::useGetDeviceNLine() const {
#ifdef USE_CMS
return lineTransform != nullptr || alt->useGetDeviceNLine();
#else
@@ -2673,7 +2673,7 @@ GfxSeparationColorSpace::GfxSeparationColorSpace(GooString *nameA,
GfxSeparationColorSpace::GfxSeparationColorSpace(GooString *nameA,
GfxColorSpace *altA,
Function *funcA,
- GBool nonMarkingA,
+ bool nonMarkingA,
Guint overprintMaskA,
int *mappingA) {
name = nameA;
@@ -2910,13 +2910,13 @@ GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA,
alt = altA;
func = funcA;
sepsCS = sepsCSA;
- nonMarking = gTrue;
+ nonMarking = true;
overprintMask = 0;
mapping = nullptr;
for (i = 0; i < nComps; ++i) {
names[i] = namesA[i];
if (names[i]->cmp("None")) {
- nonMarking = gFalse;
+ nonMarking = false;
}
if (!names[i]->cmp("Cyan")) {
overprintMask |= 0x01;
@@ -2940,7 +2940,7 @@ GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA,
Function *funcA,
GooList *sepsCSA,
int *mappingA,
- GBool nonMarkingA,
+ bool nonMarkingA,
Guint overprintMaskA) {
int i;
@@ -3162,7 +3162,7 @@ void GfxDeviceNColorSpace::createMapping(GooList *separationList, int maxSepComp
mapping[i] = 3;
} else {
Guint startOverprintMask = 0x10;
- GBool found = gFalse;
+ bool found = false;
const Function *sepFunc = nullptr;
if (nComps == 1)
sepFunc = func;
@@ -3188,7 +3188,7 @@ void GfxDeviceNColorSpace::createMapping(GooList *separationList, int maxSepComp
}
mapping[i] = j+4;
newOverprintMask |= startOverprintMask;
- found = gTrue;
+ found = true;
break;
}
startOverprintMask <<=1;
@@ -3210,7 +3210,7 @@ void GfxDeviceNColorSpace::createMapping(GooList *separationList, int maxSepComp
for (int k = 0; k < sepsCS->getLength(); k++) {
GfxSeparationColorSpace *sepCS = (GfxSeparationColorSpace *)sepsCS->get(k);
if (!sepCS->getName()->cmp(names[i])) {
- found = gTrue;
+ found = true;
separationList->push_back(sepCS->copy());
break;
}
@@ -3598,24 +3598,24 @@ GfxShading *GfxShading::parse(GfxResources *res, Object *obj, OutputDev *out, Gf
return nullptr;
}
-GBool GfxShading::init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *state) {
+bool GfxShading::init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *state) {
Object obj1;
int i;
obj1 = dict->lookup("ColorSpace");
if (!(colorSpace = GfxColorSpace::parse(res, &obj1, out, state))) {
error(errSyntaxWarning, -1, "Bad color space in shading dictionary");
- return gFalse;
+ return false;
}
for (i = 0; i < gfxColorMaxComps; ++i) {
background.c[i] = 0;
}
- hasBackground = gFalse;
+ hasBackground = false;
obj1 = dict->lookup("Background");
if (obj1.isArray()) {
if (obj1.arrayGetLength() == colorSpace->getNComps()) {
- hasBackground = gTrue;
+ hasBackground = true;
for (i = 0; i < colorSpace->getNComps(); ++i) {
Object obj2 = obj1.arrayGet(i);
background.c[i] = dblToCol(obj2.getNum());
@@ -3626,7 +3626,7 @@ GBool GfxShading::init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *
}
xMin = yMin = xMax = yMax = 0;
- hasBBox = gFalse;
+ hasBBox = false;
obj1 = dict->lookup("BBox");
if (obj1.isArray()) {
if (obj1.arrayGetLength() == 4) {
@@ -3636,7 +3636,7 @@ GBool GfxShading::init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *
Object obj5 = obj1.arrayGet(3);
if (obj2.isNum() && obj3.isNum() && obj4.isNum() && obj5.isNum())
{
- hasBBox = gTrue;
+ hasBBox = true;
xMin = obj2.getNum();
yMin = obj3.getNum();
xMax = obj4.getNum();
@@ -3649,7 +3649,7 @@ GBool GfxShading::init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *
}
}
- return gTrue;
+ return true;
}
//------------------------------------------------------------------------
@@ -3811,7 +3811,7 @@ void GfxFunctionShading::getColor(double x, double y, GfxColor *color) const {
GfxUnivariateShading::GfxUnivariateShading(int typeA,
double t0A, double t1A,
Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A):
+ bool extend0A, bool extend1A):
GfxShading(typeA)
{
int i;
@@ -4012,7 +4012,7 @@ GfxAxialShading::GfxAxialShading(double x0A, double y0A,
double x1A, double y1A,
double t0A, double t1A,
Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A):
+ bool extend0A, bool extend1A):
GfxUnivariateShading(2, t0A, t1A, funcsA, nFuncsA, extend0A, extend1A)
{
x0 = x0A;
@@ -4039,7 +4039,7 @@ GfxAxialShading *GfxAxialShading::parse(GfxResources *res, Dict *dict, OutputDev
double t0A, t1A;
Function *funcsA[gfxColorMaxComps];
int nFuncsA;
- GBool extend0A, extend1A;
+ bool extend0A, extend1A;
Object obj1;
x0A = y0A = x1A = y1A = 0;
@@ -4094,7 +4094,7 @@ GfxAxialShading *GfxAxialShading::parse(GfxResources *res, Dict *dict, OutputDev
}
}
- extend0A = extend1A = gFalse;
+ extend0A = extend1A = false;
obj1 = dict->lookup("Extend");
if (obj1.isArray() && obj1.arrayGetLength() == 2) {
Object obj2 = obj1.arrayGet(0);
@@ -4202,7 +4202,7 @@ GfxRadialShading::GfxRadialShading(double x0A, double y0A, double r0A,
double x1A, double y1A, double r1A,
double t0A, double t1A,
Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A):
+ bool extend0A, bool extend1A):
GfxUnivariateShading(3, t0A, t1A, funcsA, nFuncsA, extend0A, extend1A)
{
x0 = x0A;
@@ -4233,7 +4233,7 @@ GfxRadialShading *GfxRadialShading::parse(GfxResources *res, Dict *dict, OutputD
double t0A, t1A;
Function *funcsA[gfxColorMaxComps];
int nFuncsA;
- GBool extend0A, extend1A;
+ bool extend0A, extend1A;
Object obj1;
int i;
@@ -4282,12 +4282,12 @@ GfxRadialShading *GfxRadialShading::parse(GfxResources *res, Dict *dict, OutputD
}
}
- extend0A = extend1A = gFalse;
+ extend0A = extend1A = false;
obj1 = dict->lookup("Extend");
if (obj1.isArray() && obj1.arrayGetLength() == 2) {
Object obj2;
- extend0A = (obj2 = obj1.arrayGet(0), obj2.isBool() ? obj2.getBool() : gFalse);
- extend1A = (obj2 = obj1.arrayGet(1), obj2.isBool() ? obj2.getBool() : gFalse);
+ extend0A = (obj2 = obj1.arrayGet(0), obj2.isBool() ? obj2.getBool() : false);
+ extend1A = (obj2 = obj1.arrayGet(1), obj2.isBool() ? obj2.getBool() : false);
}
shading = new GfxRadialShading(x0A, y0A, r0A, x1A, y1A, r1A, t0A, t1A,
@@ -4318,8 +4318,8 @@ double GfxRadialShading::getDistance(double sMin, double sMax) {
}
// extend range, adapted from cairo, radialExtendRange
-static GBool
-radialExtendRange (double range[2], double value, GBool valid)
+static bool
+radialExtendRange (double range[2], double value, bool valid)
{
if (!valid)
range[0] = range[1] = value;
@@ -4328,11 +4328,11 @@ radialExtendRange (double range[2], double value, GBool valid)
else if (value > range[1])
range[1] = value;
- return gTrue;
+ return true;
}
inline void radialEdge(double num, double den, double delta, double lower, double upper,
- double dr, double mindr, GBool &valid, double *range)
+ double dr, double mindr, bool &valid, double *range)
{
if (fabs (den) >= RADIAL_EPSILON) {
double t_edge, v;
@@ -4344,7 +4344,7 @@ inline void radialEdge(double num, double den, double delta, double lower, doubl
}
inline void radialCorner1(double x, double y, double &b, double dx, double dy, double cr,
- double dr, double mindr, GBool &valid, double *range)
+ double dr, double mindr, bool &valid, double *range)
{
b = (x) * dx + (y) * dy + cr * dr;
if (fabs (b) >= RADIAL_EPSILON) {
@@ -4361,7 +4361,7 @@ inline void radialCorner1(double x, double y, double &b, double dx, double dy, d
}
inline void radialCorner2(double x, double y, double a, double &b, double &c, double &d, double dx, double dy, double cr,
- double inva, double dr, double mindr, GBool &valid, double *range)
+ double inva, double dr, double mindr, bool &valid, double *range)
{
b = (x) * dx + (y) * dy + cr * dr;
c = (x) * (x) + (y) * (y) - cr * cr;
@@ -4385,7 +4385,7 @@ void GfxRadialShading::getParameterRange(double *lower, double *upper,
double a, x_focus, y_focus;
double mindr, minx, miny, maxx, maxy;
double range[2];
- GBool valid;
+ bool valid;
// A radial pattern is considered degenerate if it can be
// represented as a solid or clear pattern. This corresponds to one
@@ -4408,7 +4408,7 @@ void GfxRadialShading::getParameterRange(double *lower, double *upper,
}
range[0] = range[1] = 0;
- valid = gFalse;
+ valid = false;
x_focus = y_focus = 0; // silence gcc
@@ -4623,7 +4623,7 @@ public:
~GfxShadingBitBuf();
GfxShadingBitBuf(const GfxShadingBitBuf &) = delete;
GfxShadingBitBuf& operator=(const GfxShadingBitBuf &) = delete;
- GBool getBits(int n, Guint *val);
+ bool getBits(int n, Guint *val);
void flushBits();
private:
@@ -4644,7 +4644,7 @@ GfxShadingBitBuf::~GfxShadingBitBuf() {
str->close();
}
-GBool GfxShadingBitBuf::getBits(int n, Guint *val) {
+bool GfxShadingBitBuf::getBits(int n, Guint *val) {
int x;
if (nBits >= n) {
@@ -4660,7 +4660,7 @@ GBool GfxShadingBitBuf::getBits(int n, Guint *val) {
while (n > 0) {
if ((bitBuf = str->getChar()) == EOF) {
nBits = 0;
- return gFalse;
+ return false;
}
if (n >= 8) {
x = (x << 8) | bitBuf;
@@ -4673,7 +4673,7 @@ GBool GfxShadingBitBuf::getBits(int n, Guint *val) {
}
}
*val = x;
- return gTrue;
+ return true;
}
void GfxShadingBitBuf::flushBits() {
@@ -5665,10 +5665,10 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
double y[gfxColorMaxComps] = {};
int i, j, k;
double mapped;
- GBool useByteLookup;
+ bool useByteLookup;
- ok = gTrue;
- useMatte = gFalse;
+ ok = true;
+ useMatte = false;
colorSpace = colorSpaceA;
@@ -5738,7 +5738,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
// color values
colorSpace2 = nullptr;
nComps2 = 0;
- useByteLookup = gFalse;
+ useByteLookup = false;
switch (colorSpace->getMode()) {
case csIndexed:
// Note that indexHigh may not be the same as maxPixel --
@@ -5752,7 +5752,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
colorSpace2->getDefaultRanges(x, y, indexHigh);
if (colorSpace2->useGetGrayLine() || colorSpace2->useGetRGBLine() || colorSpace2->useGetCMYKLine() || colorSpace2->useGetDeviceNLine()) {
byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2);
- useByteLookup = gTrue;
+ useByteLookup = true;
}
for (k = 0; k < nComps2; ++k) {
lookup2[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
@@ -5779,7 +5779,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
sepFunc = sepCS->getFunc();
if (colorSpace2->useGetGrayLine() || colorSpace2->useGetRGBLine() || colorSpace2->useGetCMYKLine() || colorSpace2->useGetDeviceNLine()) {
byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2);
- useByteLookup = gTrue;
+ useByteLookup = true;
}
for (k = 0; k < nComps2; ++k) {
lookup2[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
@@ -5796,7 +5796,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
default:
if (colorSpace->useGetGrayLine() || colorSpace->useGetRGBLine() || colorSpace->useGetCMYKLine() || colorSpace->useGetDeviceNLine()) {
byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps);
- useByteLookup = gTrue;
+ useByteLookup = true;
}
for (k = 0; k < nComps; ++k) {
lookup2[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
@@ -5821,7 +5821,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
return;
err1:
- ok = gFalse;
+ ok = false;
}
GfxImageColorMap::GfxImageColorMap(GfxImageColorMap *colorMap) {
@@ -5872,7 +5872,7 @@ GfxImageColorMap::GfxImageColorMap(GfxImageColorMap *colorMap) {
decodeLow[i] = colorMap->decodeLow[i];
decodeRange[i] = colorMap->decodeRange[i];
}
- ok = gTrue;
+ ok = true;
}
GfxImageColorMap::~GfxImageColorMap() {
@@ -6235,12 +6235,12 @@ GfxSubpath::GfxSubpath(double x1, double y1) {
size = 16;
x = (double *)gmallocn(size, sizeof(double));
y = (double *)gmallocn(size, sizeof(double));
- curve = (GBool *)gmallocn(size, sizeof(GBool));
+ curve = (bool *)gmallocn(size, sizeof(bool));
n = 1;
x[0] = x1;
y[0] = y1;
- curve[0] = gFalse;
- closed = gFalse;
+ curve[0] = false;
+ closed = false;
}
GfxSubpath::~GfxSubpath() {
@@ -6255,10 +6255,10 @@ GfxSubpath::GfxSubpath(const GfxSubpath *subpath) {
n = subpath->n;
x = (double *)gmallocn(size, sizeof(double));
y = (double *)gmallocn(size, sizeof(double));
- curve = (GBool *)gmallocn(size, sizeof(GBool));
+ curve = (bool *)gmallocn(size, sizeof(bool));
memcpy(x, subpath->x, n * sizeof(double));
memcpy(y, subpath->y, n * sizeof(double));
- memcpy(curve, subpath->curve, n * sizeof(GBool));
+ memcpy(curve, subpath->curve, n * sizeof(bool));
closed = subpath->closed;
}
@@ -6267,11 +6267,11 @@ void GfxSubpath::lineTo(double x1, double y1) {
size *= 2;
x = (double *)greallocn(x, size, sizeof(double));
y = (double *)greallocn(y, size, sizeof(double));
- curve = (GBool *)greallocn(curve, size, sizeof(GBool));
+ curve = (bool *)greallocn(curve, size, sizeof(bool));
}
x[n] = x1;
y[n] = y1;
- curve[n] = gFalse;
+ curve[n] = false;
++n;
}
@@ -6281,7 +6281,7 @@ void GfxSubpath::curveTo(double x1, double y1, double x2, double y2,
size *= 2;
x = (double *)greallocn(x, size, sizeof(double));
y = (double *)greallocn(y, size, sizeof(double));
- curve = (GBool *)greallocn(curve, size, sizeof(GBool));
+ curve = (bool *)greallocn(curve, size, sizeof(bool));
}
x[n] = x1;
y[n] = y1;
@@ -6289,8 +6289,8 @@ void GfxSubpath::curveTo(double x1, double y1, double x2, double y2,
y[n+1] = y2;
x[n+2] = x3;
y[n+2] = y3;
- curve[n] = curve[n+1] = gTrue;
- curve[n+2] = gFalse;
+ curve[n] = curve[n+1] = true;
+ curve[n+2] = false;
n += 3;
}
@@ -6298,7 +6298,7 @@ void GfxSubpath::close() {
if (x[n-1] != x[0] || y[n-1] != y[0]) {
lineTo(x[0], y[0]);
}
- closed = gTrue;
+ closed = true;
}
void GfxSubpath::offset(double dx, double dy) {
@@ -6311,7 +6311,7 @@ void GfxSubpath::offset(double dx, double dy) {
}
GfxPath::GfxPath() {
- justMoved = gFalse;
+ justMoved = false;
size = 16;
n = 0;
firstX = firstY = 0;
@@ -6327,7 +6327,7 @@ GfxPath::~GfxPath() {
}
// Used for copy().
-GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1,
+GfxPath::GfxPath(bool justMoved1, double firstX1, double firstY1,
GfxSubpath **subpaths1, int n1, int size1) {
int i;
@@ -6342,7 +6342,7 @@ GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1,
}
void GfxPath::moveTo(double x, double y) {
- justMoved = gTrue;
+ justMoved = true;
firstX = x;
firstY = y;
}
@@ -6361,7 +6361,7 @@ void GfxPath::lineTo(double x, double y) {
subpaths[n-1]->getLastY());
}
++n;
- justMoved = gFalse;
+ justMoved = false;
}
subpaths[n-1]->lineTo(x, y);
}
@@ -6381,7 +6381,7 @@ void GfxPath::curveTo(double x1, double y1, double x2, double y2,
subpaths[n-1]->getLastY());
}
++n;
- justMoved = gFalse;
+ justMoved = false;
}
subpaths[n-1]->curveTo(x1, y1, x2, y2, x3, y3);
}
@@ -6397,7 +6397,7 @@ void GfxPath::close() {
}
subpaths[n] = new GfxSubpath(firstX, firstY);
++n;
- justMoved = gFalse;
+ justMoved = false;
}
subpaths[n-1]->close();
}
@@ -6413,7 +6413,7 @@ void GfxPath::append(GfxPath *path) {
for (i = 0; i < path->n; ++i) {
subpaths[n++] = path->subpaths[i]->copy();
}
- justMoved = gFalse;
+ justMoved = false;
}
void GfxPath::offset(double dx, double dy) {
@@ -6469,7 +6469,7 @@ void GfxState::ReusablePathIterator::reset() {
}
GfxState::GfxState(double hDPIA, double vDPIA, const PDFRectangle *pageBox,
- int rotateA, GBool upsideDown) {
+ int rotateA, bool upsideDown) {
double kx, ky;
hDPI = hDPIA;
@@ -6528,8 +6528,8 @@ GfxState::GfxState(double hDPIA, double vDPIA, const PDFRectangle *pageBox,
blendMode = gfxBlendNormal;
fillOpacity = 1;
strokeOpacity = 1;
- fillOverprint = gFalse;
- strokeOverprint = gFalse;
+ fillOverprint = false;
+ strokeOverprint = false;
overprintMode = 0;
transfer[0] = transfer[1] = transfer[2] = transfer[3] = nullptr;
@@ -6541,9 +6541,9 @@ GfxState::GfxState(double hDPIA, double vDPIA, const PDFRectangle *pageBox,
lineJoin = 0;
lineCap = 0;
miterLimit = 10;
- strokeAdjust = gFalse;
- alphaIsShape = gFalse;
- textKnockout = gFalse;
+ strokeAdjust = false;
+ alphaIsShape = false;
+ textKnockout = false;
font = nullptr;
fontSize = 0;
@@ -6632,7 +6632,7 @@ GfxState::~GfxState() {
}
// Used for copy();
-GfxState::GfxState(const GfxState *state, GBool copyPath) {
+GfxState::GfxState(const GfxState *state, bool copyPath) {
int i;
memcpy(this, state, sizeof(GfxState));
@@ -7155,33 +7155,33 @@ GfxState *GfxState::restore() {
return oldState;
}
-GBool GfxState::parseBlendMode(Object *obj, GfxBlendMode *mode) {
+bool GfxState::parseBlendMode(Object *obj, GfxBlendMode *mode) {
int i, j;
if (obj->isName()) {
for (i = 0; i < nGfxBlendModeNames; ++i) {
if (!strcmp(obj->getName(), gfxBlendModeNames[i].name)) {
*mode = gfxBlendModeNames[i].mode;
- return gTrue;
+ return true;
}
}
- return gFalse;
+ return false;
} else if (obj->isArray()) {
for (i = 0; i < obj->arrayGetLength(); ++i) {
Object obj2 = obj->arrayGet(i);
if (!obj2.isName()) {
- return gFalse;
+ return false;
}
for (j = 0; j < nGfxBlendModeNames; ++j) {
if (!strcmp(obj2.getName(), gfxBlendModeNames[j].name)) {
*mode = gfxBlendModeNames[j].mode;
- return gTrue;
+ return true;
}
}
}
*mode = gfxBlendNormal;
- return gTrue;
+ return true;
} else {
- return gFalse;
+ return false;
}
}
diff --git a/poppler/GfxState.h b/poppler/GfxState.h
index cd8e3a12..f5f3d0ca 100644
--- a/poppler/GfxState.h
+++ b/poppler/GfxState.h
@@ -60,7 +60,7 @@ public:
void init(double xx, double yx, double xy, double yy, double x0, double y0) {
m[0] = xx; m[1] = yx; m[2] = xy; m[3] = yy; m[4] = x0; m[5] = y0;
}
- GBool invertTo(Matrix *other) const;
+ bool invertTo(Matrix *other) const;
void translate(double tx, double ty);
void scale(double sx, double sy);
void transform(double x, double y, double *tx, double *ty) const;
@@ -239,13 +239,13 @@ public:
virtual void createMapping(GooList *separationList, int maxSepComps);
// Does this ColorSpace support getRGBLine?
- virtual GBool useGetRGBLine() const { return gFalse; }
+ virtual bool useGetRGBLine() const { return false; }
// Does this ColorSpace support getGrayLine?
- virtual GBool useGetGrayLine() const { return gFalse; }
+ virtual bool useGetGrayLine() const { return false; }
// Does this ColorSpace support getCMYKLine?
- virtual GBool useGetCMYKLine() const { return gFalse; }
+ virtual bool useGetCMYKLine() const { return false; }
// Does this ColorSpace support getDeviceNLine?
- virtual GBool useGetDeviceNLine() const { return gFalse; }
+ virtual bool useGetDeviceNLine() const { return false; }
// Return the number of color components.
virtual int getNComps() const = 0;
@@ -260,7 +260,7 @@ public:
// Returns true if painting operations in this color space never
// mark the page (e.g., the "None" colorant).
- virtual GBool isNonMarking() const { return gFalse; }
+ virtual bool isNonMarking() const { return false; }
// Return the color space's overprint mask.
Guint getOverprintMask() const { return overprintMask; }
@@ -310,10 +310,10 @@ public:
void getCMYKLine(Guchar *in, Guchar *out, int length) override;
void getDeviceNLine(Guchar *in, Guchar *out, int length) override;
- GBool useGetRGBLine() const override { return gTrue; }
- GBool useGetGrayLine() const override { return gTrue; }
- GBool useGetCMYKLine() const override { return gTrue; }
- GBool useGetDeviceNLine() const override { return gTrue; }
+ bool useGetRGBLine() const override { return true; }
+ bool useGetGrayLine() const override { return true; }
+ bool useGetCMYKLine() const override { return true; }
+ bool useGetDeviceNLine() const override { return true; }
int getNComps() const override { return 1; }
void getDefaultColor(GfxColor *color) override;
@@ -388,10 +388,10 @@ public:
void getCMYKLine(Guchar *in, Guchar *out, int length) override;
void getDeviceNLine(Guchar *in, Guchar *out, int length) override;
- GBool useGetRGBLine() const override { return gTrue; }
- GBool useGetGrayLine() const override { return gTrue; }
- GBool useGetCMYKLine() const override { return gTrue; }
- GBool useGetDeviceNLine() const override { return gTrue; }
+ bool useGetRGBLine() const override { return true; }
+ bool useGetGrayLine() const override { return true; }
+ bool useGetCMYKLine() const override { return true; }
+ bool useGetDeviceNLine() const override { return true; }
int getNComps() const override { return 3; }
void getDefaultColor(GfxColor *color) override;
@@ -468,9 +468,9 @@ public:
void getRGBXLine(Guchar *in, Guchar *out, int length) override;
void getCMYKLine(Guchar *in, Guchar *out, int length) override;
void getDeviceNLine(Guchar *in, Guchar *out, int length) override;
- GBool useGetRGBLine() const override { return gTrue; }
- GBool useGetCMYKLine() const override { return gTrue; }
- GBool useGetDeviceNLine() const override { return gTrue; }
+ bool useGetRGBLine() const override { return true; }
+ bool useGetCMYKLine() const override { return true; }
+ bool useGetDeviceNLine() const override { return true; }
int getNComps() const override { return 4; }
void getDefaultColor(GfxColor *color) override;
@@ -554,9 +554,9 @@ public:
void getCMYKLine(Guchar *in, Guchar *out, int length) override;
void getDeviceNLine(Guchar *in, Guchar *out, int length) override;
- GBool useGetRGBLine() const override;
- GBool useGetCMYKLine() const override;
- GBool useGetDeviceNLine() const override;
+ bool useGetRGBLine() const override;
+ bool useGetCMYKLine() const override;
+ bool useGetDeviceNLine() const override;
int getNComps() const override { return nComps; }
void getDefaultColor(GfxColor *color) override;
@@ -606,9 +606,9 @@ public:
void getCMYKLine(Guchar *in, Guchar *out, int length) override;
void getDeviceNLine(Guchar *in, Guchar *out, int length) override;
- GBool useGetRGBLine() const override { return gTrue; }
- GBool useGetCMYKLine() const override { return gTrue; }
- GBool useGetDeviceNLine() const override { return gTrue; }
+ bool useGetRGBLine() const override { return true; }
+ bool useGetCMYKLine() const override { return true; }
+ bool useGetDeviceNLine() const override { return true; }
int getNComps() const override { return 1; }
void getDefaultColor(GfxColor *color) override;
@@ -659,7 +659,7 @@ public:
int getNComps() const override { return 1; }
void getDefaultColor(GfxColor *color) override;
- GBool isNonMarking() const override { return nonMarking; }
+ bool isNonMarking() const override { return nonMarking; }
// Separation-specific access.
GooString *getName() { return name; }
@@ -669,13 +669,13 @@ public:
private:
GfxSeparationColorSpace(GooString *nameA, GfxColorSpace *altA,
- Function *funcA, GBool nonMarkingA,
+ Function *funcA, bool nonMarkingA,
Guint overprintMaskA, int *mappingA);
GooString *name; // colorant name
GfxColorSpace *alt; // alternate color space
Function *func; // tint transform (into alternate color space)
- GBool nonMarking;
+ bool nonMarking;
};
//------------------------------------------------------------------------
@@ -704,7 +704,7 @@ public:
int getNComps() const override { return nComps; }
void getDefaultColor(GfxColor *color) override;
- GBool isNonMarking() const override { return nonMarking; }
+ bool isNonMarking() const override { return nonMarking; }
// DeviceN-specific access.
const GooString *getColorantName(int i) const { return names[i]; }
@@ -715,14 +715,14 @@ private:
GfxDeviceNColorSpace(int nCompsA, GooString **namesA,
GfxColorSpace *alt, Function *func, GooList *sepsCSA,
- int *mappingA, GBool nonMarkingA, Guint overprintMaskA);
+ int *mappingA, bool nonMarkingA, Guint overprintMaskA);
int nComps; // number of components
GooString // colorant names
*names[gfxColorMaxComps];
GfxColorSpace *alt; // alternate color space
Function *func; // tint transform (into alternate color space)
- GBool nonMarking;
+ bool nonMarking;
GooList *sepsCS; // list of separation cs for spot colorants;
};
@@ -867,14 +867,14 @@ public:
int getType() const { return type; }
GfxColorSpace *getColorSpace() { return colorSpace; }
const GfxColor *getBackground() const { return &background; }
- GBool getHasBackground() const { return hasBackground; }
+ bool getHasBackground() const { return hasBackground; }
void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA) const
{ *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
- GBool getHasBBox() const { return hasBBox; }
+ bool getHasBBox() const { return hasBBox; }
protected:
- GBool init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *state);
+ bool init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *state);
// 1: Function-based shading
// 2: Axial shading
@@ -884,8 +884,8 @@ protected:
// 6: Coons patch mesh
// 7: Tensor-product patch mesh
int type;
- GBool hasBackground;
- GBool hasBBox;
+ bool hasBackground;
+ bool hasBBox;
GfxColorSpace *colorSpace;
GfxColor background;
double xMin, yMin, xMax, yMax;
@@ -901,14 +901,14 @@ public:
GfxUnivariateShading(int typeA,
double t0A, double t1A,
Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A);
+ bool extend0A, bool extend1A);
GfxUnivariateShading(GfxUnivariateShading *shading);
~GfxUnivariateShading();
double getDomain0() const { return t0; }
double getDomain1() const { return t1; }
- GBool getExtend0() const { return extend0; }
- GBool getExtend1() const { return extend1; }
+ bool getExtend0() const { return extend0; }
+ bool getExtend1() const { return extend1; }
int getNFuncs() const { return nFuncs; }
const Function *getFunc(int i) const { return funcs[i]; }
// returns the nComps of the shading
@@ -930,7 +930,7 @@ private:
double t0, t1;
Function *funcs[gfxColorMaxComps];
int nFuncs;
- GBool extend0, extend1;
+ bool extend0, extend1;
int cacheSize, lastMatch;
double *cacheBounds;
@@ -982,7 +982,7 @@ public:
double x1A, double y1A,
double t0A, double t1A,
Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A);
+ bool extend0A, bool extend1A);
GfxAxialShading(GfxAxialShading *shading);
~GfxAxialShading();
@@ -1015,7 +1015,7 @@ public:
double x1A, double y1A, double r1A,
double t0A, double t1A,
Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A);
+ bool extend0A, bool extend1A);
GfxRadialShading(GfxRadialShading *shading);
~GfxRadialShading();
@@ -1192,7 +1192,7 @@ public:
GfxImageColorMap *copy() { return new GfxImageColorMap(this); }
// Is color map valid?
- GBool isOk() const { return ok; }
+ bool isOk() const { return ok; }
// Get the color space.
GfxColorSpace *getColorSpace() { return colorSpace; }
@@ -1223,7 +1223,7 @@ public:
void getColor(Guchar *x, GfxColor *color);
// Matte color ops
- void setMatteColor(const GfxColor *color) { useMatte = gTrue; matteColor = *color; }
+ void setMatteColor(const GfxColor *color) { useMatte = true; matteColor = *color; }
const GfxColor *getMatteColor() const { return (useMatte) ? &matteColor : nullptr; }
private:
@@ -1243,9 +1243,9 @@ private:
decodeLow[gfxColorMaxComps];
double // max - min value for each component
decodeRange[gfxColorMaxComps];
- GBool useMatte;
+ bool useMatte;
GfxColor matteColor;
- GBool ok;
+ bool ok;
};
//------------------------------------------------------------------------
@@ -1271,7 +1271,7 @@ public:
int getNumPoints() const { return n; }
double getX(int i) const { return x[i]; }
double getY(int i) const { return y[i]; }
- GBool getCurve(int i) const { return curve[i]; }
+ bool getCurve(int i) const { return curve[i]; }
void setX(int i, double a) { x[i] = a; }
void setY(int i, double a) { y[i] = a; }
@@ -1289,7 +1289,7 @@ public:
// Close the subpath.
void close();
- GBool isClosed() const { return closed; }
+ bool isClosed() const { return closed; }
// Add (<dx>, <dy>) to each point in the subpath.
void offset(double dx, double dy);
@@ -1297,11 +1297,11 @@ public:
private:
double *x, *y; // points
- GBool *curve; // curve[i] => point i is a control point
+ bool *curve; // curve[i] => point i is a control point
// for a Bezier curve
int n; // number of points
int size; // size of x/y arrays
- GBool closed; // set if path is closed
+ bool closed; // set if path is closed
GfxSubpath(const GfxSubpath *subpath);
};
@@ -1323,10 +1323,10 @@ public:
{ return new GfxPath(justMoved, firstX, firstY, subpaths, n, size); }
// Is there a current point?
- GBool isCurPt() const { return n > 0 || justMoved; }
+ bool isCurPt() const { return n > 0 || justMoved; }
// Is the path non-empty, i.e., is there at least one segment?
- GBool isPath() const { return n > 0; }
+ bool isPath() const { return n > 0; }
// Get subpaths.
int getNumSubpaths() const { return n; }
@@ -1357,13 +1357,13 @@ public:
private:
- GBool justMoved; // set if a new subpath was just started
+ bool justMoved; // set if a new subpath was just started
double firstX, firstY; // first point in new subpath
GfxSubpath **subpaths; // subpaths
int n; // number of subpaths
int size; // size of subpaths array
- GfxPath(GBool justMoved1, double firstX1, double firstY1,
+ GfxPath(bool justMoved1, double firstX1, double firstY1,
GfxSubpath **subpaths1, int n1, int size1);
};
@@ -1433,7 +1433,7 @@ public:
// x <vDPI>, page box <pageBox>, page rotation <rotateA>, and
// coordinate system specified by <upsideDown>.
GfxState(double hDPIA, double vDPIA, const PDFRectangle *pageBox,
- int rotateA, GBool upsideDown);
+ int rotateA, bool upsideDown);
// Destructor.
~GfxState();
@@ -1442,7 +1442,7 @@ public:
GfxState& operator=(const GfxState &) = delete;
// Copy.
- GfxState *copy(GBool copyPath = gFalse) const
+ GfxState *copy(bool copyPath = false) const
{ return new GfxState(this, copyPath); }
// Accessors.
@@ -1482,8 +1482,8 @@ public:
GfxBlendMode getBlendMode() const { return blendMode; }
double getFillOpacity() const { return fillOpacity; }
double getStrokeOpacity() const { return strokeOpacity; }
- GBool getFillOverprint() const { return fillOverprint; }
- GBool getStrokeOverprint() const { return strokeOverprint; }
+ bool getFillOverprint() const { return fillOverprint; }
+ bool getStrokeOverprint() const { return strokeOverprint; }
int getOverprintMode() const { return overprintMode; }
Function **getTransfer() { return transfer; }
double getLineWidth() const { return lineWidth; }
@@ -1493,9 +1493,9 @@ public:
int getLineJoin() const { return lineJoin; }
int getLineCap() const { return lineCap; }
double getMiterLimit() const { return miterLimit; }
- GBool getStrokeAdjust() const { return strokeAdjust; }
- GBool getAlphaIsShape() const { return alphaIsShape; }
- GBool getTextKnockout() const { return textKnockout; }
+ bool getStrokeAdjust() const { return strokeAdjust; }
+ bool getAlphaIsShape() const { return alphaIsShape; }
+ bool getTextKnockout() const { return textKnockout; }
GfxFont *getFont() { return font; }
double getFontSize() const { return fontSize; }
const double *getTextMat() const { return textMat; }
@@ -1517,8 +1517,8 @@ public:
double getLineY() const { return lineY; }
// Is there a current point/path?
- GBool isCurPt() const { return path->isCurPt(); }
- GBool isPath() const { return path->isPath(); }
+ bool isCurPt() const { return path->isCurPt(); }
+ bool isPath() const { return path->isPath(); }
// Transforms.
void transform(double x1, double y1, double *x2, double *y2)
@@ -1554,8 +1554,8 @@ public:
void setBlendMode(GfxBlendMode mode) { blendMode = mode; }
void setFillOpacity(double opac) { fillOpacity = opac; }
void setStrokeOpacity(double opac) { strokeOpacity = opac; }
- void setFillOverprint(GBool op) { fillOverprint = op; }
- void setStrokeOverprint(GBool op) { strokeOverprint = op; }
+ void setFillOverprint(bool op) { fillOverprint = op; }
+ void setStrokeOverprint(bool op) { strokeOverprint = op; }
void setOverprintMode(int op) { overprintMode = op; }
void setTransfer(Function **funcs);
void setLineWidth(double width) { lineWidth = width; }
@@ -1564,9 +1564,9 @@ public:
void setLineJoin(int lineJoin1) { lineJoin = lineJoin1; }
void setLineCap(int lineCap1) { lineCap = lineCap1; }
void setMiterLimit(double limit) { miterLimit = limit; }
- void setStrokeAdjust(GBool sa) { strokeAdjust = sa; }
- void setAlphaIsShape(GBool ais) { alphaIsShape = ais; }
- void setTextKnockout(GBool tk) { textKnockout = tk; }
+ void setStrokeAdjust(bool sa) { strokeAdjust = sa; }
+ void setAlphaIsShape(bool ais) { alphaIsShape = ais; }
+ void setTextKnockout(bool tk) { textKnockout = tk; }
void setFont(GfxFont *fontA, double fontSizeA);
void setTextMat(double a, double b, double c,
double d, double e, double f)
@@ -1620,11 +1620,11 @@ public:
// Push/pop GfxState on/off stack.
GfxState *save();
GfxState *restore();
- GBool hasSaves() const { return saved != nullptr; }
- GBool isParentState(GfxState *state) { return saved == state || (saved && saved->isParentState(state)); }
+ bool hasSaves() const { return saved != nullptr; }
+ bool isParentState(GfxState *state) { return saved == state || (saved && saved->isParentState(state)); }
// Misc
- GBool parseBlendMode(Object *obj, GfxBlendMode *mode);
+ bool parseBlendMode(Object *obj, GfxBlendMode *mode);
ReusablePathIterator *getReusablePath() { return new ReusablePathIterator(path); }
private:
@@ -1644,8 +1644,8 @@ private:
GfxBlendMode blendMode; // transparency blend mode
double fillOpacity; // fill opacity
double strokeOpacity; // stroke opacity
- GBool fillOverprint; // fill overprint
- GBool strokeOverprint; // stroke overprint
+ bool fillOverprint; // fill overprint
+ bool strokeOverprint; // stroke overprint
int overprintMode; // overprint mode
Function *transfer[4]; // transfer function (entries may be: all
// nullptr = identity; last three nullptr =
@@ -1660,9 +1660,9 @@ private:
int lineJoin; // line join style
int lineCap; // line cap style
double miterLimit; // line miter limit
- GBool strokeAdjust; // stroke adjustment
- GBool alphaIsShape; // alpha is shape
- GBool textKnockout; // text knockout
+ bool strokeAdjust; // stroke adjustment
+ bool alphaIsShape; // alpha is shape
+ bool textKnockout; // text knockout
GfxFont *font; // font
double fontSize; // font size
@@ -1684,7 +1684,7 @@ private:
GfxState *saved; // next GfxState on stack
- GfxState(const GfxState *state, GBool copyPath);
+ GfxState(const GfxState *state, bool copyPath);
#ifdef USE_CMS
void *localDisplayProfile;
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 0a1db73d..b0d5e5df 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -166,26 +166,26 @@ class SysFontInfo {
public:
GooString *name;
- GBool bold;
- GBool italic;
- GBool oblique;
- GBool fixedWidth;
+ bool bold;
+ bool italic;
+ bool oblique;
+ bool fixedWidth;
GooString *path;
SysFontType type;
int fontNum; // for TrueType collections
GooString *substituteName;
- SysFontInfo(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA,
+ SysFontInfo(GooString *nameA, bool boldA, bool italicA, bool obliqueA, bool fixedWidthA,
GooString *pathA, SysFontType typeA, int fontNumA, GooString *substituteNameA);
~SysFontInfo();
SysFontInfo(const SysFontInfo &) = delete;
SysFontInfo& operator=(const SysFontInfo&) = delete;
- GBool match(SysFontInfo *fi);
- GBool match(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA);
- GBool match(GooString *nameA, GBool boldA, GBool italicA);
+ bool match(SysFontInfo *fi);
+ bool match(GooString *nameA, bool boldA, bool italicA, bool obliqueA, bool fixedWidthA);
+ bool match(GooString *nameA, bool boldA, bool italicA);
};
-SysFontInfo::SysFontInfo(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA,
+SysFontInfo::SysFontInfo(GooString *nameA, bool boldA, bool italicA, bool obliqueA, bool fixedWidthA,
GooString *pathA, SysFontType typeA, int fontNumA, GooString *substituteNameA) {
name = nameA;
bold = boldA;
@@ -204,17 +204,17 @@ SysFontInfo::~SysFontInfo() {
delete substituteName;
}
-GBool SysFontInfo::match(SysFontInfo *fi) {
+bool SysFontInfo::match(SysFontInfo *fi) {
return !strcasecmp(name->getCString(), fi->name->getCString()) &&
bold == fi->bold && italic == fi->italic && oblique == fi->oblique && fixedWidth == fi->fixedWidth;
}
-GBool SysFontInfo::match(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA) {
+bool SysFontInfo::match(GooString *nameA, bool boldA, bool italicA, bool obliqueA, bool fixedWidthA) {
return !strcasecmp(name->getCString(), nameA->getCString()) &&
bold == boldA && italic == italicA && oblique == obliqueA && fixedWidth == fixedWidthA;
}
-GBool SysFontInfo::match(GooString *nameA, GBool boldA, GBool italicA) {
+bool SysFontInfo::match(GooString *nameA, bool boldA, bool italicA) {
return !strcasecmp(name->getCString(), nameA->getCString()) &&
bold == boldA && italic == italicA;
}
@@ -230,7 +230,7 @@ public:
~SysFontList();
SysFontList(const SysFontList &) = delete;
SysFontList& operator=(const SysFontList &) = delete;
- SysFontInfo *find(const GooString *name, GBool isFixedWidth, GBool exact);
+ SysFontInfo *find(const GooString *name, bool isFixedWidth, bool exact);
#ifdef _WIN32
void scanWindowsFonts(GooString *winFontDir);
@@ -256,9 +256,9 @@ SysFontList::~SysFontList() {
deleteGooList<SysFontInfo>(fonts);
}
-SysFontInfo *SysFontList::find(const GooString *name, GBool fixedWidth, GBool exact) {
+SysFontInfo *SysFontList::find(const GooString *name, bool fixedWidth, bool exact) {
GooString *name2;
- GBool bold, italic, oblique;
+ bool bold, italic, oblique;
SysFontInfo *fi;
char c;
int n, i;
@@ -292,28 +292,28 @@ SysFontInfo *SysFontList::find(const GooString *name, GBool fixedWidth, GBool ex
// look for "Italic"
if (n > 6 && !strcmp(name2->getCString() + n - 6, "Italic")) {
name2->del(n - 6, 6);
- italic = gTrue;
+ italic = true;
n -= 6;
} else {
- italic = gFalse;
+ italic = false;
}
// look for "Oblique"
if (n > 6 && !strcmp(name2->getCString() + n - 7, "Oblique")) {
name2->del(n - 7, 7);
- oblique = gTrue;
+ oblique = true;
n -= 6;
} else {
- oblique = gFalse;
+ oblique = false;
}
// look for "Bold"
if (n > 4 && !strcmp(name2->getCString() + n - 4, "Bold")) {
name2->del(n - 4, 4);
- bold = gTrue;
+ bold = true;
n -= 4;
} else {
- bold = gFalse;
+ bold = false;
}
// remove trailing "MT" (FooMT-Bold, etc.)
@@ -347,7 +347,7 @@ SysFontInfo *SysFontList::find(const GooString *name, GBool fixedWidth, GBool ex
// try ignoring the bold flag
for (i = 0; i < fonts->getLength(); ++i) {
fi = (SysFontInfo *)fonts->get(i);
- if (fi->match(name2, gFalse, italic)) {
+ if (fi->match(name2, false, italic)) {
break;
}
fi = nullptr;
@@ -357,7 +357,7 @@ SysFontInfo *SysFontList::find(const GooString *name, GBool fixedWidth, GBool ex
// try ignoring the bold and italic flags
for (i = 0; i < fonts->getLength(); ++i) {
fi = (SysFontInfo *)fonts->get(i);
- if (fi->match(name2, gFalse, gFalse)) {
+ if (fi->match(name2, false, false)) {
break;
}
fi = nullptr;
@@ -395,8 +395,8 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
nameToUnicodeText = new NameToCharCode();
toUnicodeDirs = new GooList();
sysFonts = new SysFontList();
- psExpandSmaller = gFalse;
- psShrinkLarger = gTrue;
+ psExpandSmaller = false;
+ psShrinkLarger = true;
psLevel = psLevel2;
textEncoding = new GooString("UTF-8");
#if defined(_WIN32)
@@ -406,12 +406,12 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
#else
textEOL = eolUnix;
#endif
- textPageBreaks = gTrue;
- enableFreeType = gTrue;
- overprintPreview = gFalse;
- printCommands = gFalse;
- profileCommands = gFalse;
- errQuiet = gFalse;
+ textPageBreaks = true;
+ enableFreeType = true;
+ overprintPreview = false;
+ printCommands = false;
+ profileCommands = false;
+ errQuiet = false;
cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
unicodeToUnicodeCache =
@@ -419,7 +419,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
unicodeMapCache = new UnicodeMapCache();
cMapCache = new CMapCache();
- baseFontsInitialized = gFalse;
+ baseFontsInitialized = false;
// set up the initial nameToUnicode tables
for (int i = 0; nameToUnicodeZapfDingbatsTab[i].name; ++i) {
@@ -432,17 +432,17 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
// set up the residentUnicodeMaps table
residentUnicodeMaps.reserve(6);
- UnicodeMap map = {"Latin1", gFalse, latin1UnicodeMapRanges, latin1UnicodeMapLen};
+ UnicodeMap map = {"Latin1", false, latin1UnicodeMapRanges, latin1UnicodeMapLen};
residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
- map = {"ASCII7", gFalse, ascii7UnicodeMapRanges, ascii7UnicodeMapLen};
+ map = {"ASCII7", false, ascii7UnicodeMapRanges, ascii7UnicodeMapLen};
residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
- map = {"Symbol", gFalse, symbolUnicodeMapRanges, symbolUnicodeMapLen};
+ map = {"Symbol", false, symbolUnicodeMapRanges, symbolUnicodeMapLen};
residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
- map = {"ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges, zapfDingbatsUnicodeMapLen};
+ map = {"ZapfDingbats", false, zapfDingbatsUnicodeMapRanges, zapfDingbatsUnicodeMapLen};
residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
- map = {"UTF-8", gTrue, &mapUTF8};
+ map = {"UTF-8", true, &mapUTF8};
residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
- map = {"UTF-16", gTrue, &mapUTF16};
+ map = {"UTF-16", true, &mapUTF16};
residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
scanEncodingDirs();
@@ -458,7 +458,7 @@ void GlobalParams::scanEncodingDirs() {
char *dataPathBuffer = new char[bufSize];
snprintf(dataPathBuffer, bufSize, "%s/nameToUnicode", dataRoot);
- dir = new GDir(dataPathBuffer, gTrue);
+ dir = new GDir(dataPathBuffer, true);
while (entry = dir->getNextEntry(), entry != nullptr) {
if (!entry->isDir()) {
parseNameToUnicode(entry->getFullPath());
@@ -468,7 +468,7 @@ void GlobalParams::scanEncodingDirs() {
delete dir;
snprintf(dataPathBuffer, bufSize, "%s/cidToUnicode", dataRoot);
- dir = new GDir(dataPathBuffer, gFalse);
+ dir = new GDir(dataPathBuffer, false);
while (entry = dir->getNextEntry(), entry != nullptr) {
addCIDToUnicode(entry->getName(), entry->getFullPath());
delete entry;
@@ -476,7 +476,7 @@ void GlobalParams::scanEncodingDirs() {
delete dir;
snprintf(dataPathBuffer, bufSize, "%s/unicodeMap", dataRoot);
- dir = new GDir(dataPathBuffer, gFalse);
+ dir = new GDir(dataPathBuffer, false);
while (entry = dir->getNextEntry(), entry != nullptr) {
addUnicodeMap(entry->getName(), entry->getFullPath());
delete entry;
@@ -484,7 +484,7 @@ void GlobalParams::scanEncodingDirs() {
delete dir;
snprintf(dataPathBuffer, bufSize, "%s/cMap", dataRoot);
- dir = new GDir(dataPathBuffer, gFalse);
+ dir = new GDir(dataPathBuffer, false);
while (entry = dir->getNextEntry(), entry != nullptr) {
addCMapDir(entry->getName(), entry->getFullPath());
toUnicodeDirs->push_back(entry->getFullPath()->copy());
@@ -536,15 +536,15 @@ void GlobalParams::addCMapDir(const GooString *collection, const GooString *dir)
cMapDirs.emplace(collection->toStr(), dir->toStr());
}
-GBool GlobalParams::parseYesNo2(const char *token, GBool *flag) {
+bool GlobalParams::parseYesNo2(const char *token, bool *flag) {
if (!strcmp(token, "yes")) {
- *flag = gTrue;
+ *flag = true;
} else if (!strcmp(token, "no")) {
- *flag = gFalse;
+ *flag = false;
} else {
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
GlobalParams::~GlobalParams() {
@@ -648,21 +648,21 @@ FILE *GlobalParams::findToUnicodeFile(const GooString *name) {
}
#ifdef WITH_FONTCONFIGURATION_FONTCONFIG
-static GBool findModifier(const char *name, const char *modifier, const char **start)
+static bool findModifier(const char *name, const char *modifier, const char **start)
{
const char *match;
if (name == nullptr)
- return gFalse;
+ return false;
match = strstr(name, modifier);
if (match) {
if (*start == nullptr || match < *start)
*start = match;
- return gTrue;
+ return true;
}
else {
- return gFalse;
+ return false;
}
}
@@ -857,7 +857,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
globalParamsLocker();
- if ((fi = sysFonts->find(fontName, font->isFixedWidth(), gTrue))) {
+ if ((fi = sysFonts->find(fontName, font->isFixedWidth(), true))) {
path = fi->path->copy();
*type = fi->type;
*fontNum = fi->fontNum;
@@ -932,20 +932,20 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext, ".ttc", 4) || !strncasecmp(ext, ".otf", 4))
{
int weight, slant;
- GBool bold = font->isBold();
- GBool italic = font->isItalic();
- GBool oblique = gFalse;
+ bool bold = font->isBold();
+ bool italic = font->isItalic();
+ bool oblique = false;
FcPatternGetInteger(set->fonts[i], FC_WEIGHT, 0, &weight);
FcPatternGetInteger(set->fonts[i], FC_SLANT, 0, &slant);
if (weight == FC_WEIGHT_DEMIBOLD || weight == FC_WEIGHT_BOLD
|| weight == FC_WEIGHT_EXTRABOLD || weight == FC_WEIGHT_BLACK)
{
- bold = gTrue;
+ bold = true;
}
if (slant == FC_SLANT_ITALIC)
- italic = gTrue;
+ italic = true;
if (slant == FC_SLANT_OBLIQUE)
- oblique = gTrue;
+ oblique = true;
*fontNum = 0;
*type = (!strncasecmp(ext,".ttc",4)) ? sysFontTTC : sysFontTTF;
FcPatternGetInteger(set->fonts[i], FC_INDEX, 0, fontNum);
@@ -957,20 +957,20 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4))
{
int weight, slant;
- GBool bold = font->isBold();
- GBool italic = font->isItalic();
- GBool oblique = gFalse;
+ bool bold = font->isBold();
+ bool italic = font->isItalic();
+ bool oblique = false;
FcPatternGetInteger(set->fonts[i], FC_WEIGHT, 0, &weight);
FcPatternGetInteger(set->fonts[i], FC_SLANT, 0, &slant);
if (weight == FC_WEIGHT_DEMIBOLD || weight == FC_WEIGHT_BOLD
|| weight == FC_WEIGHT_EXTRABOLD || weight == FC_WEIGHT_BLACK)
{
- bold = gTrue;
+ bold = true;
}
if (slant == FC_SLANT_ITALIC)
- italic = gTrue;
+ italic = true;
if (slant == FC_SLANT_OBLIQUE)
- oblique = gTrue;
+ oblique = true;
*fontNum = 0;
*type = (!strncasecmp(ext,".pfa",4)) ? sysFontPFA : sysFontPFB;
FcPatternGetInteger(set->fonts[i], FC_INDEX, 0, fontNum);
@@ -993,7 +993,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
}
FcFontSetDestroy(set);
}
- if (path == nullptr && (fi = sysFonts->find(fontName, font->isFixedWidth(), gFalse))) {
+ if (path == nullptr && (fi = sysFonts->find(fontName, font->isFixedWidth(), false))) {
path = fi->path->copy();
*type = fi->type;
*fontNum = fi->fontNum;
@@ -1104,7 +1104,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
path = nullptr;
globalParamsLocker();
- if ((fi = sysFonts->find(fontName, font->isFixedWidth(), gFalse))) {
+ if ((fi = sysFonts->find(fontName, font->isFixedWidth(), false))) {
path = fi->path->copy();
*type = fi->type;
*fontNum = fi->fontNum;
@@ -1114,12 +1114,12 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
}
#endif
-GBool GlobalParams::getPSExpandSmaller() {
+bool GlobalParams::getPSExpandSmaller() {
globalParamsLocker();
return psExpandSmaller;
}
-GBool GlobalParams::getPSShrinkLarger() {
+bool GlobalParams::getPSShrinkLarger() {
globalParamsLocker();
return psShrinkLarger;
}
@@ -1139,27 +1139,27 @@ EndOfLineKind GlobalParams::getTextEOL() {
return textEOL;
}
-GBool GlobalParams::getTextPageBreaks() {
+bool GlobalParams::getTextPageBreaks() {
globalParamsLocker();
return textPageBreaks;
}
-GBool GlobalParams::getEnableFreeType() {
+bool GlobalParams::getEnableFreeType() {
globalParamsLocker();
return enableFreeType;
}
-GBool GlobalParams::getPrintCommands() {
+bool GlobalParams::getPrintCommands() {
globalParamsLocker();
return printCommands;
}
-GBool GlobalParams::getProfileCommands() {
+bool GlobalParams::getProfileCommands() {
globalParamsLocker();
return profileCommands;
}
-GBool GlobalParams::getErrQuiet() {
+bool GlobalParams::getErrQuiet() {
// no locking -- this function may get called from inside a locked
// section
return errQuiet;
@@ -1226,12 +1226,12 @@ void GlobalParams::addFontFile(GooString *fontName, GooString *path) {
fontFiles[fontName->toStr()] = path->toStr();
}
-void GlobalParams::setPSExpandSmaller(GBool expand) {
+void GlobalParams::setPSExpandSmaller(bool expand) {
globalParamsLocker();
psExpandSmaller = expand;
}
-void GlobalParams::setPSShrinkLarger(GBool shrink) {
+void GlobalParams::setPSShrinkLarger(bool shrink) {
globalParamsLocker();
psShrinkLarger = shrink;
}
@@ -1247,7 +1247,7 @@ void GlobalParams::setTextEncoding(char *encodingName) {
textEncoding = new GooString(encodingName);
}
-GBool GlobalParams::setTextEOL(char *s) {
+bool GlobalParams::setTextEOL(char *s) {
globalParamsLocker();
if (!strcmp(s, "unix")) {
textEOL = eolUnix;
@@ -1256,37 +1256,37 @@ GBool GlobalParams::setTextEOL(char *s) {
} else if (!strcmp(s, "mac")) {
textEOL = eolMac;
} else {
- return gFalse;
+ return false;
}
- return gTrue;
+ return true;
}
-void GlobalParams::setTextPageBreaks(GBool pageBreaks) {
+void GlobalParams::setTextPageBreaks(bool pageBreaks) {
globalParamsLocker();
textPageBreaks = pageBreaks;
}
-GBool GlobalParams::setEnableFreeType(char *s) {
+bool GlobalParams::setEnableFreeType(char *s) {
globalParamsLocker();
return parseYesNo2(s, &enableFreeType);
}
-void GlobalParams::setOverprintPreview(GBool overprintPreviewA) {
+void GlobalParams::setOverprintPreview(bool overprintPreviewA) {
globalParamsLocker();
overprintPreview = overprintPreviewA;
}
-void GlobalParams::setPrintCommands(GBool printCommandsA) {
+void GlobalParams::setPrintCommands(bool printCommandsA) {
globalParamsLocker();
printCommands = printCommandsA;
}
-void GlobalParams::setProfileCommands(GBool profileCommandsA) {
+void GlobalParams::setProfileCommands(bool profileCommandsA) {
globalParamsLocker();
profileCommands = profileCommandsA;
}
-void GlobalParams::setErrQuiet(GBool errQuietA) {
+void GlobalParams::setErrQuiet(bool errQuietA) {
globalParamsLocker();
errQuiet = errQuietA;
}
diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h
index 4f477dea..4c0b28d9 100644
--- a/poppler/GlobalParams.h
+++ b/poppler/GlobalParams.h
@@ -129,17 +129,17 @@ public:
GooString *findSystemFontFile(GfxFont *font, SysFontType *type,
int *fontNum, GooString *substituteFontName = nullptr,
const GooString *base14Name = nullptr);
- GBool getPSExpandSmaller();
- GBool getPSShrinkLarger();
+ bool getPSExpandSmaller();
+ bool getPSShrinkLarger();
PSLevel getPSLevel();
GooString *getTextEncodingName();
EndOfLineKind getTextEOL();
- GBool getTextPageBreaks();
- GBool getEnableFreeType();
- GBool getOverprintPreview() { return overprintPreview; }
- GBool getPrintCommands();
- GBool getProfileCommands();
- GBool getErrQuiet();
+ bool getTextPageBreaks();
+ bool getEnableFreeType();
+ bool getOverprintPreview() { return overprintPreview; }
+ bool getPrintCommands();
+ bool getProfileCommands();
+ bool getErrQuiet();
CharCodeToUnicode *getCIDToUnicode(GooString *collection);
UnicodeMap *getUnicodeMap(GooString *encodingName);
@@ -150,19 +150,19 @@ public:
//----- functions to set parameters
void addFontFile(GooString *fontName, GooString *path);
- void setPSExpandSmaller(GBool expand);
- void setPSShrinkLarger(GBool shrink);
+ void setPSExpandSmaller(bool expand);
+ void setPSShrinkLarger(bool shrink);
void setPSLevel(PSLevel level);
void setTextEncoding(char *encodingName);
- GBool setTextEOL(char *s);
- void setTextPageBreaks(GBool pageBreaks);
- GBool setEnableFreeType(char *s);
- void setOverprintPreview(GBool overprintPreviewA);
- void setPrintCommands(GBool printCommandsA);
- void setProfileCommands(GBool profileCommandsA);
- void setErrQuiet(GBool errQuietA);
+ bool setTextEOL(char *s);
+ void setTextPageBreaks(bool pageBreaks);
+ bool setEnableFreeType(char *s);
+ void setOverprintPreview(bool overprintPreviewA);
+ void setPrintCommands(bool printCommandsA);
+ void setProfileCommands(bool profileCommandsA);
+ void setErrQuiet(bool errQuietA);
- static GBool parseYesNo2(const char *token, GBool *flag);
+ static bool parseYesNo2(const char *token, bool *flag);
private:
@@ -197,7 +197,7 @@ private:
// list of CMap dirs, indexed by collection
std::unordered_multimap<std::string, std::string> cMapDirs;
GooList *toUnicodeDirs; // list of ToUnicode CMap dirs [GooString]
- GBool baseFontsInitialized;
+ bool baseFontsInitialized;
#ifdef _WIN32
// windows font substitutes (for CID fonts)
std::unordered_map<std::string, std::string> substFiles;
@@ -205,19 +205,19 @@ private:
// font files: font name mapped to path
std::unordered_map<std::string, std::string> fontFiles;
SysFontList *sysFonts; // system fonts
- GBool psExpandSmaller; // expand smaller pages to fill paper
- GBool psShrinkLarger; // shrink larger pages to fit paper
+ bool psExpandSmaller; // expand smaller pages to fill paper
+ bool psShrinkLarger; // shrink larger pages to fit paper
PSLevel psLevel; // PostScript level to generate
GooString *textEncoding; // encoding (unicodeMap) to use for text
// output
EndOfLineKind textEOL; // type of EOL marker to use for text
// output
- GBool textPageBreaks; // insert end-of-page markers?
- GBool enableFreeType; // FreeType enable flag
- GBool overprintPreview; // enable overprint preview
- GBool printCommands; // print the drawing commands
- GBool profileCommands; // profile the drawing commands
- GBool errQuiet; // suppress error messages?
+ bool textPageBreaks; // insert end-of-page markers?
+ bool enableFreeType; // FreeType enable flag
+ bool overprintPreview; // enable overprint preview
+ bool printCommands; // print the drawing commands
+ bool profileCommands; // profile the drawing commands
+ bool errQuiet; // suppress error messages?
CharCodeToUnicodeCache *cidToUnicodeCache;
CharCodeToUnicodeCache *unicodeToUnicodeCache;
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index f975483c..2df46aef 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -62,98 +62,98 @@ static const struct {
const char *name;
const char *t1FileName;
const char *ttFileName;
- GBool warnIfMissing;
+ bool warnIfMissing;
} displayFontTab[] = {
- {"Courier", "n022003l.pfb", "cour.ttf", gTrue},
- {"Courier-Bold", "n022004l.pfb", "courbd.ttf", gTrue},
- {"Courier-BoldOblique", "n022024l.pfb", "courbi.ttf", gTrue},
- {"Courier-Oblique", "n022023l.pfb", "couri.ttf", gTrue},
- {"Helvetica", "n019003l.pfb", "arial.ttf", gTrue},
- {"Helvetica-Bold", "n019004l.pfb", "arialbd.ttf", gTrue},
- {"Helvetica-BoldOblique", "n019024l.pfb", "arialbi.ttf", gTrue},
- {"Helvetica-Oblique", "n019023l.pfb", "ariali.ttf", gTrue},
+ {"Courier", "n022003l.pfb", "cour.ttf", true},
+ {"Courier-Bold", "n022004l.pfb", "courbd.ttf", true},
+ {"Courier-BoldOblique", "n022024l.pfb", "courbi.ttf", true},
+ {"Courier-Oblique", "n022023l.pfb", "couri.ttf", true},
+ {"Helvetica", "n019003l.pfb", "arial.ttf", true},
+ {"Helvetica-Bold", "n019004l.pfb", "arialbd.ttf", true},
+ {"Helvetica-BoldOblique", "n019024l.pfb", "arialbi.ttf", true},
+ {"Helvetica-Oblique", "n019023l.pfb", "ariali.ttf", true},
// TODO: not sure if "symbol.ttf" is right
- {"Symbol", "s050000l.pfb", "symbol.ttf", gTrue},
- {"Times-Bold", "n021004l.pfb", "timesbd.ttf", gTrue},
- {"Times-BoldItalic", "n021024l.pfb", "timesbi.ttf", gTrue},
- {"Times-Italic", "n021023l.pfb", "timesi.ttf", gTrue},
- {"Times-Roman", "n021003l.pfb", "times.ttf", gTrue},
+ {"Symbol", "s050000l.pfb", "symbol.ttf", true},
+ {"Times-Bold", "n021004l.pfb", "timesbd.ttf", true},
+ {"Times-BoldItalic", "n021024l.pfb", "timesbi.ttf", true},
+ {"Times-Italic", "n021023l.pfb", "timesi.ttf", true},
+ {"Times-Roman", "n021003l.pfb", "times.ttf", true},
// TODO: not sure if "wingding.ttf" is right
- {"ZapfDingbats", "d050000l.pfb", "wingding.ttf", gTrue},
+ {"ZapfDingbats", "d050000l.pfb", "wingding.ttf", true},
// those seem to be frequently accessed by PDF files and I kind of guess
// which font file do the refer to
- {"Palatino", nullptr, "pala.ttf", gTrue},
- {"Palatino-Roman", nullptr, "pala.ttf", gTrue},
- {"Palatino-Bold", nullptr, "palab.ttf", gTrue},
- {"Palatino-Italic", nullptr, "palai.ttf", gTrue},
- {"Palatino,Italic", nullptr, "palai.ttf", gTrue},
- {"Palatino-BoldItalic", nullptr, "palabi.ttf", gTrue},
-
- {"ArialBlack", nullptr, "arialbd.ttf", gTrue},
-
- {"ArialNarrow", nullptr, "arialn.ttf", gTrue},
- {"ArialNarrow,Bold", nullptr, "arialnb.ttf", gTrue},
- {"ArialNarrow,Italic", nullptr, "arialni.ttf", gTrue},
- {"ArialNarrow,BoldItalic", nullptr, "arialnbi.ttf", gTrue},
- {"ArialNarrow-Bold", nullptr, "arialnb.ttf", gTrue},
- {"ArialNarrow-Italic", nullptr, "arialni.ttf", gTrue},
- {"ArialNarrow-BoldItalic", nullptr, "arialnbi.ttf", gTrue},
-
- {"HelveticaNarrow", nullptr, "arialn.ttf", gTrue},
- {"HelveticaNarrow,Bold", nullptr, "arialnb.ttf", gTrue},
- {"HelveticaNarrow,Italic", nullptr, "arialni.ttf", gTrue},
- {"HelveticaNarrow,BoldItalic", nullptr, "arialnbi.ttf", gTrue},
- {"HelveticaNarrow-Bold", nullptr, "arialnb.ttf", gTrue},
- {"HelveticaNarrow-Italic", nullptr, "arialni.ttf", gTrue},
- {"HelveticaNarrow-BoldItalic", nullptr, "arialnbi.ttf", gTrue},
-
- {"BookAntiqua", nullptr, "bkant.ttf", gTrue},
- {"BookAntiqua,Bold", nullptr, "bkant.ttf", gTrue},
- {"BookAntiqua,Italic", nullptr, "bkant.ttf", gTrue},
- {"BookAntiqua,BoldItalic", nullptr, "bkant.ttf", gTrue},
- {"BookAntiqua-Bold", nullptr, "bkant.ttf", gTrue},
- {"BookAntiqua-Italic", nullptr, "bkant.ttf", gTrue},
- {"BookAntiqua-BoldItalic", nullptr, "bkant.ttf", gTrue},
-
- {"Verdana", nullptr, "verdana.ttf", gTrue},
- {"Verdana,Bold", nullptr, "verdanab.ttf", gTrue},
- {"Verdana,Italic", nullptr, "verdanai.ttf", gTrue},
- {"Verdana,BoldItalic", nullptr, "verdanaz.ttf", gTrue},
- {"Verdana-Bold", nullptr, "verdanab.ttf", gTrue},
- {"Verdana-Italic", nullptr, "verdanai.ttf", gTrue},
- {"Verdana-BoldItalic", nullptr, "verdanaz.ttf", gTrue},
-
- {"Tahoma", nullptr, "tahoma.ttf", gTrue},
- {"Tahoma,Bold", nullptr, "tahomabd.ttf", gTrue},
- {"Tahoma,Italic", nullptr, "tahoma.ttf", gTrue},
- {"Tahoma,BoldItalic", nullptr, "tahomabd.ttf", gTrue},
- {"Tahoma-Bold", nullptr, "tahomabd.ttf", gTrue},
- {"Tahoma-Italic", nullptr, "tahoma.ttf", gTrue},
- {"Tahoma-BoldItalic", nullptr, "tahomabd.ttf", gTrue},
-
- {"CCRIKH+Verdana", nullptr, "verdana.ttf", gTrue},
- {"CCRIKH+Verdana,Bold", nullptr, "verdanab.ttf", gTrue},
- {"CCRIKH+Verdana,Italic", nullptr, "verdanai.ttf", gTrue},
- {"CCRIKH+Verdana,BoldItalic", nullptr, "verdanaz.ttf", gTrue},
- {"CCRIKH+Verdana-Bold", nullptr, "verdanab.ttf", gTrue},
- {"CCRIKH+Verdana-Italic", nullptr, "verdanai.ttf", gTrue},
- {"CCRIKH+Verdana-BoldItalic", nullptr, "verdanaz.ttf", gTrue},
-
- {"Georgia", nullptr, "georgia.ttf", gTrue},
- {"Georgia,Bold", nullptr, "georgiab.ttf", gTrue},
- {"Georgia,Italic", nullptr, "georgiai.ttf", gTrue},
- {"Georgia,BoldItalic", nullptr, "georgiaz.ttf", gTrue},
- {"Georgia-Bold", nullptr, "georgiab.ttf", gTrue},
- {"Georgia-Italic", nullptr, "georgiai.ttf", gTrue},
- {"Georgia-BoldItalic", nullptr, "georgiaz.ttf", gTrue},
+ {"Palatino", nullptr, "pala.ttf", true},
+ {"Palatino-Roman", nullptr, "pala.ttf", true},
+ {"Palatino-Bold", nullptr, "palab.ttf", true},
+ {"Palatino-Italic", nullptr, "palai.ttf", true},
+ {"Palatino,Italic", nullptr, "palai.ttf", true},
+ {"Palatino-BoldItalic", nullptr, "palabi.ttf", true},
+
+ {"ArialBlack", nullptr, "arialbd.ttf", true},
+
+ {"ArialNarrow", nullptr, "arialn.ttf", true},
+ {"ArialNarrow,Bold", nullptr, "arialnb.ttf", true},
+ {"ArialNarrow,Italic", nullptr, "arialni.ttf", true},
+ {"ArialNarrow,BoldItalic", nullptr, "arialnbi.ttf", true},
+ {"ArialNarrow-Bold", nullptr, "arialnb.ttf", true},
+ {"ArialNarrow-Italic", nullptr, "arialni.ttf", true},
+ {"ArialNarrow-BoldItalic", nullptr, "arialnbi.ttf", true},
+
+ {"HelveticaNarrow", nullptr, "arialn.ttf", true},
+ {"HelveticaNarrow,Bold", nullptr, "arialnb.ttf", true},
+ {"HelveticaNarrow,Italic", nullptr, "arialni.ttf", true},
+ {"HelveticaNarrow,BoldItalic", nullptr, "arialnbi.ttf", true},
+ {"HelveticaNarrow-Bold", nullptr, "arialnb.ttf", true},
+ {"HelveticaNarrow-Italic", nullptr, "arialni.ttf", true},
+ {"HelveticaNarrow-BoldItalic", nullptr, "arialnbi.ttf", true},
+
+ {"BookAntiqua", nullptr, "bkant.ttf", true},
+ {"BookAntiqua,Bold", nullptr, "bkant.ttf", true},
+ {"BookAntiqua,Italic", nullptr, "bkant.ttf", true},
+ {"BookAntiqua,BoldItalic", nullptr, "bkant.ttf", true},
+ {"BookAntiqua-Bold", nullptr, "bkant.ttf", true},
+ {"BookAntiqua-Italic", nullptr, "bkant.ttf", true},
+ {"BookAntiqua-BoldItalic", nullptr, "bkant.ttf", true},
+
+ {"Verdana", nullptr, "verdana.ttf", true},
+ {"Verdana,Bold", nullptr, "verdanab.ttf", true},
+ {"Verdana,Italic", nullptr, "verdanai.ttf", true},
+ {"Verdana,BoldItalic", nullptr, "verdanaz.ttf", true},
+ {"Verdana-Bold", nullptr, "verdanab.ttf", true},
+ {"Verdana-Italic", nullptr, "verdanai.ttf", true},
+ {"Verdana-BoldItalic", nullptr, "verdanaz.ttf", true},
+
+ {"Tahoma", nullptr, "tahoma.ttf", true},
+ {"Tahoma,Bold", nullptr, "tahomabd.ttf", true},
+ {"Tahoma,Italic", nullptr, "tahoma.ttf", true},
+ {"Tahoma,BoldItalic", nullptr, "tahomabd.ttf", true},
+ {"Tahoma-Bold", nullptr, "tahomabd.ttf", true},
+ {"Tahoma-Italic", nullptr, "tahoma.ttf", true},
+ {"Tahoma-BoldItalic", nullptr, "tahomabd.ttf", true},
+
+ {"CCRIKH+Verdana", nullptr, "verdana.ttf", true},
+ {"CCRIKH+Verdana,Bold", nullptr, "verdanab.ttf", true},
+ {"CCRIKH+Verdana,Italic", nullptr, "verdanai.ttf", true},
+ {"CCRIKH+Verdana,BoldItalic", nullptr, "verdanaz.ttf", true},
+ {"CCRIKH+Verdana-Bold", nullptr, "verdanab.ttf", true},
+ {"CCRIKH+Verdana-Italic", nullptr, "verdanai.ttf", true},
+ {"CCRIKH+Verdana-BoldItalic", nullptr, "verdanaz.ttf", true},
+
+ {"Georgia", nullptr, "georgia.ttf", true},
+ {"Georgia,Bold", nullptr, "georgiab.ttf", true},
+ {"Georgia,Italic", nullptr, "georgiai.ttf", true},
+ {"Georgia,BoldItalic", nullptr, "georgiaz.ttf", true},
+ {"Georgia-Bold", nullptr, "georgiab.ttf", true},
+ {"Georgia-Italic", nullptr, "georgiai.ttf", true},
+ {"Georgia-BoldItalic", nullptr, "georgiaz.ttf", true},
// fallback for Adobe CID fonts:
- {"MingLiU", nullptr, "mingliu.ttf", gFalse},
- {"SimSun", nullptr, "simsun.ttf", gFalse},
- {"MS-Mincho", nullptr, "msmincho.ttf", gFalse},
- {"Batang", nullptr, "batang.ttf", gFalse},
- {"ArialUnicode", nullptr, "arialuni.ttf", gTrue},
+ {"MingLiU", nullptr, "mingliu.ttf", false},
+ {"SimSun", nullptr, "simsun.ttf", false},
+ {"MS-Mincho", nullptr, "msmincho.ttf", false},
+ {"Batang", nullptr, "batang.ttf", false},
+ {"ArialUnicode", nullptr, "arialuni.ttf", true},
{ }
};
@@ -294,7 +294,7 @@ void SysFontList::scanWindowsFonts(GooString *winFontDir) {
SysFontInfo *SysFontList::makeWindowsFont(const char *name, int fontNum,
const char *path) {
int n;
- GBool bold, italic, oblique, fixedWidth;
+ bool bold, italic, oblique, fixedWidth;
GooString *s;
char c;
int i;
@@ -302,7 +302,7 @@ SysFontInfo *SysFontList::makeWindowsFont(const char *name, int fontNum,
GooString substituteName;
n = strlen(name);
- bold = italic = oblique = fixedWidth = gFalse;
+ bold = italic = oblique = fixedWidth = false;
// remove trailing ' (TrueType)'
if (n > 11 && !strncmp(name + n - 11, " (TrueType)", 11)) {
@@ -317,19 +317,19 @@ SysFontInfo *SysFontList::makeWindowsFont(const char *name, int fontNum,
// remove trailing ' Italic'
if (n > 7 && !strncmp(name + n - 7, " Italic", 7)) {
n -= 7;
- italic = gTrue;
+ italic = true;
}
// remove trailing ' Oblique'
if (n > 7 && !strncmp(name + n - 8, " Oblique", 8)) {
n -= 8;
- oblique = gTrue;
+ oblique = true;
}
// remove trailing ' Bold'
if (n > 5 && !strncmp(name + n - 5, " Bold", 5)) {
n -= 5;
- bold = gTrue;
+ bold = true;
}
// remove trailing ' Regular'
@@ -343,9 +343,9 @@ SysFontInfo *SysFontList::makeWindowsFont(const char *name, int fontNum,
strstr(name, "Fixed") ||
(strstr(name, "Mono") && !strstr(name, "Monotype")) ||
strstr(name, "Typewriter") )
- fixedWidth = gTrue;
+ fixedWidth = true;
else
- fixedWidth = gFalse;
+ fixedWidth = false;
//----- normalize the font name
@@ -447,8 +447,8 @@ void GlobalParams::setupBaseFonts(char * dir)
Parser *parser;
parser = new Parser(nullptr,
new Lexer(nullptr,
- new FileStream(file, 0, gFalse, file->size(), Object(objNull))),
- gTrue);
+ new FileStream(file, 0, false, file->size(), Object(objNull))),
+ true);
Object obj1 = parser->getObj();
while (!obj1.isEOF()) {
Object obj2 = parser->getObj();
@@ -543,7 +543,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
// In the system using FontConfig, findSystemFontFile() uses
// base14Name only for the creation of query pattern.
- if ((fi = sysFonts->find(fontName, gFalse, gFalse))) {
+ if ((fi = sysFonts->find(fontName, false, false))) {
path = fi->path->copy();
*type = fi->type;
*fontNum = fi->fontNum;
diff --git a/poppler/Hints.cc b/poppler/Hints.cc
index a231ba34..57daa235 100644
--- a/poppler/Hints.cc
+++ b/poppler/Hints.cc
@@ -32,7 +32,7 @@ public:
StreamBitReader(Stream *strA)
: str(strA)
, inputBits(0)
- , isAtEof(gFalse)
+ , isAtEof(false)
{
}
@@ -41,7 +41,7 @@ public:
inputBits = 0;
}
- GBool atEOF() const
+ bool atEOF() const
{
return isAtEof;
}
@@ -53,7 +53,7 @@ public:
if (inputBits == 0) {
if ((c = str->getChar()) == EOF) {
- isAtEof = gTrue;
+ isAtEof = true;
return (Guint) -1;
}
bitsBuffer = c;
@@ -91,7 +91,7 @@ private:
Stream *str;
int inputBits;
char bitsBuffer;
- GBool isAtEof;
+ bool isAtEof;
};
//------------------------------------------------------------------------
@@ -147,7 +147,7 @@ Hints::Hints(BaseStream *str, Linearization *linearization, XRef *xref, Security
groupNumObjects = nullptr;
groupXRefOffset = nullptr;
- ok = gTrue;
+ ok = true;
readTables(str, linearization, xref, secHdlr);
}
@@ -187,13 +187,13 @@ void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref
std::vector<char> buf(bufLength);
char *p = &buf[0];
- Stream *s = str->makeSubStream(hintsOffset, gFalse, hintsLength, Object(objNull));
+ Stream *s = str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull));
s->reset();
for (Guint i=0; i < hintsLength; i++) { *p++ = s->getChar(); }
delete s;
if (hintsOffset2 && hintsLength2) {
- s = str->makeSubStream(hintsOffset2, gFalse, hintsLength2, Object(objNull));
+ s = str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull));
s->reset();
for (Guint i=0; i < hintsLength2; i++) { *p++ = s->getChar(); }
delete s;
@@ -201,18 +201,18 @@ void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref
MemStream *memStream = new MemStream (&buf[0], 0, bufLength, Object(objNull));
- parser = new Parser(xref, new Lexer(xref, memStream), gTrue);
+ parser = new Parser(xref, new Lexer(xref, memStream), true);
int num, gen;
Object obj;
if ((obj = parser->getObj(), obj.isInt()) &&
(num = obj.getInt(), obj = parser->getObj(), obj.isInt()) &&
(gen = obj.getInt(), obj = parser->getObj(), obj.isCmd("obj")) &&
- (obj = parser->getObj(gFalse,
+ (obj = parser->getObj(false,
secHdlr ? secHdlr->getFileKey() : nullptr,
secHdlr ? secHdlr->getEncAlgorithm() : cryptRC4,
secHdlr ? secHdlr->getFileKeyLength() : 0,
- num, gen, 0, gTrue), obj.isStream())) {
+ num, gen, 0, true), obj.isStream())) {
Stream *hintsStream = obj.getStream();
Dict *hintsDict = obj.streamGetDict();
@@ -238,11 +238,11 @@ void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref
delete parser;
}
-GBool Hints::readPageOffsetTable(Stream *str)
+bool Hints::readPageOffsetTable(Stream *str)
{
if (nPages < 1) {
error(errSyntaxWarning, -1, "Invalid number of pages reading page offset hints table");
- return gFalse;
+ return false;
}
StreamBitReader sbr(str);
@@ -251,7 +251,7 @@ GBool Hints::readPageOffsetTable(Stream *str)
if (nObjectLeast < 1) {
error(errSyntaxWarning, -1, "Invalid least number of objects reading page offset hints table");
nPages = 0;
- return gFalse;
+ return false;
}
objectOffsetFirst = sbr.readBits(32);
@@ -261,7 +261,7 @@ GBool Hints::readPageOffsetTable(Stream *str)
if (nBitsDiffObjects > 32) {
error(errSyntaxWarning, -1, "Invalid number of bits needed to represent the difference between the greatest and least number of objects in a page");
nPages = 0;
- return gFalse;
+ return false;
}
pageLengthLeast = sbr.readBits(32);
@@ -288,7 +288,7 @@ GBool Hints::readPageOffsetTable(Stream *str)
nObjects[i] = nObjectLeast + sbr.readBits(nBitsDiffObjects);
}
if (sbr.atEOF())
- return gFalse;
+ return false;
nObjects[0] = 0;
xRefOffset[0] = mainXRefEntriesOffset + 20;
@@ -307,7 +307,7 @@ GBool Hints::readPageOffsetTable(Stream *str)
pageLength[i] = pageLengthLeast + sbr.readBits(nBitsDiffPageLength);
}
if (sbr.atEOF())
- return gFalse;
+ return false;
sbr.resetInputBits(); // reset on byte boundary. Not in specs!
numSharedObject[0] = sbr.readBits(nBitsNumShared);
@@ -318,17 +318,17 @@ GBool Hints::readPageOffsetTable(Stream *str)
if (numSharedObject[i] >= INT_MAX / (int)sizeof(Guint)) {
error(errSyntaxWarning, -1, "Invalid number of shared objects");
numSharedObject[i] = 0;
- return gFalse;
+ return false;
}
sharedObjectId[i] = (Guint *) gmallocn_checkoverflow(numSharedObject[i], sizeof(Guint));
if (numSharedObject[i] && !sharedObjectId[i]) {
error(errSyntaxWarning, -1, "Failed to allocate memory for shared object IDs");
numSharedObject[i] = 0;
- return gFalse;
+ return false;
}
}
if (sbr.atEOF())
- return gFalse;
+ return false;
sbr.resetInputBits(); // reset on byte boundary. Not in specs!
for (int i=1; i<nPages; i++) {
@@ -346,7 +346,7 @@ GBool Hints::readPageOffsetTable(Stream *str)
return !sbr.atEOF();
}
-GBool Hints::readSharedObjectsTable(Stream *str)
+bool Hints::readSharedObjectsTable(Stream *str)
{
StreamBitReader sbr(str);
@@ -366,15 +366,15 @@ GBool Hints::readSharedObjectsTable(Stream *str)
if ((!nSharedGroups) || (nSharedGroups >= INT_MAX / (int)sizeof(Guint))) {
error(errSyntaxWarning, -1, "Invalid number of shared object groups");
- return gFalse;
+ return false;
}
if ((!nSharedGroupsFirst) || (nSharedGroupsFirst > nSharedGroups)) {
error(errSyntaxWarning, -1, "Invalid number of first page shared object groups");
- return gFalse;
+ return false;
}
if (nBitsNumObjects > 32 || nBitsDiffGroupLength > 32) {
error(errSyntaxWarning, -1, "Invalid shared object groups bit length");
- return gFalse;
+ return false;
}
groupLength = (Guint *) gmallocn_checkoverflow(nSharedGroups, sizeof(Guint));
@@ -385,7 +385,7 @@ GBool Hints::readSharedObjectsTable(Stream *str)
if (!groupLength || !groupOffset || !groupHasSignature ||
!groupNumObjects || !groupXRefOffset) {
error(errSyntaxWarning, -1, "Failed to allocate memory for shared object groups");
- return gFalse;
+ return false;
}
sbr.resetInputBits(); // reset on byte boundary. Not in specs!
@@ -393,7 +393,7 @@ GBool Hints::readSharedObjectsTable(Stream *str)
groupLength[i] = groupLengthLeast + sbr.readBits(nBitsDiffGroupLength);
}
if (sbr.atEOF())
- return gFalse;
+ return false;
groupOffset[0] = objectOffsetFirst;
for (Guint i=1; i<nSharedGroupsFirst; i++) {
@@ -411,7 +411,7 @@ GBool Hints::readSharedObjectsTable(Stream *str)
groupHasSignature[i] = sbr.readBits(1);
}
if (sbr.atEOF())
- return gFalse;
+ return false;
sbr.resetInputBits(); // reset on byte boundary. Not in specs!
for (Guint i = 0; i < nSharedGroups && !sbr.atEOF(); i++) {
@@ -420,7 +420,7 @@ GBool Hints::readSharedObjectsTable(Stream *str)
}
}
if (sbr.atEOF())
- return gFalse;
+ return false;
sbr.resetInputBits(); // reset on byte boundary. Not in specs!
for (Guint i = 0; i < nSharedGroups && !sbr.atEOF(); i++) {
@@ -443,7 +443,7 @@ GBool Hints::readSharedObjectsTable(Stream *str)
return !sbr.atEOF();
}
-GBool Hints::isOk() const
+bool Hints::isOk() const
{
return ok;
}
diff --git a/poppler/Hints.h b/poppler/Hints.h
index a9062265..b535abe2 100644
--- a/poppler/Hints.h
+++ b/poppler/Hints.h
@@ -36,7 +36,7 @@ public:
Hints(const Hints &) = delete;
Hints& operator=(const Hints &) = delete;
- GBool isOk() const;
+ bool isOk() const;
int getPageObjectNum(int page);
Goffset getPageOffset(int page);
@@ -45,8 +45,8 @@ public:
private:
void readTables(BaseStream *str, Linearization *linearization, XRef *xref, SecurityHandler *secHdlr);
- GBool readPageOffsetTable(Stream *str);
- GBool readSharedObjectsTable(Stream *str);
+ bool readPageOffsetTable(Stream *str);
+ bool readSharedObjectsTable(Stream *str);
Guint hintsOffset;
Guint hintsLength;
@@ -87,7 +87,7 @@ private:
Guint *groupHasSignature;
Guint *groupNumObjects;
Guint *groupXRefOffset;
- GBool ok;
+ bool ok;
};
#endif
diff --git a/poppler/JArithmeticDecoder.cc b/poppler/JArithmeticDecoder.cc
index 1f54b156..45922629 100644
--- a/poppler/JArithmeticDecoder.cc
+++ b/poppler/JArithmeticDecoder.cc
@@ -86,7 +86,7 @@ int JArithmeticDecoder::switchTab[47] = {
JArithmeticDecoder::JArithmeticDecoder() {
str = nullptr;
dataLen = 0;
- limitStream = gFalse;
+ limitStream = false;
nBytesRead = 0;
}
@@ -119,7 +119,7 @@ void JArithmeticDecoder::start() {
void JArithmeticDecoder::restart(int dataLenA) {
Guint cAdd;
- GBool prevFF;
+ bool prevFF;
int k, nBits;
if (dataLen >= 0) {
@@ -131,7 +131,7 @@ void JArithmeticDecoder::restart(int dataLenA) {
k = (-dataLen - 1) * 8 - ct;
dataLen = dataLenA;
cAdd = 0;
- prevFF = gFalse;
+ prevFF = false;
while (k > 0) {
buf0 = readByte();
if (prevFF) {
@@ -241,7 +241,7 @@ int JArithmeticDecoder::decodeByte(Guint context,
return byte;
}
-GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
+bool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
int s;
Guint v;
int i;
@@ -293,13 +293,13 @@ GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
if (s) {
if (v == 0) {
- return gFalse;
+ return false;
}
*x = -(int)v;
} else {
*x = (int)v;
}
- return gTrue;
+ return true;
}
int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
diff --git a/poppler/JArithmeticDecoder.h b/poppler/JArithmeticDecoder.h
index 3f4f0737..9e651702 100644
--- a/poppler/JArithmeticDecoder.h
+++ b/poppler/JArithmeticDecoder.h
@@ -67,9 +67,9 @@ public:
JArithmeticDecoder& operator=(const JArithmeticDecoder &) = delete;
void setStream(Stream *strA)
- { str = strA; dataLen = 0; limitStream = gFalse; }
+ { str = strA; dataLen = 0; limitStream = false; }
void setStream(Stream *strA, int dataLenA)
- { str = strA; dataLen = dataLenA; limitStream = gTrue; }
+ { str = strA; dataLen = dataLenA; limitStream = true; }
// Start decoding on a new stream. This fills the byte buffers and
// runs INITDEC.
@@ -91,7 +91,7 @@ public:
int decodeByte(Guint context, JArithmeticDecoderStats *stats);
// Returns false for OOB, otherwise sets *<x> and returns true.
- GBool decodeInt(int *x, JArithmeticDecoderStats *stats);
+ bool decodeInt(int *x, JArithmeticDecoderStats *stats);
Guint decodeIAID(Guint codeLen,
JArithmeticDecoderStats *stats);
@@ -119,7 +119,7 @@ private:
Stream *str;
Guint nBytesRead;
int dataLen;
- GBool limitStream;
+ bool limitStream;
};
#endif
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index c3621a7a..f4c735e6 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -320,7 +320,7 @@ public:
void reset();
// Returns false for OOB, otherwise sets *<x> and returns true.
- GBool decodeInt(int *x, JBIG2HuffmanTable *table);
+ bool decodeInt(int *x, JBIG2HuffmanTable *table);
Guint readBits(Guint n);
Guint readBit();
@@ -349,7 +349,7 @@ void JBIG2HuffmanDecoder::reset() {
}
//~ optimize this
-GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
+bool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
Guint i, len, prefix;
i = 0;
@@ -362,7 +362,7 @@ GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
}
if (prefix == table[i].prefix) {
if (table[i].rangeLen == jbig2HuffmanOOB) {
- return gFalse;
+ return false;
}
if (table[i].rangeLen == jbig2HuffmanLOW) {
*x = table[i].val - readBits(32);
@@ -371,11 +371,11 @@ GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
} else {
*x = table[i].val;
}
- return gTrue;
+ return true;
}
++i;
}
- return gFalse;
+ return false;
}
Guint JBIG2HuffmanDecoder::readBits(Guint n) {
@@ -696,7 +696,7 @@ public:
void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp);
Guchar *getDataPtr() { return data; }
int getDataSize() { return h * line; }
- GBool isOk() { return data != nullptr; }
+ bool isOk() { return data != nullptr; }
private:
@@ -853,7 +853,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y,
int x0, x1, y0, y1, xx, yy;
Guchar *srcPtr, *destPtr;
Guint src0, src1, src, dest, s1, s2, m1, m2, m3;
- GBool oneByte;
+ bool oneByte;
// check for the pathological case where y = -2^31
if (y < -0x7fffffff) {
@@ -1054,7 +1054,7 @@ public:
Guint getSize() { return size; }
void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
JBIG2Bitmap *getBitmap(Guint idx) { return bitmaps[idx]; }
- GBool isOk() { return bitmaps != nullptr; }
+ bool isOk() { return bitmaps != nullptr; }
void setGenericRegionStats(JArithmeticDecoderStats *stats)
{ genericRegionStats = stats; }
void setRefinementRegionStats(JArithmeticDecoderStats *stats)
@@ -1324,8 +1324,8 @@ GooString *JBIG2Stream::getPSFilter(int psLevel, const char *indent) {
return nullptr;
}
-GBool JBIG2Stream::isBinary(GBool last) {
- return str->isBinary(gTrue);
+bool JBIG2Stream::isBinary(bool last) {
+ return str->isBinary(true);
}
void JBIG2Stream::readSegments() {
@@ -1419,48 +1419,48 @@ void JBIG2Stream::readSegments() {
}
break;
case 4:
- readTextRegionSeg(segNum, gFalse, gFalse, segLength, refSegs, nRefSegs);
+ readTextRegionSeg(segNum, false, false, segLength, refSegs, nRefSegs);
break;
case 6:
- readTextRegionSeg(segNum, gTrue, gFalse, segLength, refSegs, nRefSegs);
+ readTextRegionSeg(segNum, true, false, segLength, refSegs, nRefSegs);
break;
case 7:
- readTextRegionSeg(segNum, gTrue, gTrue, segLength, refSegs, nRefSegs);
+ readTextRegionSeg(segNum, true, true, segLength, refSegs, nRefSegs);
break;
case 16:
readPatternDictSeg(segNum, segLength);
break;
case 20:
- readHalftoneRegionSeg(segNum, gFalse, gFalse, segLength,
+ readHalftoneRegionSeg(segNum, false, false, segLength,
refSegs, nRefSegs);
break;
case 22:
- readHalftoneRegionSeg(segNum, gTrue, gFalse, segLength,
+ readHalftoneRegionSeg(segNum, true, false, segLength,
refSegs, nRefSegs);
break;
case 23:
- readHalftoneRegionSeg(segNum, gTrue, gTrue, segLength,
+ readHalftoneRegionSeg(segNum, true, true, segLength,
refSegs, nRefSegs);
break;
case 36:
- readGenericRegionSeg(segNum, gFalse, gFalse, segLength);
+ readGenericRegionSeg(segNum, false, false, segLength);
break;
case 38:
- readGenericRegionSeg(segNum, gTrue, gFalse, segLength);
+ readGenericRegionSeg(segNum, true, false, segLength);
break;
case 39:
- readGenericRegionSeg(segNum, gTrue, gTrue, segLength);
+ readGenericRegionSeg(segNum, true, true, segLength);
break;
case 40:
- readGenericRefinementRegionSeg(segNum, gFalse, gFalse, segLength,
+ readGenericRefinementRegionSeg(segNum, false, false, segLength,
refSegs, nRefSegs);
break;
case 42:
- readGenericRefinementRegionSeg(segNum, gTrue, gFalse, segLength,
+ readGenericRefinementRegionSeg(segNum, true, false, segLength,
refSegs, nRefSegs);
break;
case 43:
- readGenericRefinementRegionSeg(segNum, gTrue, gTrue, segLength,
+ readGenericRefinementRegionSeg(segNum, true, true, segLength,
refSegs, nRefSegs);
break;
case 48:
@@ -1542,7 +1542,7 @@ void JBIG2Stream::readSegments() {
error(errSyntaxError, curStr->getPos(), "Unexpected EOF in JBIG2 stream");
}
-GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
+bool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
Guint *refSegs, Guint nRefSegs) {
JBIG2SymbolDict *symbolDict;
JBIG2HuffmanTable *huffDHTable, *huffDWTable;
@@ -1560,7 +1560,7 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
Guint *symWidths;
Guint symHeight, symWidth, totalWidth, x, symID;
int dh = 0, dw, refAggNum, refDX = 0, refDY = 0, bmSize;
- GBool ex;
+ bool ex;
int run, cnt, c;
Guint i, j, k;
Guchar *p;
@@ -1622,7 +1622,7 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
codeTables = new GooList();
numInputSyms = 0;
for (i = 0; i < nRefSegs; ++i) {
- // This is need by bug 12014, returning gFalse makes it not crash
+ // This is need by bug 12014, returning false makes it not crash
// but we end up with a empty page while acroread is able to render
// part of it
if ((seg = findSegment(refSegs[i]))) {
@@ -1639,7 +1639,7 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
}
} else {
delete codeTables;
- return gFalse;
+ return false;
}
}
if (numInputSyms > UINT_MAX - numNewSyms) {
@@ -1854,13 +1854,13 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
}
bitmaps[numInputSyms + i] =
readGenericRefinementRegion(symWidth, symHeight,
- sdrTemplate, gFalse,
+ sdrTemplate, false,
refBitmap, refDX, refDY,
sdrATX, sdrATY);
//~ do we need to use the bmSize value here (in Huffman mode)?
} else {
bitmaps[numInputSyms + i] =
- readTextRegion(huff, gTrue, symWidth, symHeight,
+ readTextRegion(huff, true, symWidth, symHeight,
refAggNum, 0, numInputSyms + i, nullptr,
symCodeLen, bitmaps, 0, 0, 0, 1, 0,
huffTableF, huffTableH, huffTableK, huffTableO,
@@ -1871,8 +1871,8 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
// non-ref/agg coding
} else {
bitmaps[numInputSyms + i] =
- readGenericBitmap(gFalse, symWidth, symHeight,
- sdTemplate, gFalse, gFalse, nullptr,
+ readGenericBitmap(false, symWidth, symHeight,
+ sdTemplate, false, false, nullptr,
sdATX, sdATY, 0);
}
@@ -1899,8 +1899,8 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
*p++ = (Guchar)c;
}
} else {
- collBitmap = readGenericBitmap(gTrue, totalWidth, symHeight,
- 0, gFalse, gFalse, nullptr, nullptr, nullptr,
+ collBitmap = readGenericBitmap(true, totalWidth, symHeight,
+ 0, false, false, nullptr, nullptr, nullptr,
bmSize);
}
if (likely(collBitmap != nullptr)) {
@@ -1927,7 +1927,7 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
// exported symbol list
i = j = 0;
- ex = gFalse;
+ ex = false;
run = 0; // initialize it once in case the first decodeInt fails
// we do not want to use uninitialized memory
while (i < numInputSyms + numNewSyms) {
@@ -1978,7 +1978,7 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
// store the new symbol dict
segments->push_back(symbolDict);
- return gTrue;
+ return true;
codeTableError:
error(errSyntaxError, curStr->getPos(), "Missing code table in JBIG2 symbol dictionary");
@@ -1994,15 +1994,15 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
if (symWidths) {
gfree(symWidths);
}
- return gFalse;
+ return false;
eofError:
error(errSyntaxError, curStr->getPos(), "Unexpected EOF in JBIG2 stream");
- return gFalse;
+ return false;
}
-void JBIG2Stream::readTextRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length,
+void JBIG2Stream::readTextRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length,
Guint *refSegs, Guint nRefSegs) {
JBIG2Bitmap *bitmap;
JBIG2HuffmanTable runLengthTab[36];
@@ -2311,7 +2311,7 @@ void JBIG2Stream::readTextRegionSeg(Guint segNum, GBool imm,
return;
}
-JBIG2Bitmap *JBIG2Stream::readTextRegion(GBool huff, GBool refine,
+JBIG2Bitmap *JBIG2Stream::readTextRegion(bool huff, bool refine,
int w, int h,
Guint numInstances,
Guint logStrips,
@@ -2430,7 +2430,7 @@ JBIG2Bitmap *JBIG2Stream::readTextRegion(GBool huff, GBool refine,
ri = 0;
}
if (ri) {
- GBool decodeSuccess;
+ bool decodeSuccess;
if (huff) {
decodeSuccess = huffDecoder->decodeInt(&rdw, huffRDWTable);
decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdh, huffRDHTable);
@@ -2454,7 +2454,7 @@ JBIG2Bitmap *JBIG2Stream::readTextRegion(GBool huff, GBool refine,
symbolBitmap =
readGenericRefinementRegion(rdw + syms[symID]->getWidth(),
rdh + syms[symID]->getHeight(),
- templ, gFalse, syms[symID],
+ templ, false, syms[symID],
refDX, refDY, atx, aty);
}
//~ do we need to use the bmSize value here (in Huffman mode)?
@@ -2608,7 +2608,7 @@ void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) {
atx[2] = 2; aty[2] = -2;
atx[3] = -2; aty[3] = -2;
bitmap = readGenericBitmap(mmr, (grayMax + 1) * patternW, patternH,
- templ, gFalse, gFalse, nullptr,
+ templ, false, false, nullptr,
atx, aty, length - 7);
if (!bitmap)
@@ -2636,8 +2636,8 @@ void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) {
error(errSyntaxError, curStr->getPos(), "Unexpected EOF in JBIG2 stream");
}
-void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length,
+void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length,
Guint *refSegs, Guint nRefSegs) {
JBIG2Bitmap *bitmap;
JBIG2Segment *seg;
@@ -2754,7 +2754,7 @@ void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
atx[2] = 2; aty[2] = -2;
atx[3] = -2; aty[3] = -2;
for (j = bpp - 1; j >= 0; --j) {
- grayBitmap = readGenericBitmap(mmr, gridW, gridH, templ, gFalse,
+ grayBitmap = readGenericBitmap(mmr, gridW, gridH, templ, false,
enableSkip, skipBitmap, atx, aty, -1);
i = 0;
for (m = 0; m < gridH; ++m) {
@@ -2814,8 +2814,8 @@ void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
error(errSyntaxError, curStr->getPos(), "Unexpected EOF in JBIG2 stream");
}
-void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length) {
+void JBIG2Stream::readGenericRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length) {
JBIG2Bitmap *bitmap;
Guint w, h, x, y, segInfoFlags, extCombOp, rowCount;
Guint flags, mmr, templ, tpgdOn;
@@ -2865,7 +2865,7 @@ void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm,
}
// read the bitmap
- bitmap = readGenericBitmap(mmr, w, h, templ, tpgdOn, gFalse,
+ bitmap = readGenericBitmap(mmr, w, h, templ, tpgdOn, false,
nullptr, atx, aty, mmr ? length - 18 : 0);
if (!bitmap)
return;
@@ -2933,13 +2933,13 @@ inline void JBIG2Stream::mmrAddPixelsNeg(int a1, int blackPixels,
}
}
-JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h,
- int templ, GBool tpgdOn,
- GBool useSkip, JBIG2Bitmap *skip,
+JBIG2Bitmap *JBIG2Stream::readGenericBitmap(bool mmr, int w, int h,
+ int templ, bool tpgdOn,
+ bool useSkip, JBIG2Bitmap *skip,
int *atx, int *aty,
int mmrDataLength) {
JBIG2Bitmap *bitmap;
- GBool ltp;
+ bool ltp;
Guint ltpCX, cx, cx0, cx1, cx2;
int *refLine, *codingLine;
int code1, code2, code3;
@@ -3721,8 +3721,8 @@ JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h,
return bitmap;
}
-void JBIG2Stream::readGenericRefinementRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length,
+void JBIG2Stream::readGenericRefinementRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length,
Guint *refSegs,
Guint nRefSegs) {
JBIG2Bitmap *bitmap, *refBitmap;
@@ -3814,12 +3814,12 @@ void JBIG2Stream::readGenericRefinementRegionSeg(Guint segNum, GBool imm,
}
JBIG2Bitmap *JBIG2Stream::readGenericRefinementRegion(int w, int h,
- int templ, GBool tpgrOn,
+ int templ, bool tpgrOn,
JBIG2Bitmap *refBitmap,
int refDX, int refDY,
int *atx, int *aty) {
JBIG2Bitmap *bitmap;
- GBool ltp;
+ bool ltp;
Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2;
JBIG2BitmapPtr cxPtr0 = {nullptr, 0, 0};
JBIG2BitmapPtr cxPtr1 = {nullptr, 0, 0};
@@ -4255,65 +4255,65 @@ void JBIG2Stream::resetIntStats(int symCodeLen) {
}
}
-GBool JBIG2Stream::readUByte(Guint *x) {
+bool JBIG2Stream::readUByte(Guint *x) {
int c0;
if ((c0 = curStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = (Guint)c0;
- return gTrue;
+ return true;
}
-GBool JBIG2Stream::readByte(int *x) {
+bool JBIG2Stream::readByte(int *x) {
int c0;
if ((c0 = curStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = c0;
if (c0 & 0x80) {
*x |= -1 - 0xff;
}
- return gTrue;
+ return true;
}
-GBool JBIG2Stream::readUWord(Guint *x) {
+bool JBIG2Stream::readUWord(Guint *x) {
int c0, c1;
if ((c0 = curStr->getChar()) == EOF ||
(c1 = curStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = (Guint)((c0 << 8) | c1);
- return gTrue;
+ return true;
}
-GBool JBIG2Stream::readULong(Guint *x) {
+bool JBIG2Stream::readULong(Guint *x) {
int c0, c1, c2, c3;
if ((c0 = curStr->getChar()) == EOF ||
(c1 = curStr->getChar()) == EOF ||
(c2 = curStr->getChar()) == EOF ||
(c3 = curStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
- return gTrue;
+ return true;
}
-GBool JBIG2Stream::readLong(int *x) {
+bool JBIG2Stream::readLong(int *x) {
int c0, c1, c2, c3;
if ((c0 = curStr->getChar()) == EOF ||
(c1 = curStr->getChar()) == EOF ||
(c2 = curStr->getChar()) == EOF ||
(c3 = curStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
if (c0 & 0x80) {
*x |= -1 - (int)0xffffffff;
}
- return gTrue;
+ return true;
}
diff --git a/poppler/JBIG2Stream.h b/poppler/JBIG2Stream.h
index 9a45eb60..a4279553 100644
--- a/poppler/JBIG2Stream.h
+++ b/poppler/JBIG2Stream.h
@@ -52,21 +52,21 @@ public:
int getChar() override;
int lookChar() override;
GooString *getPSFilter(int psLevel, const char *indent) override;
- GBool isBinary(GBool last = gTrue) override;
+ bool isBinary(bool last = true) override;
virtual Object *getGlobalsStream() { return &globalsStream; }
virtual Ref getGlobalsStreamRef() { return globalsStreamRef; }
private:
- GBool hasGetChars() override { return true; }
+ bool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
void readSegments();
- GBool readSymbolDictSeg(Guint segNum, Guint length,
+ bool readSymbolDictSeg(Guint segNum, Guint length,
Guint *refSegs, Guint nRefSegs);
- void readTextRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length,
+ void readTextRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length,
Guint *refSegs, Guint nRefSegs);
- JBIG2Bitmap *readTextRegion(GBool huff, GBool refine,
+ JBIG2Bitmap *readTextRegion(bool huff, bool refine,
int w, int h,
Guint numInstances,
Guint logStrips,
@@ -88,26 +88,26 @@ private:
Guint templ,
int *atx, int *aty);
void readPatternDictSeg(Guint segNum, Guint length);
- void readHalftoneRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length,
+ void readHalftoneRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length,
Guint *refSegs, Guint nRefSegs);
- void readGenericRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length);
+ void readGenericRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length);
void mmrAddPixels(int a1, int blackPixels,
int *codingLine, int *a0i, int w);
void mmrAddPixelsNeg(int a1, int blackPixels,
int *codingLine, int *a0i, int w);
- JBIG2Bitmap *readGenericBitmap(GBool mmr, int w, int h,
- int templ, GBool tpgdOn,
- GBool useSkip, JBIG2Bitmap *skip,
+ JBIG2Bitmap *readGenericBitmap(bool mmr, int w, int h,
+ int templ, bool tpgdOn,
+ bool useSkip, JBIG2Bitmap *skip,
int *atx, int *aty,
int mmrDataLength);
- void readGenericRefinementRegionSeg(Guint segNum, GBool imm,
- GBool lossless, Guint length,
+ void readGenericRefinementRegionSeg(Guint segNum, bool imm,
+ bool lossless, Guint length,
Guint *refSegs,
Guint nRefSegs);
JBIG2Bitmap *readGenericRefinementRegion(int w, int h,
- int templ, GBool tpgrOn,
+ int templ, bool tpgrOn,
JBIG2Bitmap *refBitmap,
int refDX, int refDY,
int *atx, int *aty);
@@ -123,11 +123,11 @@ private:
void resetRefinementStats(Guint templ,
JArithmeticDecoderStats *prevStats);
void resetIntStats(int symCodeLen);
- GBool readUByte(Guint *x);
- GBool readByte(int *x);
- GBool readUWord(Guint *x);
- GBool readULong(Guint *x);
- GBool readLong(int *x);
+ bool readUByte(Guint *x);
+ bool readByte(int *x);
+ bool readUWord(Guint *x);
+ bool readULong(Guint *x);
+ bool readLong(int *x);
Object globalsStream;
Ref globalsStreamRef;
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
index cb88b26d..fa395652 100644
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -39,12 +39,12 @@ struct JPXStreamPrivate {
int ccounter;
int npixels;
int ncomps;
- GBool inited;
+ bool inited;
int smaskInData;
- void init2(OPJ_CODEC_FORMAT format, unsigned char *data, int length, GBool indexed);
+ void init2(OPJ_CODEC_FORMAT format, unsigned char *data, int length, bool indexed);
};
-static inline Guchar adjustComp(int r, int adjust, int depth, int sgndcorr, GBool indexed) {
+static inline Guchar adjustComp(int r, int adjust, int depth, int sgndcorr, bool indexed) {
if (!indexed) {
r += sgndcorr;
if (adjust) {
@@ -76,7 +76,7 @@ static inline int doGetChar(JPXStreamPrivate* priv) {
JPXStream::JPXStream(Stream *strA) : FilterStream(strA) {
priv = new JPXStreamPrivate;
- priv->inited = gFalse;
+ priv->inited = false;
priv->image = nullptr;
priv->npixels = 0;
priv->ncomps = 0;
@@ -106,7 +106,7 @@ Goffset JPXStream::getPos() {
}
int JPXStream::getChars(int nChars, Guchar *buffer) {
- if (unlikely(priv->inited == gFalse)) { init(); }
+ if (unlikely(priv->inited == false)) { init(); }
for (int i = 0; i < nChars; ++i) {
const int c = doGetChar(priv);
@@ -117,13 +117,13 @@ int JPXStream::getChars(int nChars, Guchar *buffer) {
}
int JPXStream::getChar() {
- if (unlikely(priv->inited == gFalse)) { init(); }
+ if (unlikely(priv->inited == false)) { init(); }
return doGetChar(priv);
}
int JPXStream::lookChar() {
- if (unlikely(priv->inited == gFalse)) { init(); }
+ if (unlikely(priv->inited == false)) { init(); }
return doLookChar(priv);
}
@@ -132,12 +132,12 @@ GooString *JPXStream::getPSFilter(int psLevel, const char *indent) {
return nullptr;
}
-GBool JPXStream::isBinary(GBool last) {
- return str->isBinary(gTrue);
+bool JPXStream::isBinary(bool last) {
+ return str->isBinary(true);
}
void JPXStream::getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode) {
- if (unlikely(priv->inited == gFalse)) { init(); }
+ if (unlikely(priv->inited == false)) { init(); }
*bitsPerComponent = 8;
int numComps = (priv->image) ? priv->image->numcomps : 1;
@@ -221,10 +221,10 @@ void JPXStream::init()
int bufSize = BUFFER_INITIAL_SIZE;
if (oLen.isInt()) bufSize = oLen.getInt();
- GBool indexed = gFalse;
+ bool indexed = false;
if (cspace.isArray() && cspace.arrayGetLength() > 0) {
const Object cstype = cspace.arrayGet(0);
- if (cstype.isName("Indexed")) indexed = gTrue;
+ if (cstype.isName("Indexed")) indexed = true;
}
priv->smaskInData = 0;
@@ -272,10 +272,10 @@ void JPXStream::init()
priv->counter = 0;
priv->ccounter = 0;
- priv->inited = gTrue;
+ priv->inited = true;
}
-void JPXStreamPrivate::init2(OPJ_CODEC_FORMAT format, unsigned char *buf, int length, GBool indexed)
+void JPXStreamPrivate::init2(OPJ_CODEC_FORMAT format, unsigned char *buf, int length, bool indexed)
{
JPXData jpxData;
diff --git a/poppler/JPEG2000Stream.h b/poppler/JPEG2000Stream.h
index 1fb63f1d..33a84a36 100644
--- a/poppler/JPEG2000Stream.h
+++ b/poppler/JPEG2000Stream.h
@@ -36,7 +36,7 @@ public:
int getChar() override;
int lookChar() override;
GooString *getPSFilter(int psLevel, const char *indent) override;
- GBool isBinary(GBool last = gTrue) override;
+ bool isBinary(bool last = true) override;
void getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode) override;
int readStream(int nChars, Guchar *buffer) {
@@ -48,7 +48,7 @@ private:
JPXStreamPrivate *priv;
void init();
- GBool hasGetChars() override { return true; }
+ bool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
};
diff --git a/poppler/JPXStream.cc b/poppler/JPXStream.cc
index 02c43693..7ac47620 100644
--- a/poppler/JPXStream.cc
+++ b/poppler/JPXStream.cc
@@ -245,15 +245,15 @@ JPXStream::JPXStream(Stream *strA):
nComps = 0;
bpc = NULL;
width = height = 0;
- haveCS = gFalse;
- havePalette = gFalse;
- haveCompMap = gFalse;
- haveChannelDefn = gFalse;
+ haveCS = false;
+ havePalette = false;
+ haveCompMap = false;
+ haveChannelDefn = false;
img.tiles = NULL;
bitBuf = 0;
bitBufLen = 0;
- bitBufSkip = gFalse;
+ bitBufSkip = false;
byteCount = 0;
curX = curY = 0;
@@ -293,19 +293,19 @@ void JPXStream::close() {
if (havePalette) {
gfree(palette.bpc);
gfree(palette.c);
- havePalette = gFalse;
+ havePalette = false;
}
if (haveCompMap) {
gfree(compMap.comp);
gfree(compMap.type);
gfree(compMap.pComp);
- haveCompMap = gFalse;
+ haveCompMap = false;
}
if (haveChannelDefn) {
gfree(channelDefn.idx);
gfree(channelDefn.type);
gfree(channelDefn.assoc);
- haveChannelDefn = gFalse;
+ haveChannelDefn = false;
}
if (img.tiles) {
@@ -468,8 +468,8 @@ GooString *JPXStream::getPSFilter(int psLevel, const char *indent) {
return NULL;
}
-GBool JPXStream::isBinary(GBool last) {
- return str->isBinary(gTrue);
+bool JPXStream::isBinary(bool last) {
+ return str->isBinary(true);
}
void JPXStream::getImageParams(int *bitsPerComponent,
@@ -478,10 +478,10 @@ void JPXStream::getImageParams(int *bitsPerComponent,
Guint bpc1, dummy, i;
int csMeth, csPrec, csPrec1, dummy2;
StreamColorSpaceMode csMode1;
- GBool haveBPC, haveCSMode;
+ bool haveBPC, haveCSMode;
csPrec = 0; // make gcc happy
- haveBPC = haveCSMode = gFalse;
+ haveBPC = haveCSMode = false;
bufStr->reset();
if (bufStr->lookChar() == 0xff) {
getImageParams2(bitsPerComponent, csMode);
@@ -500,7 +500,7 @@ void JPXStream::getImageParams(int *bitsPerComponent,
readUByte(&dummy) &&
readUByte(&dummy)) {
*bitsPerComponent = bpc1 + 1;
- haveBPC = gTrue;
+ haveBPC = true;
}
} else if (boxType == 0x636F6C72) { // color specification
cover(2);
@@ -524,7 +524,7 @@ void JPXStream::getImageParams(int *bitsPerComponent,
(!haveCSMode || csPrec1 > csPrec)) {
*csMode = csMode1;
csPrec = csPrec1;
- haveCSMode = gTrue;
+ haveCSMode = true;
}
if( dataLen >= 7 ) {
for (i = 0; i < dataLen - 7; ++i) {
@@ -604,12 +604,12 @@ void JPXStream::getImageParams2(int *bitsPerComponent,
}
}
-GBool JPXStream::readBoxes() {
+bool JPXStream::readBoxes() {
Guint boxType, boxLen, dataLen;
Guint bpc1, compression, unknownColorspace, ipr;
Guint i, j;
- haveImgHdr = gFalse;
+ haveImgHdr = false;
// initialize in case there is a parse error
img.xSize = img.ySize = 0;
@@ -626,7 +626,7 @@ GBool JPXStream::readBoxes() {
error(errSyntaxWarning, getPos(),
"Naked JPEG 2000 codestream, missing JP2/JPX wrapper");
if (!readCodestream(0)) {
- return gFalse;
+ return false;
}
nComps = img.nComps;
bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
@@ -635,7 +635,7 @@ GBool JPXStream::readBoxes() {
}
width = img.xSize - img.xOffset;
height = img.ySize - img.yOffset;
- return gTrue;
+ return true;
}
while (readBoxHdr(&boxType, &boxLen, &dataLen)) {
@@ -658,42 +658,42 @@ GBool JPXStream::readBoxes() {
!readUByte(&unknownColorspace) ||
!readUByte(&ipr)) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
if (compression != 7) {
error(errSyntaxError, getPos(),
"Unknown compression type in JPX stream");
- return gFalse;
+ return false;
}
bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
for (i = 0; i < nComps; ++i) {
bpc[i] = bpc1;
}
- haveImgHdr = gTrue;
+ haveImgHdr = true;
break;
case 0x62706363: // bits per component
cover(10);
if (!haveImgHdr) {
error(errSyntaxError, getPos(),
"Found bits per component box before image header box in JPX stream");
- return gFalse;
+ return false;
}
if (dataLen != nComps) {
error(errSyntaxError, getPos(),
"Invalid bits per component box in JPX stream");
- return gFalse;
+ return false;
}
for (i = 0; i < nComps; ++i) {
if (!readUByte(&bpc[i])) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
}
break;
case 0x636F6C72: // color specification
cover(11);
if (!readColorSpecBox(dataLen)) {
- return gFalse;
+ return false;
}
break;
case 0x70636c72: // palette
@@ -701,7 +701,7 @@ GBool JPXStream::readBoxes() {
if (!readUWord(&palette.nEntries) ||
!readUByte(&palette.nComps)) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
palette.bpc = (Guint *)gmallocn(palette.nComps, sizeof(Guint));
palette.c =
@@ -709,21 +709,21 @@ GBool JPXStream::readBoxes() {
for (i = 0; i < palette.nComps; ++i) {
if (!readUByte(&palette.bpc[i])) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
++palette.bpc[i];
}
for (i = 0; i < palette.nEntries; ++i) {
for (j = 0; j < palette.nComps; ++j) {
if (!readNBytes(((palette.bpc[j] & 0x7f) + 7) >> 3,
- (palette.bpc[j] & 0x80) ? gTrue : gFalse,
+ (palette.bpc[j] & 0x80) ? true : false,
&palette.c[i * palette.nComps + j])) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
}
}
- havePalette = gTrue;
+ havePalette = true;
break;
case 0x636d6170: // component mapping
cover(13);
@@ -736,16 +736,16 @@ GBool JPXStream::readBoxes() {
!readUByte(&compMap.type[i]) ||
!readUByte(&compMap.pComp[i])) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
}
- haveCompMap = gTrue;
+ haveCompMap = true;
break;
case 0x63646566: // channel definition
cover(14);
if (!readUWord(&channelDefn.nChannels)) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
channelDefn.idx =
(Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
@@ -758,10 +758,10 @@ GBool JPXStream::readBoxes() {
!readUWord(&channelDefn.type[i]) ||
!readUWord(&channelDefn.assoc[i])) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
}
- haveChannelDefn = gTrue;
+ haveChannelDefn = true;
break;
case 0x6A703263: // contiguous codestream
cover(15);
@@ -774,7 +774,7 @@ GBool JPXStream::readBoxes() {
"JPX stream has no supported color spec");
}
if (!readCodestream(dataLen)) {
- return gFalse;
+ return false;
}
break;
default:
@@ -782,22 +782,22 @@ GBool JPXStream::readBoxes() {
for (i = 0; i < dataLen; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
+ return false;
}
}
break;
}
}
- return gTrue;
+ return true;
}
-GBool JPXStream::readColorSpecBox(Guint dataLen) {
+bool JPXStream::readColorSpecBox(Guint dataLen) {
JPXColorSpec newCS;
Guint csApprox, csEnum;
Guint i;
- GBool ok;
+ bool ok;
- ok = gFalse;
+ ok = false;
if (!readUByte(&newCS.meth) ||
!readByte(&newCS.prec) ||
!readUByte(&csApprox)) {
@@ -812,28 +812,28 @@ GBool JPXStream::readColorSpecBox(Guint dataLen) {
newCS.enumerated.type = (JPXColorSpaceType)csEnum;
switch (newCS.enumerated.type) {
case jpxCSBiLevel:
- ok = gTrue;
+ ok = true;
break;
case jpxCSYCbCr1:
- ok = gTrue;
+ ok = true;
break;
case jpxCSYCbCr2:
- ok = gTrue;
+ ok = true;
break;
case jpxCSYCBCr3:
- ok = gTrue;
+ ok = true;
break;
case jpxCSPhotoYCC:
- ok = gTrue;
+ ok = true;
break;
case jpxCSCMY:
- ok = gTrue;
+ ok = true;
break;
case jpxCSCMYK:
- ok = gTrue;
+ ok = true;
break;
case jpxCSYCCK:
- ok = gTrue;
+ ok = true;
break;
case jpxCSCIELab:
if (dataLen == 7 + 7*4) {
@@ -859,34 +859,34 @@ GBool JPXStream::readColorSpecBox(Guint dataLen) {
} else {
goto err;
}
- ok = gTrue;
+ ok = true;
break;
case jpxCSsRGB:
- ok = gTrue;
+ ok = true;
break;
case jpxCSGrayscale:
- ok = gTrue;
+ ok = true;
break;
case jpxCSBiLevel2:
- ok = gTrue;
+ ok = true;
break;
case jpxCSCIEJab:
// not allowed in PDF
goto err;
case jpxCSCISesRGB:
- ok = gTrue;
+ ok = true;
break;
case jpxCSROMMRGB:
- ok = gTrue;
+ ok = true;
break;
case jpxCSsRGBYCbCr:
- ok = gTrue;
+ ok = true;
break;
case jpxCSYPbPr1125:
- ok = gTrue;
+ ok = true;
break;
case jpxCSYPbPr1250:
- ok = gTrue;
+ ok = true;
break;
default:
goto err;
@@ -906,30 +906,30 @@ GBool JPXStream::readColorSpecBox(Guint dataLen) {
if (ok && (!haveCS || newCS.prec > cs.prec)) {
cs = newCS;
- haveCS = gTrue;
+ haveCS = true;
}
- return gTrue;
+ return true;
err:
error(errSyntaxError, getPos(), "Error in JPX color spec");
- return gFalse;
+ return false;
}
-GBool JPXStream::readCodestream(Guint len) {
+bool JPXStream::readCodestream(Guint len) {
JPXTile *tile;
JPXTileComp *tileComp;
int segType;
- GBool haveSIZ, haveCOD, haveQCD, haveSOT;
+ bool haveSIZ, haveCOD, haveQCD, haveSOT;
Guint precinctSize, style, nDecompLevels;
Guint segLen, capabilities, comp, i, j, r;
//----- main header
- haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
+ haveSIZ = haveCOD = haveQCD = haveSOT = false;
do {
if (!readMarkerHdr(&segType, &segLen)) {
error(errSyntaxError, getPos(), "Error in JPX codestream");
- return gFalse;
+ return false;
}
switch (segType) {
case 0x4f: // SOC - start of codestream
@@ -941,7 +941,7 @@ GBool JPXStream::readCodestream(Guint len) {
if (haveSIZ) {
error(errSyntaxError, getPos(),
"Duplicate SIZ marker segment in JPX stream");
- return gFalse;
+ return false;
}
if (!readUWord(&capabilities) ||
!readULong(&img.xSize) ||
@@ -954,12 +954,12 @@ GBool JPXStream::readCodestream(Guint len) {
!readULong(&img.yTileOffset) ||
!readUWord(&img.nComps)) {
error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
- return gFalse;
+ return false;
}
if (haveImgHdr && img.nComps != nComps) {
error(errSyntaxError, getPos(),
"Different number of components in JPX SIZ marker segment");
- return gFalse;
+ return false;
}
if (img.xSize == 0 || img.ySize == 0 ||
img.xOffset >= img.xSize || img.yOffset >= img.ySize ||
@@ -969,7 +969,7 @@ GBool JPXStream::readCodestream(Guint len) {
img.xTileSize + img.xTileOffset <= img.xOffset ||
img.yTileSize + img.yTileOffset <= img.yOffset) {
error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
- return gFalse;
+ return false;
}
img.nXTiles = (img.xSize - img.xTileOffset + img.xTileSize - 1)
/ img.xTileSize;
@@ -980,12 +980,12 @@ GBool JPXStream::readCodestream(Guint len) {
img.nXTiles >= 65535 / img.nYTiles) {
error(errSyntaxError, getPos(),
"Bad tile count in JPX SIZ marker segment");
- return gFalse;
+ return false;
}
img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
sizeof(JPXTile));
for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- img.tiles[i].init = gFalse;
+ img.tiles[i].init = false;
img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps,
sizeof(JPXTileComp));
for (comp = 0; comp < img.nComps; ++comp) {
@@ -1000,33 +1000,33 @@ GBool JPXStream::readCodestream(Guint len) {
!readUByte(&img.tiles[0].tileComps[comp].hSep) ||
!readUByte(&img.tiles[0].tileComps[comp].vSep)) {
error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
- return gFalse;
+ return false;
}
if (img.tiles[0].tileComps[comp].hSep == 0 ||
img.tiles[0].tileComps[comp].vSep == 0) {
error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[comp].sgned =
- (img.tiles[0].tileComps[comp].prec & 0x80) ? gTrue : gFalse;
+ (img.tiles[0].tileComps[comp].prec & 0x80) ? true : false;
img.tiles[0].tileComps[comp].prec =
(img.tiles[0].tileComps[comp].prec & 0x7f) + 1;
for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
img.tiles[i].tileComps[comp] = img.tiles[0].tileComps[comp];
}
}
- haveSIZ = gTrue;
+ haveSIZ = true;
break;
case 0x52: // COD - coding style default
cover(21);
if (!haveSIZ) {
error(errSyntaxError, getPos(),
"JPX COD marker segment before SIZ segment");
- return gFalse;
+ return false;
}
if (img.tiles == NULL || img.nXTiles * img.nYTiles == 0 || img.tiles[0].tileComps == NULL) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
if (!readUByte(&img.tiles[0].tileComps[0].style) ||
!readUByte(&img.tiles[0].progOrder) ||
@@ -1038,13 +1038,13 @@ GBool JPXStream::readCodestream(Guint len) {
!readUByte(&img.tiles[0].tileComps[0].codeBlockStyle) ||
!readUByte(&img.tiles[0].tileComps[0].transform)) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
if (nDecompLevels > 32 ||
img.tiles[0].tileComps[0].codeBlockW > 8 ||
img.tiles[0].tileComps[0].codeBlockH > 8) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[0].nDecompLevels = nDecompLevels;
img.tiles[0].tileComps[0].codeBlockW += 2;
@@ -1076,7 +1076,7 @@ GBool JPXStream::readCodestream(Guint len) {
sizeof(JPXResLevel));
if (img.tiles[i].tileComps[comp].resLevels == NULL) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
@@ -1088,7 +1088,7 @@ GBool JPXStream::readCodestream(Guint len) {
cover(91);
if (!readUByte(&precinctSize)) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[0].resLevels[r].precinctWidth =
precinctSize & 0x0f;
@@ -1111,14 +1111,14 @@ GBool JPXStream::readCodestream(Guint len) {
}
}
}
- haveCOD = gTrue;
+ haveCOD = true;
break;
case 0x53: // COC - coding style component
cover(22);
if (!haveCOD) {
error(errSyntaxError, getPos(),
"JPX COC marker segment before COD segment");
- return gFalse;
+ return false;
}
if ((img.nComps > 256 && !readUWord(&comp)) ||
(img.nComps <= 256 && !readUByte(&comp)) ||
@@ -1130,13 +1130,13 @@ GBool JPXStream::readCodestream(Guint len) {
!readUByte(&img.tiles[0].tileComps[comp].codeBlockStyle) ||
!readUByte(&img.tiles[0].tileComps[comp].transform)) {
error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
- return gFalse;
+ return false;
}
if (nDecompLevels > 32 ||
img.tiles[0].tileComps[comp].codeBlockW > 8 ||
img.tiles[0].tileComps[comp].codeBlockH > 8) {
error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[comp].nDecompLevels = nDecompLevels;
img.tiles[0].tileComps[comp].style =
@@ -1171,7 +1171,7 @@ GBool JPXStream::readCodestream(Guint len) {
if (img.tiles[0].tileComps[comp].style & 0x01) {
if (!readUByte(&precinctSize)) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[comp].resLevels[r].precinctWidth =
precinctSize & 0x0f;
@@ -1196,16 +1196,16 @@ GBool JPXStream::readCodestream(Guint len) {
if (!haveSIZ) {
error(errSyntaxError, getPos(),
"JPX QCD marker segment before SIZ segment");
- return gFalse;
+ return false;
}
if (!readUByte(&img.tiles[0].tileComps[0].quantStyle)) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x00) {
if (segLen <= 3) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[0].nQuantSteps = segLen - 3;
img.tiles[0].tileComps[0].quantSteps =
@@ -1215,7 +1215,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
if (!readUByte(&img.tiles[0].tileComps[0].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
}
} else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x01) {
@@ -1226,12 +1226,12 @@ GBool JPXStream::readCodestream(Guint len) {
sizeof(Guint));
if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[0])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
} else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x02) {
if (segLen < 5) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[0].nQuantSteps = (segLen - 3) / 2;
img.tiles[0].tileComps[0].quantSteps =
@@ -1241,12 +1241,12 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
}
} else {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
for (comp = 0; comp < img.nComps; ++comp) {
@@ -1266,26 +1266,26 @@ GBool JPXStream::readCodestream(Guint len) {
}
}
}
- haveQCD = gTrue;
+ haveQCD = true;
break;
case 0x5d: // QCC - quantization component
cover(24);
if (!haveQCD) {
error(errSyntaxError, getPos(),
"JPX QCC marker segment before QCD segment");
- return gFalse;
+ return false;
}
if ((img.nComps > 256 && !readUWord(&comp)) ||
(img.nComps <= 256 && !readUByte(&comp)) ||
comp >= img.nComps ||
!readUByte(&img.tiles[0].tileComps[comp].quantStyle)) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x00) {
if (segLen <= (img.nComps > 256 ? 5U : 4U)) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[comp].nQuantSteps =
segLen - (img.nComps > 256 ? 5 : 4);
@@ -1296,7 +1296,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
if (!readUByte(&img.tiles[0].tileComps[comp].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
}
} else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x01) {
@@ -1307,12 +1307,12 @@ GBool JPXStream::readCodestream(Guint len) {
sizeof(Guint));
if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[0])) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
} else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x02) {
if (segLen < (img.nComps > 256 ? 5U : 4U) + 2) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
img.tiles[0].tileComps[comp].nQuantSteps =
(segLen - (img.nComps > 256 ? 5 : 4)) / 2;
@@ -1323,12 +1323,12 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
}
} else {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
img.tiles[i].tileComps[comp].quantStyle =
@@ -1352,7 +1352,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
- return gFalse;
+ return false;
}
}
#else
@@ -1362,7 +1362,7 @@ GBool JPXStream::readCodestream(Guint len) {
!readUByte(&compInfo[comp].defROI.style) ||
!readUByte(&compInfo[comp].defROI.shift)) {
error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
- return gFalse;
+ return false;
}
#endif
break;
@@ -1373,7 +1373,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
- return gFalse;
+ return false;
}
}
#else
@@ -1389,7 +1389,7 @@ GBool JPXStream::readCodestream(Guint len) {
!(img.nComps <= 256 && readUByte(&progs[i].endComp)) ||
!readUByte(&progs[i].progOrder)) {
error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
- return gFalse;
+ return false;
}
}
#endif
@@ -1401,7 +1401,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX PPM marker segment");
- return gFalse;
+ return false;
}
}
#endif
@@ -1412,7 +1412,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX TLM marker segment");
- return gFalse;
+ return false;
}
}
break;
@@ -1422,7 +1422,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX PLM marker segment");
- return gFalse;
+ return false;
}
}
break;
@@ -1432,7 +1432,7 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX CRG marker segment");
- return gFalse;
+ return false;
}
}
break;
@@ -1442,13 +1442,13 @@ GBool JPXStream::readCodestream(Guint len) {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX COM marker segment");
- return gFalse;
+ return false;
}
}
break;
case 0x90: // SOT - start of tile
cover(32);
- haveSOT = gTrue;
+ haveSOT = true;
break;
default:
cover(33);
@@ -1466,27 +1466,27 @@ GBool JPXStream::readCodestream(Guint len) {
if (!haveSIZ) {
error(errSyntaxError, getPos(),
"Missing SIZ marker segment in JPX stream");
- return gFalse;
+ return false;
}
if (!haveCOD) {
error(errSyntaxError, getPos(),
"Missing COD marker segment in JPX stream");
- return gFalse;
+ return false;
}
if (!haveQCD) {
error(errSyntaxError, getPos(),
"Missing QCD marker segment in JPX stream");
- return gFalse;
+ return false;
}
//----- read the tile-parts
while (1) {
if (!readTilePart()) {
- return gFalse;
+ return false;
}
if (!readMarkerHdr(&segType, &segLen)) {
error(errSyntaxError, getPos(), "Error in JPX codestream");
- return gFalse;
+ return false;
}
if (segType != 0x90) { // SOT - start of tile
break;
@@ -1495,7 +1495,7 @@ GBool JPXStream::readCodestream(Guint len) {
if (segType != 0xd9) { // EOC - end of codestream
error(errSyntaxError, getPos(), "Missing EOC marker in JPX codestream");
- return gFalse;
+ return false;
}
//----- finish decoding the image
@@ -1503,23 +1503,23 @@ GBool JPXStream::readCodestream(Guint len) {
tile = &img.tiles[i];
if (!tile->init) {
error(errSyntaxError, getPos(), "Uninitialized tile in JPX codestream");
- return gFalse;
+ return false;
}
for (comp = 0; comp < img.nComps; ++comp) {
tileComp = &tile->tileComps[comp];
inverseTransform(tileComp);
}
if (!inverseMultiCompAndDC(tile)) {
- return gFalse;
+ return false;
}
}
//~ can free memory below tileComps here, and also tileComp.buf
- return gTrue;
+ return true;
}
-GBool JPXStream::readTilePart() {
+bool JPXStream::readTilePart() {
JPXTile *tile;
JPXTileComp *tileComp;
JPXResLevel *resLevel;
@@ -1527,9 +1527,9 @@ GBool JPXStream::readTilePart() {
JPXSubband *subband;
JPXCodeBlock *cb;
int *sbCoeffs;
- GBool haveSOD;
+ bool haveSOD;
Guint tileIdx, tilePartLen, tilePartIdx, nTileParts;
- GBool tilePartToEOC;
+ bool tilePartToEOC;
Guint precinctSize, style, nDecompLevels;
Guint n, nSBs, nx, ny, sbx0, sby0, comp, segLen;
Guint i, j, k, cbX, cbY, r, pre, sb, cbi, cbj;
@@ -1541,23 +1541,23 @@ GBool JPXStream::readTilePart() {
!readUByte(&tilePartIdx) ||
!readUByte(&nTileParts)) {
error(errSyntaxError, getPos(), "Error in JPX SOT marker segment");
- return gFalse;
+ return false;
}
if (tileIdx >= img.nXTiles * img.nYTiles ||
(tilePartIdx > 0 && !img.tiles[tileIdx].init)) {
error(errSyntaxError, getPos(), "Weird tile index in JPX stream");
- return gFalse;
+ return false;
}
tilePartToEOC = tilePartLen == 0;
tilePartLen -= 12; // subtract size of SOT segment
- haveSOD = gFalse;
+ haveSOD = false;
do {
if (!readMarkerHdr(&segType, &segLen)) {
error(errSyntaxError, getPos(), "Error in JPX tile-part codestream");
- return gFalse;
+ return false;
}
tilePartLen -= 2 + segLen;
switch (segType) {
@@ -1573,13 +1573,13 @@ GBool JPXStream::readTilePart() {
!readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockStyle) ||
!readUByte(&img.tiles[tileIdx].tileComps[0].transform)) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
if (nDecompLevels > 32 ||
img.tiles[tileIdx].tileComps[0].codeBlockW > 8 ||
img.tiles[tileIdx].tileComps[0].codeBlockH > 8) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[0].nDecompLevels = nDecompLevels;
img.tiles[tileIdx].tileComps[0].codeBlockW += 2;
@@ -1614,7 +1614,7 @@ GBool JPXStream::readTilePart() {
if (img.tiles[tileIdx].tileComps[0].style & 0x01) {
if (!readUByte(&precinctSize)) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth =
precinctSize & 0x0f;
@@ -1648,13 +1648,13 @@ GBool JPXStream::readTilePart() {
!readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockStyle) ||
!readUByte(&img.tiles[tileIdx].tileComps[comp].transform)) {
error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
- return gFalse;
+ return false;
}
if (nDecompLevels > 32 ||
img.tiles[tileIdx].tileComps[comp].codeBlockW > 8 ||
img.tiles[tileIdx].tileComps[comp].codeBlockH > 8) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[comp].nDecompLevels = nDecompLevels;
img.tiles[tileIdx].tileComps[comp].style =
@@ -1673,7 +1673,7 @@ GBool JPXStream::readTilePart() {
if (img.tiles[tileIdx].tileComps[comp].style & 0x01) {
if (!readUByte(&precinctSize)) {
error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
precinctSize & 0x0f;
@@ -1689,12 +1689,12 @@ GBool JPXStream::readTilePart() {
cover(36);
if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantStyle)) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x00) {
if (segLen <= 3) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[0].nQuantSteps = segLen - 3;
img.tiles[tileIdx].tileComps[0].quantSteps =
@@ -1704,7 +1704,7 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
}
} else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x01) {
@@ -1715,12 +1715,12 @@ GBool JPXStream::readTilePart() {
sizeof(Guint));
if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[0])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
} else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x02) {
if (segLen < 5) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[0].nQuantSteps = (segLen - 3) / 2;
img.tiles[tileIdx].tileComps[0].quantSteps =
@@ -1730,12 +1730,12 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
}
} else {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
for (comp = 1; comp < img.nComps; ++comp) {
img.tiles[tileIdx].tileComps[comp].quantStyle =
@@ -1759,12 +1759,12 @@ GBool JPXStream::readTilePart() {
comp >= img.nComps ||
!readUByte(&img.tiles[tileIdx].tileComps[comp].quantStyle)) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f) == 0x00) {
if (segLen <= (img.nComps > 256 ? 5U : 4U)) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[comp].nQuantSteps =
segLen - (img.nComps > 256 ? 5 : 4);
@@ -1775,7 +1775,7 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
if (!readUByte(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
}
} else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
@@ -1787,13 +1787,13 @@ GBool JPXStream::readTilePart() {
sizeof(Guint));
if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[0])) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
} else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
== 0x02) {
if (segLen < (img.nComps > 256 ? 5U : 4U) + 2) {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
img.tiles[tileIdx].tileComps[comp].nQuantSteps =
(segLen - (img.nComps > 256 ? 5 : 4)) / 2;
@@ -1804,12 +1804,12 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
- return gFalse;
+ return false;
}
}
} else {
error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
- return gFalse;
+ return false;
}
break;
case 0x5e: // RGN - region of interest
@@ -1819,7 +1819,7 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
- return gFalse;
+ return false;
}
}
#else
@@ -1829,7 +1829,7 @@ GBool JPXStream::readTilePart() {
!readUByte(&compInfo[comp].roi.style) ||
!readUByte(&compInfo[comp].roi.shift)) {
error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
- return gFalse;
+ return false;
}
#endif
break;
@@ -1840,7 +1840,7 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
- return gFalse;
+ return false;
}
}
#else
@@ -1856,7 +1856,7 @@ GBool JPXStream::readTilePart() {
!(img.nComps <= 256 && readUByte(&tileProgs[i].endComp)) ||
!readUByte(&tileProgs[i].progOrder)) {
error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
- return gFalse;
+ return false;
}
}
#endif
@@ -1868,7 +1868,7 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX PPT marker segment");
- return gFalse;
+ return false;
}
}
#endif
@@ -1878,7 +1878,7 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX PLT marker segment");
- return gFalse;
+ return false;
}
}
break;
@@ -1888,13 +1888,13 @@ GBool JPXStream::readTilePart() {
for (i = 0; i < segLen - 2; ++i) {
if (bufStr->getChar() == EOF) {
error(errSyntaxError, getPos(), "Error in JPX COM marker segment");
- return gFalse;
+ return false;
}
}
break;
case 0x93: // SOD - start of data
cover(43);
- haveSOD = gTrue;
+ haveSOD = true;
break;
default:
cover(44);
@@ -1913,7 +1913,7 @@ GBool JPXStream::readTilePart() {
//----- initialize the tile, precincts, and code-blocks
if (tilePartIdx == 0) {
tile = &img.tiles[tileIdx];
- tile->init = gTrue;
+ tile->init = true;
i = tileIdx / img.nXTiles;
j = tileIdx % img.nXTiles;
if ((tile->x0 = img.xTileOffset + j * img.xTileSize) < img.xOffset) {
@@ -2021,9 +2021,9 @@ GBool JPXStream::readTilePart() {
subband->zeroBitPlane =
(JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
for (k = 0; k < n; ++k) {
- subband->inclusion[k].finished = gFalse;
+ subband->inclusion[k].finished = false;
subband->inclusion[k].val = 0;
- subband->zeroBitPlane[k].finished = gFalse;
+ subband->zeroBitPlane[k].finished = false;
subband->zeroBitPlane[k].val = 0;
}
subband->cbs = (JPXCodeBlock *)gmallocn(subband->nXCBs *
@@ -2063,7 +2063,7 @@ GBool JPXStream::readTilePart() {
if (subband->y1 < cb->y1) {
cb->y1 = subband->y1;
}
- cb->seen = gFalse;
+ cb->seen = false;
cb->lBlock = 3;
cb->nextPass = jpxPassCleanup;
cb->nZeroBitPlanes = 0;
@@ -2096,8 +2096,8 @@ GBool JPXStream::readTilePart() {
return readTilePartData(tileIdx, tilePartLen, tilePartToEOC);
}
-GBool JPXStream::readTilePartData(Guint tileIdx,
- Guint tilePartLen, GBool tilePartToEOC) {
+bool JPXStream::readTilePartData(Guint tileIdx,
+ Guint tilePartLen, bool tilePartToEOC) {
JPXTile *tile;
JPXTileComp *tileComp;
JPXResLevel *resLevel;
@@ -2143,7 +2143,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
cb = &subband->cbs[cbY * subband->nXCBs + cbX];
- cb->included = gFalse;
+ cb->included = false;
}
}
}
@@ -2158,7 +2158,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
// skip code-blocks with no coefficients
if (cb->x0 >= cb->x1 || cb->y0 >= cb->y1) {
cover(46);
- cb->included = gFalse;
+ cb->included = false;
continue;
}
@@ -2188,7 +2188,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
goto err;
}
if (bits == 1) {
- subband->inclusion[j].finished = gTrue;
+ subband->inclusion[j].finished = true;
} else {
++ttVal;
}
@@ -2225,7 +2225,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
goto err;
}
if (bits == 1) {
- subband->zeroBitPlane[j].finished = gTrue;
+ subband->zeroBitPlane[j].finished = true;
} else {
++ttVal;
}
@@ -2335,7 +2335,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
if (cb->included) {
if (!readCodeBlockData(tileComp, resLevel, precinct, subband,
tile->res, sb, cb)) {
- return gFalse;
+ return false;
}
if (tileComp->codeBlockStyle & 0x04) {
for (i = 0; i < cb->nCodingPasses; ++i) {
@@ -2344,7 +2344,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
} else {
tilePartLen -= cb->dataLen[0];
}
- cb->seen = gTrue;
+ cb->seen = true;
}
}
}
@@ -2391,7 +2391,7 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
tileComp = &tile->tileComps[tile->comp];
if (tile->res >= tileComp->nDecompLevels + 1) {
if (++tile->comp == img.nComps) {
- return gTrue;
+ return true;
}
}
}
@@ -2425,14 +2425,14 @@ GBool JPXStream::readTilePartData(Guint tileIdx,
}
}
- return gTrue;
+ return true;
err:
error(errSyntaxError, getPos(), "Error in JPX stream");
- return gFalse;
+ return false;
}
-GBool JPXStream::readCodeBlockData(JPXTileComp *tileComp,
+bool JPXStream::readCodeBlockData(JPXTileComp *tileComp,
JPXResLevel *resLevel,
JPXPrecinct *precinct,
JPXSubband *subband,
@@ -2756,7 +2756,7 @@ GBool JPXStream::readCodeBlockData(JPXTileComp *tileComp,
}
cb->arithDecoder->cleanup();
- return gTrue;
+ return true;
}
// Inverse quantization, and wavelet transform (IDWT). This also does
@@ -3175,7 +3175,7 @@ void JPXStream::inverseTransform1D(JPXTileComp *tileComp, int *data,
// Inverse multi-component transform and DC level shift. This also
// converts fixed point samples back to integers.
-GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
+bool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
JPXTileComp *tileComp;
int coeff, d0, d1, d2, t, minVal, maxVal, zeroVal;
int *dataPtr;
@@ -3190,7 +3190,7 @@ GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
tile->tileComps[0].vSep != tile->tileComps[1].vSep ||
tile->tileComps[1].hSep != tile->tileComps[2].hSep ||
tile->tileComps[1].vSep != tile->tileComps[2].vSep) {
- return gFalse;
+ return false;
}
// inverse irreversible multiple component transform
@@ -3283,24 +3283,24 @@ GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
}
}
- return gTrue;
+ return true;
}
-GBool JPXStream::readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
+bool JPXStream::readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
Guint len, lenH;
if (!readULong(&len) ||
!readULong(boxType)) {
- return gFalse;
+ return false;
}
if (len == 1) {
if (!readULong(&lenH) || !readULong(&len)) {
- return gFalse;
+ return false;
}
if (lenH) {
error(errSyntaxError, getPos(),
"JPX stream contains a box larger than 2^32 bytes");
- return gFalse;
+ return false;
}
*boxLen = len;
*dataLen = len - 16;
@@ -3311,7 +3311,7 @@ GBool JPXStream::readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
*boxLen = len;
*dataLen = len - 8;
}
- return gTrue;
+ return true;
}
int JPXStream::readMarkerHdr(int *segType, Guint *segLen) {
@@ -3320,12 +3320,12 @@ int JPXStream::readMarkerHdr(int *segType, Guint *segLen) {
do {
do {
if ((c = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
} while (c != 0xff);
do {
if ((c = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
} while (c == 0xff);
} while (c == 0x00);
@@ -3333,65 +3333,65 @@ int JPXStream::readMarkerHdr(int *segType, Guint *segLen) {
if ((c >= 0x30 && c <= 0x3f) ||
c == 0x4f || c == 0x92 || c == 0x93 || c == 0xd9) {
*segLen = 0;
- return gTrue;
+ return true;
}
return readUWord(segLen);
}
-GBool JPXStream::readUByte(Guint *x) {
+bool JPXStream::readUByte(Guint *x) {
int c0;
if ((c0 = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = (Guint)c0;
- return gTrue;
+ return true;
}
-GBool JPXStream::readByte(int *x) {
+bool JPXStream::readByte(int *x) {
int c0;
if ((c0 = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = c0;
if (c0 & 0x80) {
*x |= -1 - 0xff;
}
- return gTrue;
+ return true;
}
-GBool JPXStream::readUWord(Guint *x) {
+bool JPXStream::readUWord(Guint *x) {
int c0, c1;
if ((c0 = bufStr->getChar()) == EOF ||
(c1 = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = (Guint)((c0 << 8) | c1);
- return gTrue;
+ return true;
}
-GBool JPXStream::readULong(Guint *x) {
+bool JPXStream::readULong(Guint *x) {
int c0, c1, c2, c3;
if ((c0 = bufStr->getChar()) == EOF ||
(c1 = bufStr->getChar()) == EOF ||
(c2 = bufStr->getChar()) == EOF ||
(c3 = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
*x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
- return gTrue;
+ return true;
}
-GBool JPXStream::readNBytes(int nBytes, GBool signd, int *x) {
+bool JPXStream::readNBytes(int nBytes, bool signd, int *x) {
int y, c, i;
y = 0;
for (i = 0; i < nBytes; ++i) {
if ((c = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
y = (y << 8) + c;
}
@@ -3401,21 +3401,21 @@ GBool JPXStream::readNBytes(int nBytes, GBool signd, int *x) {
}
}
*x = y;
- return gTrue;
+ return true;
}
void JPXStream::startBitBuf(Guint byteCountA) {
bitBufLen = 0;
- bitBufSkip = gFalse;
+ bitBufSkip = false;
byteCount = byteCountA;
}
-GBool JPXStream::readBits(int nBits, Guint *x) {
+bool JPXStream::readBits(int nBits, Guint *x) {
int c;
while (bitBufLen < nBits) {
if (byteCount == 0 || (c = bufStr->getChar()) == EOF) {
- return gFalse;
+ return false;
}
--byteCount;
if (bitBufSkip) {
@@ -3429,7 +3429,7 @@ GBool JPXStream::readBits(int nBits, Guint *x) {
}
*x = (bitBuf >> (bitBufLen - nBits)) & ((1 << nBits) - 1);
bitBufLen -= nBits;
- return gTrue;
+ return true;
}
void JPXStream::skipSOP() {
@@ -3445,7 +3445,7 @@ void JPXStream::skipSOP() {
}
byteCount -= 6;
bitBufLen = 0;
- bitBufSkip = gFalse;
+ bitBufSkip = false;
}
}
@@ -3461,7 +3461,7 @@ void JPXStream::skipEPH() {
}
byteCount -= k + 2;
bitBufLen = 0;
- bitBufSkip = gFalse;
+ bitBufSkip = false;
}
}
diff --git a/poppler/JPXStream.h b/poppler/JPXStream.h
index 2f22e2e1..9f9ac190 100644
--- a/poppler/JPXStream.h
+++ b/poppler/JPXStream.h
@@ -89,7 +89,7 @@ struct JPXChannelDefn {
//------------------------------------------------------------------------
struct JPXTagTreeNode {
- GBool finished; // true if this node is finished
+ bool finished; // true if this node is finished
Guint val; // current value
};
@@ -100,7 +100,7 @@ struct JPXCodeBlock {
Guint x0, y0, x1, y1; // bounds
//----- persistent state
- GBool seen; // true if this code-block has already
+ bool seen; // true if this code-block has already
// been seen
Guint lBlock; // base number of bits used for pkt data length
Guint nextPass; // next coding pass
@@ -173,7 +173,7 @@ struct JPXResLevel {
struct JPXTileComp {
//----- from the SIZ segment
- GBool sgned; // 1 for signed, 0 for unsigned
+ bool sgned; // 1 for signed, 0 for unsigned
Guint prec; // precision, in bits
Guint hSep; // horizontal separation of samples
Guint vSep; // vertical separation of samples
@@ -210,7 +210,7 @@ struct JPXTileComp {
//------------------------------------------------------------------------
struct JPXTile {
- GBool init;
+ bool init;
//----- from the COD segments (main and tile)
Guint progOrder; // progression order
@@ -264,7 +264,7 @@ public:
virtual int getChar() override;
virtual int lookChar() override;
virtual GooString *getPSFilter(int psLevel, const char *indent) override;
- virtual GBool isBinary(GBool last = gTrue) override;
+ virtual bool isBinary(bool last = true) override;
virtual void getImageParams(int *bitsPerComponent,
StreamColorSpaceMode *csMode) override;
@@ -272,13 +272,13 @@ private:
void fillReadBuf();
void getImageParams2(int *bitsPerComponent, StreamColorSpaceMode *csMode);
- GBool readBoxes();
- GBool readColorSpecBox(Guint dataLen);
- GBool readCodestream(Guint len);
- GBool readTilePart();
- GBool readTilePartData(Guint tileIdx,
- Guint tilePartLen, GBool tilePartToEOC);
- GBool readCodeBlockData(JPXTileComp *tileComp,
+ bool readBoxes();
+ bool readColorSpecBox(Guint dataLen);
+ bool readCodestream(Guint len);
+ bool readTilePart();
+ bool readTilePartData(Guint tileIdx,
+ Guint tilePartLen, bool tilePartToEOC);
+ bool readCodeBlockData(JPXTileComp *tileComp,
JPXResLevel *resLevel,
JPXPrecinct *precinct,
JPXSubband *subband,
@@ -289,16 +289,16 @@ private:
Guint r, JPXResLevel *resLevel);
void inverseTransform1D(JPXTileComp *tileComp, int *data,
Guint offset, Guint n);
- GBool inverseMultiCompAndDC(JPXTile *tile);
- GBool readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen);
+ bool inverseMultiCompAndDC(JPXTile *tile);
+ bool readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen);
int readMarkerHdr(int *segType, Guint *segLen);
- GBool readUByte(Guint *x);
- GBool readByte(int *x);
- GBool readUWord(Guint *x);
- GBool readULong(Guint *x);
- GBool readNBytes(int nBytes, GBool signd, int *x);
+ bool readUByte(Guint *x);
+ bool readByte(int *x);
+ bool readUWord(Guint *x);
+ bool readULong(Guint *x);
+ bool readNBytes(int nBytes, bool signd, int *x);
void startBitBuf(Guint byteCountA);
- GBool readBits(int nBits, Guint *x);
+ bool readBits(int nBits, Guint *x);
void skipSOP();
void skipEPH();
Guint finishBitBuf();
@@ -308,21 +308,21 @@ private:
Guint nComps; // number of components
Guint *bpc; // bits per component, for each component
Guint width, height; // image size
- GBool haveImgHdr; // set if a JP2/JPX image header has been
+ bool haveImgHdr; // set if a JP2/JPX image header has been
// found
JPXColorSpec cs; // color specification
- GBool haveCS; // set if a color spec has been found
+ bool haveCS; // set if a color spec has been found
JPXPalette palette; // the palette
- GBool havePalette; // set if a palette has been found
+ bool havePalette; // set if a palette has been found
JPXCompMap compMap; // the component mapping
- GBool haveCompMap; // set if a component mapping has been found
+ bool haveCompMap; // set if a component mapping has been found
JPXChannelDefn channelDefn; // channel definition
- GBool haveChannelDefn; // set if a channel defn has been found
+ bool haveChannelDefn; // set if a channel defn has been found
JPXImage img; // JPEG2000 decoder data
Guint bitBuf; // buffer for bit reads
int bitBufLen; // number of bits in bitBuf
- GBool bitBufSkip; // true if next bit should be skipped
+ bool bitBufSkip; // true if next bit should be skipped
// (for bit stuffing)
Guint byteCount; // number of available bytes left
diff --git a/poppler/Lexer.cc b/poppler/Lexer.cc
index 3fe75763..a6433bb6 100644
--- a/poppler/Lexer.cc
+++ b/poppler/Lexer.cc
@@ -73,7 +73,7 @@ Lexer::Lexer(XRef *xrefA, Stream *str) {
streams = new Array(xref);
streams->add(curStr.copy());
strPtr = 0;
- freeArray = gTrue;
+ freeArray = true;
curStr.streamReset();
}
@@ -83,11 +83,11 @@ Lexer::Lexer(XRef *xrefA, Object *obj) {
if (obj->isStream()) {
streams = new Array(xref);
- freeArray = gTrue;
+ freeArray = true;
streams->add(obj->copy());
} else {
streams = obj->getArray();
- freeArray = gFalse;
+ freeArray = false;
}
strPtr = 0;
if (streams->getLength() > 0) {
@@ -107,7 +107,7 @@ Lexer::~Lexer() {
}
}
-int Lexer::getChar(GBool comesFromLook) {
+int Lexer::getChar(bool comesFromLook) {
int c;
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
@@ -118,7 +118,7 @@ int Lexer::getChar(GBool comesFromLook) {
c = EOF;
while (curStr.isStream() && (c = curStr.streamGetChar()) == EOF) {
- if (comesFromLook == gTrue) {
+ if (comesFromLook == true) {
return EOF;
} else {
curStr.streamClose();
@@ -140,7 +140,7 @@ int Lexer::lookChar() {
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
return lookCharLastValueCached;
}
- lookCharLastValueCached = getChar(gTrue);
+ lookCharLastValueCached = getChar(true);
if (lookCharLastValueCached == EOF) {
lookCharLastValueCached = LOOK_VALUE_NOT_CACHED;
return EOF;
@@ -152,7 +152,7 @@ int Lexer::lookChar() {
Object Lexer::getObj(int objNum) {
char *p;
int c, c2;
- GBool comment, neg, done, overflownInteger, overflownLongLong;
+ bool comment, neg, done, overflownInteger, overflownLongLong;
int numParen;
int xi;
long long xll = 0;
@@ -161,16 +161,16 @@ Object Lexer::getObj(int objNum) {
int n, m;
// skip whitespace and comments
- comment = gFalse;
+ comment = false;
while (1) {
if ((c = getChar()) == EOF) {
return Object(objEOF);
}
if (comment) {
if (c == '\r' || c == '\n')
- comment = gFalse;
+ comment = false;
} else if (c == '%') {
- comment = gTrue;
+ comment = true;
} else if (specialChars[c] != 1) {
break;
}
@@ -183,12 +183,12 @@ Object Lexer::getObj(int objNum) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '+': case '-': case '.':
- overflownInteger = gFalse;
- overflownLongLong = gFalse;
- neg = gFalse;
+ overflownInteger = false;
+ overflownLongLong = false;
+ neg = false;
xi = 0;
if (c == '-') {
- neg = gTrue;
+ neg = true;
} else if (c == '.') {
goto doReal;
} else if (c != '+') {
@@ -203,7 +203,7 @@ Object Lexer::getObj(int objNum) {
} else if (unlikely (overflownInteger)) {
if (unlikely(xll > LongLongSafeLimit) &&
(xll > (LLONG_MAX - (c - '0')) / 10)) {
- overflownLongLong = gTrue;
+ overflownLongLong = true;
xf = xll * 10.0 + (c - '0');
} else {
xll = xll * 10 + (c - '0');
@@ -211,7 +211,7 @@ Object Lexer::getObj(int objNum) {
} else {
if (unlikely(xi > IntegerSafeLimit) &&
(xi > (INT_MAX - (c - '0')) / 10.0)) {
- overflownInteger = gTrue;
+ overflownInteger = true;
xll = xi * 10LL + (c - '0');
} else {
xi = xi * 10 + (c - '0');
@@ -277,7 +277,7 @@ Object Lexer::getObj(int objNum) {
p = tokBuf;
n = 0;
numParen = 1;
- done = gFalse;
+ done = false;
s = nullptr;
do {
c2 = EOF;
@@ -290,7 +290,7 @@ Object Lexer::getObj(int objNum) {
case '\n':
#endif
error(errSyntaxError, getPos(), "Unterminated string");
- done = gTrue;
+ done = true;
break;
case '(':
@@ -300,7 +300,7 @@ Object Lexer::getObj(int objNum) {
case ')':
if (--numParen == 0) {
- done = gTrue;
+ done = true;
} else {
c2 = c;
}
@@ -352,7 +352,7 @@ Object Lexer::getObj(int objNum) {
break;
case EOF:
error(errSyntaxError, getPos(), "Unterminated string");
- done = gTrue;
+ done = true;
break;
default:
c2 = c;
@@ -381,7 +381,7 @@ Object Lexer::getObj(int objNum) {
if (newObjNum != objNum)
{
error(errSyntaxError, getPos(), "Unterminated string");
- done = gTrue;
+ done = true;
delete s;
n = -2;
}
@@ -563,9 +563,9 @@ Object Lexer::getObj(int objNum) {
}
*p = '\0';
if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
- return Object(gTrue);
+ return Object(true);
} else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
- return Object(gFalse);
+ return Object(false);
} else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
return Object(objNull);
} else {
@@ -580,11 +580,11 @@ Object Lexer::getObj(int objNum) {
Object Lexer::getObj(const char *cmdA, int objNum) {
char *p;
int c;
- GBool comment;
+ bool comment;
int n;
// skip whitespace and comments
- comment = gFalse;
+ comment = false;
const char *cmd1 = tokBuf;
*tokBuf = 0;
while (strcmp(cmdA, cmd1) && (objNum < 0 || (xref && xref->getNumEntry(getPos()) == objNum))) {
@@ -594,10 +594,10 @@ Object Lexer::getObj(const char *cmdA, int objNum) {
}
if (comment) {
if (c == '\r' || c == '\n') {
- comment = gFalse;
+ comment = false;
}
} else if (c == '%') {
- comment = gTrue;
+ comment = true;
} else if (specialChars[c] != 1) {
break;
}
@@ -635,6 +635,6 @@ void Lexer::skipToNextLine() {
}
}
-GBool Lexer::isSpace(int c) {
+bool Lexer::isSpace(int c) {
return c >= 0 && c <= 0xff && specialChars[c] == 1;
}
diff --git a/poppler/Lexer.h b/poppler/Lexer.h
index 8487e534..bbc05a10 100644
--- a/poppler/Lexer.h
+++ b/poppler/Lexer.h
@@ -79,7 +79,7 @@ public:
{ if (curStr.isStream()) curStr.streamSetPos(pos, dir); }
// Returns true if <c> is a whitespace character.
- static GBool isSpace(int c);
+ static bool isSpace(int c);
// often (e.g. ~30% on PDF Refernce 1.6 pdf file from Adobe site) getChar
@@ -93,13 +93,13 @@ public:
private:
- int getChar(GBool comesFromLook = gFalse);
+ int getChar(bool comesFromLook = false);
int lookChar();
Array *streams; // array of input streams
int strPtr; // index of current stream
Object curStr; // current stream
- GBool freeArray; // should lexer free the streams array?
+ bool freeArray; // should lexer free the streams array?
char tokBuf[tokBufSize]; // temporary token buffer
XRef *xref;
diff --git a/poppler/Linearization.cc b/poppler/Linearization.cc
index 8886894f..c37f27de 100644
--- a/poppler/Linearization.cc
+++ b/poppler/Linearization.cc
@@ -24,8 +24,8 @@ Linearization::Linearization (BaseStream *str)
str->reset();
parser = new Parser(nullptr,
- new Lexer(nullptr, str->makeSubStream(str->getStart(), gFalse, 0, Object(objNull))),
- gFalse);
+ new Lexer(nullptr, str->makeSubStream(str->getStart(), false, 0, Object(objNull))),
+ false);
Object obj1 = parser->getObj();
Object obj2 = parser->getObj();
Object obj3 = parser->getObj();
diff --git a/poppler/Link.cc b/poppler/Link.cc
index d262ea6a..07949fc2 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -222,8 +222,8 @@ void LinkAction::setNextActions(GooList *actions) {
LinkDest::LinkDest(const Array *a) {
// initialize fields
left = bottom = right = top = zoom = 0;
- changeLeft = changeTop = changeZoom = gFalse;
- ok = gFalse;
+ changeLeft = changeTop = changeZoom = false;
+ ok = false;
// get page
if (a->getLength() < 2) {
@@ -233,11 +233,11 @@ LinkDest::LinkDest(const Array *a) {
Object obj1 = a->getNF(0);
if (obj1.isInt()) {
pageNum = obj1.getInt() + 1;
- pageIsRef = gFalse;
+ pageIsRef = false;
} else if (obj1.isRef()) {
pageRef.num = obj1.getRefNum();
pageRef.gen = obj1.getRefGen();
- pageIsRef = gTrue;
+ pageIsRef = true;
} else {
error(errSyntaxWarning, -1, "Bad annotation destination");
return;
@@ -250,13 +250,13 @@ LinkDest::LinkDest(const Array *a) {
if (obj1.isName("XYZ")) {
kind = destXYZ;
if (a->getLength() < 3) {
- changeLeft = gFalse;
+ changeLeft = false;
} else {
Object obj2 = a->get(2);
if (obj2.isNull()) {
- changeLeft = gFalse;
+ changeLeft = false;
} else if (obj2.isNum()) {
- changeLeft = gTrue;
+ changeLeft = true;
left = obj2.getNum();
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
@@ -264,13 +264,13 @@ LinkDest::LinkDest(const Array *a) {
}
}
if (a->getLength() < 4) {
- changeTop = gFalse;
+ changeTop = false;
} else {
Object obj2 = a->get(3);
if (obj2.isNull()) {
- changeTop = gFalse;
+ changeTop = false;
} else if (obj2.isNum()) {
- changeTop = gTrue;
+ changeTop = true;
top = obj2.getNum();
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
@@ -278,14 +278,14 @@ LinkDest::LinkDest(const Array *a) {
}
}
if (a->getLength() < 5) {
- changeZoom = gFalse;
+ changeZoom = false;
} else {
Object obj2 = a->get(4);
if (obj2.isNull()) {
- changeZoom = gFalse;
+ changeZoom = false;
} else if (obj2.isNum()) {
zoom = obj2.getNum();
- changeZoom = (zoom == 0) ? gFalse : gTrue;
+ changeZoom = (zoom == 0) ? false : true;
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
return;
@@ -300,13 +300,13 @@ LinkDest::LinkDest(const Array *a) {
} else if (obj1.isName("FitH")) {
kind = destFitH;
if (a->getLength() < 3) {
- changeTop = gFalse;
+ changeTop = false;
} else {
Object obj2 = a->get(2);
if (obj2.isNull()) {
- changeTop = gFalse;
+ changeTop = false;
} else if (obj2.isNum()) {
- changeTop = gTrue;
+ changeTop = true;
top = obj2.getNum();
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
@@ -323,9 +323,9 @@ LinkDest::LinkDest(const Array *a) {
kind = destFitV;
Object obj2 = a->get(2);
if (obj2.isNull()) {
- changeLeft = gFalse;
+ changeLeft = false;
} else if (obj2.isNum()) {
- changeLeft = gTrue;
+ changeLeft = true;
left = obj2.getNum();
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
@@ -381,9 +381,9 @@ LinkDest::LinkDest(const Array *a) {
kind = destFitBH;
Object obj2 = a->get(2);
if (obj2.isNull()) {
- changeTop = gFalse;
+ changeTop = false;
} else if (obj2.isNum()) {
- changeTop = gTrue;
+ changeTop = true;
top = obj2.getNum();
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
@@ -399,9 +399,9 @@ LinkDest::LinkDest(const Array *a) {
kind = destFitBV;
Object obj2 = a->get(2);
if (obj2.isNull()) {
- changeLeft = gFalse;
+ changeLeft = false;
} else if (obj2.isNum()) {
- changeLeft = gTrue;
+ changeLeft = true;
left = obj2.getNum();
} else {
error(errSyntaxWarning, -1, "Bad annotation destination position");
@@ -413,7 +413,7 @@ LinkDest::LinkDest(const Array *a) {
error(errSyntaxWarning, -1, "Unknown annotation destination type");
}
- ok = gTrue;
+ ok = true;
return;
}
@@ -432,7 +432,7 @@ LinkDest::LinkDest(const LinkDest *dest) {
changeLeft = dest->changeLeft;
changeTop = dest->changeTop;
changeZoom = dest->changeZoom;
- ok = gTrue;
+ ok = true;
}
//------------------------------------------------------------------------
@@ -683,9 +683,9 @@ LinkMovie::~LinkMovie() {
LinkSound::LinkSound(const Object *soundObj) {
volume = 1.0;
- sync = gFalse;
- repeat = gFalse;
- mix = gFalse;
+ sync = false;
+ repeat = false;
+ mix = false;
sound = nullptr;
if (soundObj->isDict())
{
@@ -822,7 +822,7 @@ LinkJavaScript::~LinkJavaScript() {
//------------------------------------------------------------------------
LinkOCGState::LinkOCGState(const Object *obj) {
stateList = new GooList();
- preserveRB = gTrue;
+ preserveRB = true;
Object obj1 = obj->dictLookup("State");
if (obj1.isArray()) {
@@ -973,12 +973,12 @@ LinkAction *Links::find(double x, double y) const {
return nullptr;
}
-GBool Links::onLink(double x, double y) const {
+bool Links::onLink(double x, double y) const {
int i;
for (i = 0; i < numLinks; ++i) {
if (links[i]->inRect(x, y))
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
diff --git a/poppler/Link.h b/poppler/Link.h
index a3ee1750..d0e3cc39 100644
--- a/poppler/Link.h
+++ b/poppler/Link.h
@@ -72,7 +72,7 @@ public:
virtual ~LinkAction();
// Was the LinkAction created successfully?
- virtual GBool isOk() const = 0;
+ virtual bool isOk() const = 0;
// Check link action type.
virtual LinkActionKind getKind() const = 0;
@@ -121,11 +121,11 @@ public:
LinkDest *copy() const { return new LinkDest(this); }
// Was the LinkDest created successfully?
- GBool isOk() const { return ok; }
+ bool isOk() const { return ok; }
// Accessors.
LinkDestKind getKind() const { return kind; }
- GBool isPageRef() const { return pageIsRef; }
+ bool isPageRef() const { return pageIsRef; }
int getPageNum() const { return pageNum; }
Ref getPageRef() const { return pageRef; }
double getLeft() const { return left; }
@@ -133,14 +133,14 @@ public:
double getRight() const { return right; }
double getTop() const { return top; }
double getZoom() const { return zoom; }
- GBool getChangeLeft() const { return changeLeft; }
- GBool getChangeTop() const { return changeTop; }
- GBool getChangeZoom() const { return changeZoom; }
+ bool getChangeLeft() const { return changeLeft; }
+ bool getChangeTop() const { return changeTop; }
+ bool getChangeZoom() const { return changeZoom; }
private:
LinkDestKind kind; // destination type
- GBool pageIsRef; // is the page a reference or number?
+ bool pageIsRef; // is the page a reference or number?
union {
Ref pageRef; // reference to page
int pageNum; // one-relative page number
@@ -148,11 +148,11 @@ private:
double left, bottom; // position
double right, top;
double zoom; // zoom factor
- GBool changeLeft, changeTop; // which position components to change:
- GBool changeZoom; // destXYZ uses all three;
+ bool changeLeft, changeTop; // which position components to change:
+ bool changeZoom; // destXYZ uses all three;
// destFitH/BH use changeTop;
// destFitV/BV use changeLeft
- GBool ok; // set if created successfully
+ bool ok; // set if created successfully
LinkDest(const LinkDest *dest);
};
@@ -171,7 +171,7 @@ public:
~LinkGoTo();
// Was the LinkGoTo created successfully?
- GBool isOk() const override { return dest || namedDest; }
+ bool isOk() const override { return dest || namedDest; }
// Accessors.
LinkActionKind getKind() const override { return actionGoTo; }
@@ -201,7 +201,7 @@ public:
~LinkGoToR();
// Was the LinkGoToR created successfully?
- GBool isOk() const override { return fileName && (dest || namedDest); }
+ bool isOk() const override { return fileName && (dest || namedDest); }
// Accessors.
LinkActionKind getKind() const override { return actionGoToR; }
@@ -232,7 +232,7 @@ public:
~LinkLaunch();
// Was the LinkLaunch created successfully?
- GBool isOk() const override { return fileName != nullptr; }
+ bool isOk() const override { return fileName != nullptr; }
// Accessors.
LinkActionKind getKind() const override { return actionLaunch; }
@@ -259,7 +259,7 @@ public:
~LinkURI();
// Was the LinkURI created successfully?
- GBool isOk() const override { return uri != nullptr; }
+ bool isOk() const override { return uri != nullptr; }
// Accessors.
LinkActionKind getKind() const override { return actionURI; }
@@ -282,7 +282,7 @@ public:
~LinkNamed();
- GBool isOk() const override { return name != nullptr; }
+ bool isOk() const override { return name != nullptr; }
LinkActionKind getKind() const override { return actionNamed; }
const GooString *getName() const { return name; }
@@ -310,14 +310,14 @@ public:
LinkMovie(const Object *obj);
~LinkMovie();
- GBool isOk() const override { return annotRef.num >= 0 || annotTitle != nullptr; }
+ bool isOk() const override { return annotRef.num >= 0 || annotTitle != nullptr; }
LinkActionKind getKind() const override { return actionMovie; }
// a movie action stores either an indirect reference to a movie annotation
// or the movie annotation title
- GBool hasAnnotRef() const { return annotRef.num >= 0; }
- GBool hasAnnotTitle() const { return annotTitle != nullptr; }
+ bool hasAnnotRef() const { return annotRef.num >= 0; }
+ bool hasAnnotTitle() const { return annotTitle != nullptr; }
const Ref *getAnnotRef() const { return &annotRef; }
const GooString *getAnnotTitle() const { return annotTitle; }
@@ -353,14 +353,14 @@ public:
~LinkRendition();
- GBool isOk() const override { return true; }
+ bool isOk() const override { return true; }
LinkActionKind getKind() const override { return actionRendition; }
- GBool hasRenditionObject() const { return renditionObj.isDict(); }
+ bool hasRenditionObject() const { return renditionObj.isDict(); }
const Object* getRenditionObject() const { return &renditionObj; }
- GBool hasScreenAnnot() const { return screenRef.isRef(); }
+ bool hasScreenAnnot() const { return screenRef.isRef(); }
Ref getScreenAnnot() const { return screenRef.getRef(); }
RenditionOperation getOperation() const { return operation; }
@@ -391,22 +391,22 @@ public:
~LinkSound();
- GBool isOk() const override { return sound != nullptr; }
+ bool isOk() const override { return sound != nullptr; }
LinkActionKind getKind() const override { return actionSound; }
double getVolume() const { return volume; }
- GBool getSynchronous() const { return sync; }
- GBool getRepeat() const { return repeat; }
- GBool getMix() const { return mix; }
+ bool getSynchronous() const { return sync; }
+ bool getRepeat() const { return repeat; }
+ bool getMix() const { return mix; }
Sound *getSound() const { return sound; }
private:
double volume;
- GBool sync;
- GBool repeat;
- GBool mix;
+ bool sync;
+ bool repeat;
+ bool mix;
Sound *sound;
};
@@ -422,7 +422,7 @@ public:
~LinkJavaScript();
- GBool isOk() const override { return js != nullptr; }
+ bool isOk() const override { return js != nullptr; }
LinkActionKind getKind() const override { return actionJavaScript; }
const GooString *getScript() const { return js; }
@@ -441,7 +441,7 @@ public:
~LinkOCGState();
- GBool isOk() const override { return stateList != nullptr; }
+ bool isOk() const override { return stateList != nullptr; }
LinkActionKind getKind() const override { return actionOCGState; }
@@ -456,11 +456,11 @@ public:
};
const GooList *getStateList() const { return stateList; }
- GBool getPreserveRB() const { return preserveRB; }
+ bool getPreserveRB() const { return preserveRB; }
private:
GooList *stateList;
- GBool preserveRB;
+ bool preserveRB;
};
//------------------------------------------------------------------------
@@ -473,7 +473,7 @@ public:
~LinkHide();
- GBool isOk() const override { return targetName != nullptr; }
+ bool isOk() const override { return targetName != nullptr; }
LinkActionKind getKind() const override { return actionHide; }
// According to spec the target can be either:
@@ -485,15 +485,15 @@ public:
// While b / c appear to be very uncommon and can't easily be
// created with Adobe Acrobat DC. So only support hide
// actions with named targets (yet).
- GBool hasTargetName() const { return targetName != nullptr; }
+ bool hasTargetName() const { return targetName != nullptr; }
const GooString *getTargetName() const { return targetName; }
// Should this action show or hide.
- GBool isShowAction() const { return show; }
+ bool isShowAction() const { return show; }
private:
GooString *targetName;
- GBool show;
+ bool show;
};
//------------------------------------------------------------------------
@@ -510,7 +510,7 @@ public:
~LinkUnknown();
// Was the LinkUnknown create successfully?
- GBool isOk() const override { return action != nullptr; }
+ bool isOk() const override { return action != nullptr; }
// Accessors.
LinkActionKind getKind() const override { return actionUnknown; }
@@ -546,7 +546,7 @@ public:
LinkAction *find(double x, double y) const;
// Return true if <x>,<y> is in a link.
- GBool onLink(double x, double y) const;
+ bool onLink(double x, double y) const;
private:
diff --git a/poppler/LocalPDFDocBuilder.cc b/poppler/LocalPDFDocBuilder.cc
index 6f6f1fca..bdecc657 100644
--- a/poppler/LocalPDFDocBuilder.cc
+++ b/poppler/LocalPDFDocBuilder.cc
@@ -32,14 +32,14 @@ LocalPDFDocBuilder::buildPDFDoc(
}
}
-GBool LocalPDFDocBuilder::supports(const GooString &uri)
+bool LocalPDFDocBuilder::supports(const GooString &uri)
{
if (uri.cmpN("file://", 7) == 0) {
- return gTrue;
+ return true;
} else if (!strstr(uri.getCString(), "://")) {
- return gTrue;
+ return true;
} else {
- return gFalse;
+ return false;
}
}
diff --git a/poppler/LocalPDFDocBuilder.h b/poppler/LocalPDFDocBuilder.h
index 32e41a5d..05765cce 100644
--- a/poppler/LocalPDFDocBuilder.h
+++ b/poppler/LocalPDFDocBuilder.h
@@ -25,7 +25,7 @@ class LocalPDFDocBuilder : public PDFDocBuilder {
public:
PDFDoc *buildPDFDoc(const GooString &uri, GooString *ownerPassword = nullptr,
GooString *userPassword = nullptr, void *guiDataA = nullptr) override;
- GBool supports(const GooString &uri) override;
+ bool supports(const GooString &uri) override;
};
diff --git a/poppler/MarkedContentOutputDev.cc b/poppler/MarkedContentOutputDev.cc
index cefc0787..98f1e4b1 100644
--- a/poppler/MarkedContentOutputDev.cc
+++ b/poppler/MarkedContentOutputDev.cc
@@ -100,20 +100,20 @@ void MarkedContentOutputDev::endMarkedContent(GfxState *state)
bool MarkedContentOutputDev::needFontChange(const GfxFont* font) const
{
if (currentFont == font)
- return gFalse;
+ return false;
if (!currentFont)
return font != nullptr && font->isOk();
if (font == nullptr)
- return gTrue;
+ return true;
// Two non-null valid fonts are the same if they point to the same Ref
if (currentFont->getID()->num == font->getID()->num &&
currentFont->getID()->gen == font->getID()->gen)
- return gFalse;
+ return false;
- return gTrue;
+ return true;
}
@@ -131,7 +131,7 @@ void MarkedContentOutputDev::drawChar(GfxState *state,
// Color changes are tracked here so the color can be chosen depending on
// the render mode (for mode 1 stroke color is used), so there is no need
// to implement both updateFillColor() and updateStrokeColor().
- GBool colorChange = gFalse;
+ bool colorChange = false;
GfxRGB color;
if ((state->getRender() & 3) == 1)
state->getStrokeRGB(&color);
@@ -143,7 +143,7 @@ void MarkedContentOutputDev::drawChar(GfxState *state,
color.b != currentColor.b);
// Check also for font changes.
- GBool fontChange = needFontChange(state->getFont());
+ bool fontChange = needFontChange(state->getFont());
// Save a span with the current changes.
if (colorChange || fontChange) {
diff --git a/poppler/MarkedContentOutputDev.h b/poppler/MarkedContentOutputDev.h
index 103e859a..ed12b70f 100644
--- a/poppler/MarkedContentOutputDev.h
+++ b/poppler/MarkedContentOutputDev.h
@@ -92,12 +92,12 @@ public:
MarkedContentOutputDev(int mcidA);
virtual ~MarkedContentOutputDev();
- virtual GBool isOk() { return gTrue; }
- GBool upsideDown() override { return gTrue; }
- GBool useDrawChar() override { return gTrue; }
- GBool interpretType3Chars() override { return gFalse; }
- GBool needNonText() override { return gFalse; }
- GBool needCharCount() override { return gFalse; }
+ virtual bool isOk() { return true; }
+ bool upsideDown() override { return true; }
+ bool useDrawChar() override { return true; }
+ bool interpretType3Chars() override { return false; }
+ bool needNonText() override { return false; }
+ bool needCharCount() override { return false; }
void startPage(int pageNum, GfxState *state, XRef *xref) override;
void endPage() override;
diff --git a/poppler/Movie.cc b/poppler/Movie.cc
index 82d7f3f5..f4dfdf91 100644
--- a/poppler/Movie.cc
+++ b/poppler/Movie.cc
@@ -29,13 +29,13 @@
MovieActivationParameters::MovieActivationParameters() {
// default values
- floatingWindow = gFalse;
+ floatingWindow = false;
xPosition = 0.5;
yPosition = 0.5;
rate = 1.0;
volume = 100;
- showControls = gFalse;
- synchronousPlay = gFalse;
+ showControls = false;
+ synchronousPlay = false;
repeatMode = repeatModeOnce;
start.units = 0;
duration.units = 0;
@@ -141,7 +141,7 @@ void MovieActivationParameters::parseMovieActivation(const Object* aDict) {
if (obj1.isArray()) {
// the presence of that entry implies that the movie is to be played
// in a floating window
- floatingWindow = gTrue;
+ floatingWindow = true;
Array* scale = obj1.getArray();
if (scale->getLength() >= 2) {
@@ -177,7 +177,7 @@ void Movie::parseMovie (const Object *movieDict) {
rotationAngle = 0;
width = -1;
height = -1;
- showPoster = gFalse;
+ showPoster = false;
Object obj1 = movieDict->dictLookup("F");
Object obj2 = getFileSpecNameForPlatform(&obj1);
@@ -185,7 +185,7 @@ void Movie::parseMovie (const Object *movieDict) {
fileName = obj2.getString()->copy();
} else {
error (errSyntaxError, -1, "Invalid Movie");
- ok = gFalse;
+ ok = false;
return;
}
@@ -216,7 +216,7 @@ void Movie::parseMovie (const Object *movieDict) {
poster = movieDict->dictLookupNF("Poster");
if (!poster.isNull()) {
if (poster.isRef() || poster.isStream()) {
- showPoster = gTrue;
+ showPoster = true;
} else if (poster.isBool()) {
showPoster = poster.getBool();
poster.setToNull();
@@ -231,23 +231,23 @@ Movie::~Movie() {
}
Movie::Movie(const Object *movieDict) {
- ok = gTrue;
+ ok = true;
if (movieDict->isDict())
parseMovie(movieDict);
else
- ok = gFalse;
+ ok = false;
}
Movie::Movie(const Object *movieDict, const Object *aDict) {
- ok = gTrue;
+ ok = true;
if (movieDict->isDict()) {
parseMovie(movieDict);
if (aDict->isDict())
MA.parseMovieActivation(aDict);
} else {
- ok = gFalse;
+ ok = false;
}
}
diff --git a/poppler/Movie.h b/poppler/Movie.h
index 5c7f7913..bffd0e3d 100644
--- a/poppler/Movie.h
+++ b/poppler/Movie.h
@@ -55,13 +55,13 @@ struct MovieActivationParameters {
int volume; // 100
- GBool showControls; // false
+ bool showControls; // false
- GBool synchronousPlay; // false
+ bool synchronousPlay; // false
MovieRepeatMode repeatMode; // repeatModeOnce
// floating window position
- GBool floatingWindow;
+ bool floatingWindow;
double xPosition; // 0.5
double yPosition; // 0.5
int znum; // 1
@@ -76,7 +76,7 @@ class Movie {
~Movie();
Movie& operator=(const Movie &) = delete;
- GBool isOk() const { return ok; }
+ bool isOk() const { return ok; }
const MovieActivationParameters* getActivationParameters() const { return &MA; }
const GooString* getFileName() const { return fileName; }
@@ -85,9 +85,9 @@ class Movie {
void getAspect (int *widthA, int *heightA) const { *widthA = width; *heightA = height; }
Object getPoster() const { return poster.copy(); }
- GBool getShowPoster() const { return showPoster; }
+ bool getShowPoster() const { return showPoster; }
- GBool getUseFloatingWindow() const { return MA.floatingWindow; }
+ bool getUseFloatingWindow() const { return MA.floatingWindow; }
void getFloatingWindowSize(int *width, int *height);
Movie* copy() const ;
@@ -95,14 +95,14 @@ class Movie {
private:
void parseMovie (const Object *movieDict);
- GBool ok;
+ bool ok;
Gushort rotationAngle; // 0
int width; // Aspect
int height; // Aspect
Object poster;
- GBool showPoster;
+ bool showPoster;
GooString* fileName;
diff --git a/poppler/Object.h b/poppler/Object.h
index 73e4793a..506f3360 100644
--- a/poppler/Object.h
+++ b/poppler/Object.h
@@ -153,7 +153,7 @@ public:
Object() : type(objNone) {}
~Object() { free(); }
- explicit Object(GBool boolnA)
+ explicit Object(bool boolnA)
{ type = objBool; booln = boolnA; }
explicit Object(int intgA)
{ type = objInt; intg = intgA; }
@@ -209,34 +209,34 @@ public:
// Type checking.
ObjType getType() const { CHECK_NOT_DEAD; return type; }
- GBool isBool() const { CHECK_NOT_DEAD; return type == objBool; }
- GBool isInt() const { CHECK_NOT_DEAD; return type == objInt; }
- GBool isReal() const { CHECK_NOT_DEAD; return type == objReal; }
- GBool isNum() const { CHECK_NOT_DEAD; return type == objInt || type == objReal || type == objInt64; }
- GBool isString() const { CHECK_NOT_DEAD; return type == objString; }
- GBool isName() const { CHECK_NOT_DEAD; return type == objName; }
- GBool isNull() const { CHECK_NOT_DEAD; return type == objNull; }
- GBool isArray() const { CHECK_NOT_DEAD; return type == objArray; }
- GBool isDict() const { CHECK_NOT_DEAD; return type == objDict; }
- GBool isStream() const { CHECK_NOT_DEAD; return type == objStream; }
- GBool isRef() const { CHECK_NOT_DEAD; return type == objRef; }
- GBool isCmd() const { CHECK_NOT_DEAD; return type == objCmd; }
- GBool isError() const { CHECK_NOT_DEAD; return type == objError; }
- GBool isEOF() const { CHECK_NOT_DEAD; return type == objEOF; }
- GBool isNone() const { CHECK_NOT_DEAD; return type == objNone; }
- GBool isInt64() const { CHECK_NOT_DEAD; return type == objInt64; }
- GBool isIntOrInt64() const { CHECK_NOT_DEAD; return type == objInt || type == objInt64; }
+ bool isBool() const { CHECK_NOT_DEAD; return type == objBool; }
+ bool isInt() const { CHECK_NOT_DEAD; return type == objInt; }
+ bool isReal() const { CHECK_NOT_DEAD; return type == objReal; }
+ bool isNum() const { CHECK_NOT_DEAD; return type == objInt || type == objReal || type == objInt64; }
+ bool isString() const { CHECK_NOT_DEAD; return type == objString; }
+ bool isName() const { CHECK_NOT_DEAD; return type == objName; }
+ bool isNull() const { CHECK_NOT_DEAD; return type == objNull; }
+ bool isArray() const { CHECK_NOT_DEAD; return type == objArray; }
+ bool isDict() const { CHECK_NOT_DEAD; return type == objDict; }
+ bool isStream() const { CHECK_NOT_DEAD; return type == objStream; }
+ bool isRef() const { CHECK_NOT_DEAD; return type == objRef; }
+ bool isCmd() const { CHECK_NOT_DEAD; return type == objCmd; }
+ bool isError() const { CHECK_NOT_DEAD; return type == objError; }
+ bool isEOF() const { CHECK_NOT_DEAD; return type == objEOF; }
+ bool isNone() const { CHECK_NOT_DEAD; return type == objNone; }
+ bool isInt64() const { CHECK_NOT_DEAD; return type == objInt64; }
+ bool isIntOrInt64() const { CHECK_NOT_DEAD; return type == objInt || type == objInt64; }
// Special type checking.
- GBool isName(const char *nameA) const
+ bool isName(const char *nameA) const
{ return type == objName && !strcmp(cString, nameA); }
- GBool isDict(const char *dictType) const;
- GBool isStream(const char *dictType) const;
- GBool isCmd(const char *cmdA) const
+ bool isDict(const char *dictType) const;
+ bool isStream(const char *dictType) const;
+ bool isCmd(const char *cmdA) const
{ return type == objCmd && !strcmp(cString, cmdA); }
// Accessors.
- GBool getBool() const { OBJECT_TYPE_CHECK(objBool); return booln; }
+ bool getBool() const { OBJECT_TYPE_CHECK(objBool); return booln; }
int getInt() const { OBJECT_TYPE_CHECK(objInt); return intg; }
double getReal() const { OBJECT_TYPE_CHECK(objReal); return real; }
@@ -279,7 +279,7 @@ public:
void dictAdd(const char *key, Object &&val);
void dictSet(const char *key, Object &&val);
void dictRemove(const char *key);
- GBool dictIs(const char *dictType) const;
+ bool dictIs(const char *dictType) const;
Object dictLookup(const char *key, int recursion = 0) const;
Object dictLookupNF(const char *key) const;
const char *dictGetKey(int i) const;
@@ -287,7 +287,7 @@ public:
Object dictGetValNF(int i) const;
// Stream accessors.
- GBool streamIs(const char *dictType) const;
+ bool streamIs(const char *dictType) const;
void streamReset();
void streamClose();
int streamGetChar() const;
@@ -308,7 +308,7 @@ private:
ObjType type; // object type
union { // value for each type:
- GBool booln; // boolean
+ bool booln; // boolean
int intg; // integer
long long int64g; // 64-bit integer
double real; // real
@@ -360,10 +360,10 @@ inline void Object::dictSet(const char *key, Object &&val)
inline void Object::dictRemove(const char *key)
{ OBJECT_TYPE_CHECK(objDict); dict->remove(key); }
-inline GBool Object::dictIs(const char *dictType) const
+inline bool Object::dictIs(const char *dictType) const
{ OBJECT_TYPE_CHECK(objDict); return dict->is(dictType); }
-inline GBool Object::isDict(const char *dictType) const
+inline bool Object::isDict(const char *dictType) const
{ return type == objDict && dictIs(dictType); }
inline Object Object::dictLookup(const char *key, int recursion) const
@@ -387,10 +387,10 @@ inline Object Object::dictGetValNF(int i) const
#include "Stream.h"
-inline GBool Object::streamIs(const char *dictType) const
+inline bool Object::streamIs(const char *dictType) const
{ OBJECT_TYPE_CHECK(objStream); return stream->getDict()->is(dictType); }
-inline GBool Object::isStream(const char *dictType) const
+inline bool Object::isStream(const char *dictType) const
{ return type == objStream && streamIs(dictType); }
inline void Object::streamReset()
diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc
index 9d924e93..9922e893 100644
--- a/poppler/OptionalContent.cc
+++ b/poppler/OptionalContent.cc
@@ -35,12 +35,12 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) :
m_xref(xref)
{
// we need to parse the dictionary here, and build optionalContentGroups
- ok = gTrue;
+ ok = true;
Object ocgList = ocgObject->dictLookup("OCGs");
if (!ocgList.isArray()) {
error(errSyntaxError, -1, "Expected the optional content group list, but wasn't able to find it, or it isn't an Array");
- ok = gFalse;
+ ok = false;
return;
}
@@ -64,7 +64,7 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) :
Object defaultOcgConfig = ocgObject->dictLookup("D");
if (!defaultOcgConfig.isDict()) {
error(errSyntaxError, -1, "Expected the default config, but wasn't able to find it, or it isn't a Dictionary");
- ok = gFalse;
+ ok = false;
return;
}
@@ -194,14 +194,14 @@ bool OCGs::optContentIsVisible( Object *dictRef )
return result;
}
-GBool OCGs::evalOCVisibilityExpr(Object *expr, int recursion) {
+bool OCGs::evalOCVisibilityExpr(Object *expr, int recursion) {
OptionalContentGroup *ocg;
- GBool ret;
+ bool ret;
if (recursion > visibilityExprRecursionLimit) {
error(errSyntaxError, -1,
"Loop detected in optional content visibility expression");
- return gTrue;
+ return true;
}
if (expr->isRef()) {
if ((ocg = findOcgByRef(expr->getRef()))) {
@@ -212,7 +212,7 @@ GBool OCGs::evalOCVisibilityExpr(Object *expr, int recursion) {
if (!expr2.isArray() || expr2.arrayGetLength() < 1) {
error(errSyntaxError, -1,
"Invalid optional content visibility expression");
- return gTrue;
+ return true;
}
Object op = expr2.arrayGet(0);
if (op.isName("Not")) {
@@ -222,16 +222,16 @@ GBool OCGs::evalOCVisibilityExpr(Object *expr, int recursion) {
} else {
error(errSyntaxError, -1,
"Invalid optional content visibility expression");
- ret = gTrue;
+ ret = true;
}
} else if (op.isName("And")) {
- ret = gTrue;
+ ret = true;
for (int i = 1; i < expr2.arrayGetLength() && ret; ++i) {
Object obj = expr2.arrayGetNF(i);
ret = evalOCVisibilityExpr(&obj, recursion + 1);
}
} else if (op.isName("Or")) {
- ret = gFalse;
+ ret = false;
for (int i = 1; i < expr2.arrayGetLength() && !ret; ++i) {
Object obj = expr2.arrayGetNF(i);
ret = evalOCVisibilityExpr(&obj, recursion + 1);
@@ -239,7 +239,7 @@ GBool OCGs::evalOCVisibilityExpr(Object *expr, int recursion) {
} else {
error(errSyntaxError, -1,
"Invalid optional content visibility expression");
- ret = gTrue;
+ ret = true;
}
return ret;
}
diff --git a/poppler/OptionalContent.h b/poppler/OptionalContent.h
index aeace263..74d5b436 100644
--- a/poppler/OptionalContent.h
+++ b/poppler/OptionalContent.h
@@ -37,7 +37,7 @@ public:
OCGs& operator=(const OCGs &) = delete;
// Is OCGS valid?
- GBool isOk() const { return ok; }
+ bool isOk() const { return ok; }
bool hasOCGs() const;
const std::unordered_map< Ref, std::unique_ptr< OptionalContentGroup > > &getOCGs() const { return optionalContentGroups; }
@@ -56,9 +56,9 @@ public:
bool optContentIsVisible( Object *dictRef );
private:
- GBool ok;
+ bool ok;
- GBool evalOCVisibilityExpr(Object *expr, int recursion);
+ bool evalOCVisibilityExpr(Object *expr, int recursion);
bool allOn( Array *ocgArray );
bool allOff( Array *ocgArray );
bool anyOn( Array *ocgArray );
diff --git a/poppler/Outline.cc b/poppler/Outline.cc
index ec45edbf..b17ffdf9 100644
--- a/poppler/Outline.cc
+++ b/poppler/Outline.cc
@@ -89,11 +89,11 @@ OutlineItem::OutlineItem(const Dict *dict, int refNumA, OutlineItem *parentA, XR
lastRef = dict->lookupNF("Last");
nextRef = dict->lookupNF("Next");
- startsOpen = gFalse;
+ startsOpen = false;
obj1 = dict->lookup("Count");
if (obj1.isInt()) {
if (obj1.getInt() > 0) {
- startsOpen = gTrue;
+ startsOpen = true;
}
}
}
diff --git a/poppler/Outline.h b/poppler/Outline.h
index 4194e048..b7d34e1a 100644
--- a/poppler/Outline.h
+++ b/poppler/Outline.h
@@ -70,8 +70,8 @@ public:
const Unicode *getTitle() const { return title; }
int getTitleLength() const { return titleLen; }
const LinkAction *getAction() const { return action; }
- GBool isOpen() const { return startsOpen; }
- GBool hasKids() const { return firstRef.isRef(); }
+ bool isOpen() const { return startsOpen; }
+ bool hasKids() const { return firstRef.isRef(); }
const GooList *getKids() const { return kids; }
private:
@@ -85,7 +85,7 @@ private:
Object firstRef;
Object lastRef;
Object nextRef;
- GBool startsOpen;
+ bool startsOpen;
GooList *kids; // NULL if this item is closed or has no kids,
// otherwise a list of OutlineItem
};
diff --git a/poppler/OutputDev.cc b/poppler/OutputDev.cc
index b72f0a40..15ab4a1a 100644
--- a/poppler/OutputDev.cc
+++ b/poppler/OutputDev.cc
@@ -93,15 +93,15 @@ void OutputDev::updateAll(GfxState *state) {
updateFont(state);
}
-GBool OutputDev::beginType3Char(GfxState *state, double x, double y,
+bool OutputDev::beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
CharCode code, Unicode *u, int uLen) {
- return gFalse;
+ return false;
}
void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool interpolate, GBool inlineImg) {
+ int width, int height, bool invert,
+ bool interpolate, bool inlineImg) {
int i, j;
if (inlineImg) {
@@ -115,9 +115,9 @@ void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
void OutputDev::setSoftMaskFromImageMask(GfxState *state,
Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg, double *baseMatrix) {
- drawImageMask(state, ref, str, width, height, invert, gFalse, inlineImg);
+ int width, int height, bool invert,
+ bool inlineImg, double *baseMatrix) {
+ drawImageMask(state, ref, str, width, height, invert, false, inlineImg);
}
void OutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) {
@@ -126,7 +126,7 @@ void OutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix)
void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- GBool interpolate, int *maskColors, GBool inlineImg) {
+ bool interpolate, int *maskColors, bool inlineImg) {
int i, j;
if (inlineImg) {
@@ -142,23 +142,23 @@ void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
void OutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
- GBool maskInvert,
- GBool maskInterpolate) {
- drawImage(state, ref, str, width, height, colorMap, interpolate, nullptr, gFalse);
+ bool maskInvert,
+ bool maskInterpolate) {
+ drawImage(state, ref, str, width, height, colorMap, interpolate, nullptr, false);
}
void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
- GBool maskInterpolate) {
- drawImage(state, ref, str, width, height, colorMap, interpolate, nullptr, gFalse);
+ bool maskInterpolate) {
+ drawImage(state, ref, str, width, height, colorMap, interpolate, nullptr, false);
}
void OutputDev::endMarkedContent(GfxState *state) {
diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index 158a1625..8195a257 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -87,41 +87,41 @@ public:
// Does this device use upside-down coordinates?
// (Upside-down means (0,0) is the top left corner of the page.)
- virtual GBool upsideDown() = 0;
+ virtual bool upsideDown() = 0;
// Does this device use drawChar() or drawString()?
- virtual GBool useDrawChar() = 0;
+ virtual bool useDrawChar() = 0;
// Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing
// operations.
- virtual GBool useTilingPatternFill() { return gFalse; }
+ virtual bool useTilingPatternFill() { return false; }
// Does this device support specific shading types?
// see gouraudTriangleShadedFill() and patchMeshShadedFill()
- virtual GBool useShadedFills(int type) { return gFalse; }
+ virtual bool useShadedFills(int type) { return false; }
// Does this device use FillColorStop()?
- virtual GBool useFillColorStop() { return gFalse; }
+ virtual bool useFillColorStop() { return false; }
// Does this device use drawForm()? If this returns false,
// form-type XObjects will be interpreted (i.e., unrolled).
- virtual GBool useDrawForm() { return gFalse; }
+ virtual bool useDrawForm() { return false; }
// Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString.
- virtual GBool interpretType3Chars() = 0;
+ virtual bool interpretType3Chars() = 0;
// Does this device need non-text content?
- virtual GBool needNonText() { return gTrue; }
+ virtual bool needNonText() { return true; }
// Does this device require incCharCount to be called for text on
// non-shown layers?
- virtual GBool needCharCount() { return gFalse; }
+ virtual bool needCharCount() { return false; }
// Does this device need to clip pages to the crop box even when the
// box is the crop box?
- virtual GBool needClipToCropBox() { return gFalse; }
+ virtual bool needClipToCropBox() { return false; }
//----- initialization and control
@@ -132,15 +132,15 @@ public:
// returns false, the page display is aborted. Typically, an
// OutputDev will use some alternate means to display the page
// before returning false.
- virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
- int rotate, GBool useMediaBox, GBool crop,
+ virtual bool checkPageSlice(Page *page, double hDPI, double vDPI,
+ int rotate, bool useMediaBox, bool crop,
int sliceX, int sliceY, int sliceW, int sliceH,
- GBool printing,
- GBool (* abortCheckCbk)(void *data) = nullptr,
+ bool printing,
+ bool (* abortCheckCbk)(void *data) = nullptr,
void * abortCheckCbkData = nullptr,
- GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = nullptr,
+ bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = nullptr,
void *annotDisplayDecideCbkData = nullptr)
- { return gTrue; }
+ { return true; }
// Start a page.
virtual void startPage(int pageNum, GfxState *state, XRef *xref) {}
@@ -215,27 +215,27 @@ public:
virtual void stroke(GfxState * /*state*/) {}
virtual void fill(GfxState * /*state*/) {}
virtual void eoFill(GfxState * /*state*/) {}
- virtual GBool tilingPatternFill(GfxState * /*state*/, Gfx * /*gfx*/, Catalog * /*cat*/, Object * /*str*/,
+ virtual bool tilingPatternFill(GfxState * /*state*/, Gfx * /*gfx*/, Catalog * /*cat*/, Object * /*str*/,
const double * /*pmat*/, int /*paintType*/, int /*tilingType*/, Dict * /*resDict*/,
const double * /*mat*/, const double * /*bbox*/,
int /*x0*/, int /*y0*/, int /*x1*/, int /*y1*/,
double /*xStep*/, double /*yStep*/)
- { return gFalse; }
- virtual GBool functionShadedFill(GfxState * /*state*/,
+ { return false; }
+ virtual bool functionShadedFill(GfxState * /*state*/,
GfxFunctionShading * /*shading*/)
- { return gFalse; }
- virtual GBool axialShadedFill(GfxState * /*state*/, GfxAxialShading * /*shading*/, double /*tMin*/, double /*tMax*/)
- { return gFalse; }
- virtual GBool axialShadedSupportExtend(GfxState * /*state*/, GfxAxialShading * /*shading*/)
- { return gFalse; }
- virtual GBool radialShadedFill(GfxState * /*state*/, GfxRadialShading * /*shading*/, double /*sMin*/, double /*sMax*/)
- { return gFalse; }
- virtual GBool radialShadedSupportExtend(GfxState * /*state*/, GfxRadialShading * /*shading*/)
- { return gFalse; }
- virtual GBool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
- { return gFalse; }
- virtual GBool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading)
- { return gFalse; }
+ { return false; }
+ virtual bool axialShadedFill(GfxState * /*state*/, GfxAxialShading * /*shading*/, double /*tMin*/, double /*tMax*/)
+ { return false; }
+ virtual bool axialShadedSupportExtend(GfxState * /*state*/, GfxAxialShading * /*shading*/)
+ { return false; }
+ virtual bool radialShadedFill(GfxState * /*state*/, GfxRadialShading * /*shading*/, double /*sMin*/, double /*sMax*/)
+ { return false; }
+ virtual bool radialShadedSupportExtend(GfxState * /*state*/, GfxRadialShading * /*shading*/)
+ { return false; }
+ virtual bool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
+ { return false; }
+ virtual bool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading)
+ { return false; }
//----- path clipping
@@ -274,7 +274,7 @@ public:
double /*originX*/, double /*originY*/,
CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) {}
virtual void drawString(GfxState * /*state*/, const GooString * /*s*/) {}
- virtual GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
+ virtual bool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
double /*dx*/, double /*dy*/,
CharCode /*code*/, Unicode * /*u*/, int /*uLen*/);
virtual void endType3Char(GfxState * /*state*/) {}
@@ -291,29 +291,29 @@ public:
// If 'invert' is false, a sample value of 0 marks the page with the current color,
// and a 1 leaves the previous contents unchanged. If 'invert' is true, these meanings are reversed.
virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
- int width, int height, GBool invert, GBool interpolate,
- GBool inlineImg);
+ int width, int height, bool invert, bool interpolate,
+ bool inlineImg);
virtual void setSoftMaskFromImageMask(GfxState *state,
Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg, double *baseMatrix);
+ int width, int height, bool invert,
+ bool inlineImg, double *baseMatrix);
virtual void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix);
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- GBool interpolate, int *maskColors, GBool inlineImg);
+ bool interpolate, int *maskColors, bool inlineImg);
virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
- GfxImageColorMap *colorMap, GBool interpolate,
+ GfxImageColorMap *colorMap, bool interpolate,
Stream *maskStr, int maskWidth, int maskHeight,
- GBool maskInvert, GBool maskInterpolate);
+ bool maskInvert, bool maskInterpolate);
virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
- GBool interpolate,
+ bool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
- GBool maskInterpolate);
+ bool maskInterpolate);
//----- grouping operators
@@ -347,14 +347,14 @@ public:
std::unique_ptr<std::unordered_map<std::string, ProfileData>> endProfile();
//----- transparency groups and soft masks
- virtual GBool checkTransparencyGroup(GfxState * /*state*/, GBool /*knockout*/) { return gTrue; }
+ virtual bool checkTransparencyGroup(GfxState * /*state*/, bool /*knockout*/) { return true; }
virtual void beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * /*blendingColorSpace*/,
- GBool /*isolated*/, GBool /*knockout*/,
- GBool /*forSoftMask*/) {}
+ bool /*isolated*/, bool /*knockout*/,
+ bool /*forSoftMask*/) {}
virtual void endTransparencyGroup(GfxState * /*state*/) {}
virtual void paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) {}
- virtual void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, GBool /*alpha*/,
+ virtual void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, bool /*alpha*/,
Function * /*transferFunc*/, GfxColor * /*backdropColor*/) {}
virtual void clearSoftMask(GfxState * /*state*/) {}
@@ -362,8 +362,8 @@ public:
virtual void processLink(AnnotLink * /*link*/) {}
#if 1 //~tmp: turn off anti-aliasing temporarily
- virtual GBool getVectorAntialias() { return gFalse; }
- virtual void setVectorAntialias(GBool /*vaa*/) {}
+ virtual bool getVectorAntialias() { return false; }
+ virtual void setVectorAntialias(bool /*vaa*/) {}
#endif
#ifdef USE_CMS
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 80d3f808..0d164e25 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -107,7 +107,7 @@
void PDFDoc::init()
{
- ok = gFalse;
+ ok = false;
errCode = errNone;
fileName = nullptr;
file = nullptr;
@@ -165,7 +165,7 @@ PDFDoc::PDFDoc(const GooString *fileNameA, const GooString *ownerPassword,
}
// create stream
- str = new FileStream(file, 0, gFalse, file->size(), Object(objNull));
+ str = new FileStream(file, 0, false, file->size(), Object(objNull));
ok = setup(ownerPassword, userPassword);
}
@@ -206,7 +206,7 @@ PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
}
// create stream
- str = new FileStream(file, 0, gFalse, file->size(), Object(objNull));
+ str = new FileStream(file, 0, false, file->size(), Object(objNull));
ok = setup(ownerPassword, userPassword);
}
@@ -240,32 +240,32 @@ PDFDoc::PDFDoc(BaseStream *strA, const GooString *ownerPassword,
ok = setup(ownerPassword, userPassword);
}
-GBool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPassword) {
+bool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPassword) {
pdfdocLocker();
if (str->getLength() <= 0)
{
error(errSyntaxError, -1, "Document stream is empty");
- return gFalse;
+ return false;
}
str->setPos(0, -1);
if (str->getPos() < 0)
{
error(errSyntaxError, -1, "Document base stream is not seekable");
- return gFalse;
+ return false;
}
str->reset();
// check footer
// Adobe does not seem to enforce %%EOF, so we do the same
-// if (!checkFooter()) return gFalse;
+// if (!checkFooter()) return false;
// check header
checkHeader();
- GBool wasReconstructed = false;
+ bool wasReconstructed = false;
// read xref table
xref = new XRef(str, getStartXRef(), getMainXRefEntriesOffset(), &wasReconstructed);
@@ -273,19 +273,19 @@ GBool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPasswor
if (wasReconstructed) {
delete xref;
startXRefPos = -1;
- xref = new XRef(str, getStartXRef(gTrue), getMainXRefEntriesOffset(gTrue), &wasReconstructed);
+ xref = new XRef(str, getStartXRef(true), getMainXRefEntriesOffset(true), &wasReconstructed);
}
if (!xref->isOk()) {
error(errSyntaxError, -1, "Couldn't read xref table");
errCode = xref->getErrorCode();
- return gFalse;
+ return false;
}
}
// check for encryption
if (!checkEncryption(ownerPassword, userPassword)) {
errCode = errEncrypted;
- return gFalse;
+ return false;
}
// read catalog
@@ -303,7 +303,7 @@ GBool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPasswor
if (catalog && !catalog->isOk()) {
error(errSyntaxError, -1, "Couldn't read page catalog");
errCode = errBadCatalog;
- return gFalse;
+ return false;
}
}
@@ -311,7 +311,7 @@ GBool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPasswor
extractPDFSubtype();
// done
- return gTrue;
+ return true;
}
PDFDoc::~PDFDoc() {
@@ -357,7 +357,7 @@ PDFDoc::~PDFDoc() {
// Check for a %%EOF at the end of this stream
-GBool PDFDoc::checkFooter() {
+bool PDFDoc::checkFooter() {
// we look in the last 1024 chars because Adobe does the same
char *eof = new char[1025];
Goffset pos = str->getPos();
@@ -384,11 +384,11 @@ GBool PDFDoc::checkFooter() {
error(errSyntaxError, -1, "Document has not the mandatory ending %%EOF");
errCode = errDamaged;
delete[] eof;
- return gFalse;
+ return false;
}
delete[] eof;
str->setPos(pos);
- return gTrue;
+ return true;
}
// Check for a PDF header on this stream. Skip past some garbage
@@ -434,16 +434,16 @@ void PDFDoc::checkHeader() {
// We don't do the version check. Don't add it back in.
}
-GBool PDFDoc::checkEncryption(const GooString *ownerPassword, const GooString *userPassword) {
- GBool encrypted;
- GBool ret;
+bool PDFDoc::checkEncryption(const GooString *ownerPassword, const GooString *userPassword) {
+ bool encrypted;
+ bool ret;
Object encrypt = xref->getTrailerDict()->dictLookup("Encrypt");
if ((encrypted = encrypt.isDict())) {
if ((secHdlr = SecurityHandler::make(this, &encrypt))) {
if (secHdlr->isUnencrypted()) {
// no encryption
- ret = gTrue;
+ ret = true;
} else if (secHdlr->checkEncryption(ownerPassword, userPassword)) {
// authorization succeeded
xref->setEncryption(secHdlr->getPermissionFlags(),
@@ -453,18 +453,18 @@ GBool PDFDoc::checkEncryption(const GooString *ownerPassword, const GooString *u
secHdlr->getEncVersion(),
secHdlr->getEncRevision(),
secHdlr->getEncAlgorithm());
- ret = gTrue;
+ ret = true;
} else {
// authorization failed
- ret = gFalse;
+ ret = false;
}
} else {
// couldn't find the matching security handler
- ret = gFalse;
+ ret = false;
}
} else {
// document is not encrypted
- ret = gTrue;
+ ret = true;
}
return ret;
}
@@ -619,11 +619,11 @@ std::vector<FormWidgetSignature*> PDFDoc::getSignatureWidgets()
void PDFDoc::displayPage(OutputDev *out, int page,
double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool crop, GBool printing,
- GBool (*abortCheckCbk)(void *data),
+ bool useMediaBox, bool crop, bool printing,
+ bool (*abortCheckCbk)(void *data),
void *abortCheckCbkData,
- GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
- void *annotDisplayDecideCbkData, GBool copyXRef) {
+ bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
+ void *annotDisplayDecideCbkData, bool copyXRef) {
if (globalParams->getPrintCommands()) {
printf("***** page %d *****\n", page);
}
@@ -638,10 +638,10 @@ void PDFDoc::displayPage(OutputDev *out, int page,
void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool crop, GBool printing,
- GBool (*abortCheckCbk)(void *data),
+ bool useMediaBox, bool crop, bool printing,
+ bool (*abortCheckCbk)(void *data),
void *abortCheckCbkData,
- GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
+ bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
void *annotDisplayDecideCbkData) {
int page;
@@ -654,12 +654,12 @@ void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
void PDFDoc::displayPageSlice(OutputDev *out, int page,
double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool crop, GBool printing,
+ bool useMediaBox, bool crop, bool printing,
int sliceX, int sliceY, int sliceW, int sliceH,
- GBool (*abortCheckCbk)(void *data),
+ bool (*abortCheckCbk)(void *data),
void *abortCheckCbkData,
- GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
- void *annotDisplayDecideCbkData, GBool copyXRef) {
+ bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
+ void *annotDisplayDecideCbkData, bool copyXRef) {
if (getPage(page))
getPage(page)->displaySlice(out, hDPI, vDPI,
rotate, useMediaBox, crop,
@@ -691,19 +691,19 @@ Linearization *PDFDoc::getLinearization()
return linearization;
}
-GBool PDFDoc::checkLinearization() {
+bool PDFDoc::checkLinearization() {
if (linearization == nullptr)
- return gFalse;
+ return false;
if (linearizationState == 1)
- return gTrue;
+ return true;
if (linearizationState == 2)
- return gFalse;
+ return false;
if (!hints) {
hints = new Hints(str, linearization, getXRef(), secHdlr);
}
if (!hints->isOk()) {
linearizationState = 2;
- return gFalse;
+ return false;
}
for (int page = 1; page <= linearization->getNumPages(); page++) {
Ref pageRef;
@@ -711,35 +711,35 @@ GBool PDFDoc::checkLinearization() {
pageRef.num = hints->getPageObjectNum(page);
if (!pageRef.num) {
linearizationState = 2;
- return gFalse;
+ return false;
}
// check for bogus ref - this can happen in corrupted PDF files
if (pageRef.num < 0 || pageRef.num >= xref->getNumObjects()) {
linearizationState = 2;
- return gFalse;
+ return false;
}
pageRef.gen = xref->getEntry(pageRef.num)->gen;
Object obj = xref->fetch(pageRef.num, pageRef.gen);
if (!obj.isDict("Page")) {
linearizationState = 2;
- return gFalse;
+ return false;
}
}
linearizationState = 1;
- return gTrue;
+ return true;
}
-GBool PDFDoc::isLinearized(GBool tryingToReconstruct) {
+bool PDFDoc::isLinearized(bool tryingToReconstruct) {
if ((str->getLength()) &&
(getLinearization()->getLength() == str->getLength()))
- return gTrue;
+ return true;
else {
if (tryingToReconstruct)
return getLinearization()->getLength() > 0;
else
- return gFalse;
+ return false;
}
}
@@ -751,7 +751,7 @@ void PDFDoc::setDocInfoModified(Object *infoObj)
void PDFDoc::setDocInfoStringEntry(const char *key, GooString *value)
{
- GBool removeEntry = !value || value->getLength() == 0 || value->hasJustUnicodeMarker();
+ bool removeEntry = !value || value->getLength() == 0 || value->hasJustUnicodeMarker();
if (removeEntry) {
delete value;
}
@@ -797,14 +797,14 @@ GooString *PDFDoc::getDocInfoStringEntry(const char *key) {
return result;
}
-static GBool
+static bool
get_id (const GooString *encodedidstring, GooString *id) {
const char *encodedid = encodedidstring->getCString();
char pdfid[pdfIdLength + 1];
int n;
if (encodedidstring->getLength() != pdfIdLength / 2)
- return gFalse;
+ return false;
n = sprintf(pdfid, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
encodedid[0] & 0xff, encodedid[1] & 0xff, encodedid[2] & 0xff, encodedid[3] & 0xff,
@@ -812,13 +812,13 @@ get_id (const GooString *encodedidstring, GooString *id) {
encodedid[8] & 0xff, encodedid[9] & 0xff, encodedid[10] & 0xff, encodedid[11] & 0xff,
encodedid[12] & 0xff, encodedid[13] & 0xff, encodedid[14] & 0xff, encodedid[15] & 0xff);
if (n != pdfIdLength)
- return gFalse;
+ return false;
id->Set(pdfid, pdfIdLength);
- return gTrue;
+ return true;
}
-GBool PDFDoc::getID(GooString *permanent_id, GooString *update_id) const {
+bool PDFDoc::getID(GooString *permanent_id, GooString *update_id) const {
Object obj = xref->getTrailerDict()->dictLookup ("ID");
if (obj.isArray() && obj.arrayGetLength() == 2) {
@@ -826,11 +826,11 @@ GBool PDFDoc::getID(GooString *permanent_id, GooString *update_id) const {
Object obj2 = obj.arrayGet(0);
if (obj2.isString()) {
if (!get_id (obj2.getString(), permanent_id)) {
- return gFalse;
+ return false;
}
} else {
error(errSyntaxError, -1, "Invalid permanent ID");
- return gFalse;
+ return false;
}
}
@@ -838,18 +838,18 @@ GBool PDFDoc::getID(GooString *permanent_id, GooString *update_id) const {
Object obj2 = obj.arrayGet(1);
if (obj2.isString()) {
if (!get_id (obj2.getString(), update_id)) {
- return gFalse;
+ return false;
}
} else {
error(errSyntaxError, -1, "Invalid update ID");
- return gFalse;
+ return false;
}
}
- return gTrue;
+ return true;
}
- return gFalse;
+ return false;
}
Hints *PDFDoc::getHints()
@@ -914,7 +914,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
if (trailerObj->isDict()) {
markPageObjects(trailerObj->getDict(), yRef, countRef, 0, refPage->num, rootNum + 2);
}
- yRef->add(0, 65535, 0, gFalse);
+ yRef->add(0, 65535, 0, false);
writeHeader(outStr, getPDFMajorVersion(), getPDFMinorVersion());
// get and mark info dict
@@ -926,7 +926,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
Dict *trailerDict = trailerObj->getDict();
Object ref = trailerDict->lookupNF("Info");
if (ref.isRef()) {
- yRef->add(ref.getRef().num, ref.getRef().gen, 0, gTrue);
+ yRef->add(ref.getRef().num, ref.getRef().gen, 0, true);
if (getXRef()->getEntry(ref.getRef().num)->type == xrefEntryCompressed) {
yRef->getEntry(ref.getRef().num)->type = xrefEntryCompressed;
}
@@ -964,7 +964,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
yRef->markUnencrypted();
writePageObjects(outStr, yRef, 0);
- yRef->add(rootNum,0,outStr->getPos(),gTrue);
+ yRef->add(rootNum,0,outStr->getPos(),true);
outStr->printf("%d 0 obj\n", rootNum);
outStr->printf("<< /Type /Catalog /Pages %d 0 R", rootNum + 1);
for (int j = 0; j < catDict->getLength(); j++) {
@@ -981,7 +981,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
}
outStr->printf(">>\nendobj\n");
- yRef->add(rootNum + 1,0,outStr->getPos(),gTrue);
+ yRef->add(rootNum + 1,0,outStr->getPos(),true);
outStr->printf("%d 0 obj\n", rootNum + 1);
outStr->printf("<< /Type /Pages /Kids [ %d 0 R ] /Count 1 ", rootNum + 2);
if (resourcesObj.isDict()) {
@@ -991,7 +991,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
outStr->printf(">>\n");
outStr->printf("endobj\n");
- yRef->add(rootNum + 2,0,outStr->getPos(),gTrue);
+ yRef->add(rootNum + 2,0,outStr->getPos(),true);
outStr->printf("%d 0 obj\n", rootNum + 2);
outStr->printf("<< ");
for (int n = 0; n < pageDict->getLength(); n++) {
@@ -1011,9 +1011,9 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
Ref ref;
ref.num = rootNum;
ref.gen = 0;
- Object trailerDict = createTrailerDict(rootNum + 3, gFalse, 0, &ref, getXRef(),
+ Object trailerDict = createTrailerDict(rootNum + 3, false, 0, &ref, getXRef(),
name->getCString(), uxrefOffset);
- writeXRefTableTrailer(std::move(trailerDict), yRef, gFalse /* do not write unnecessary entries */,
+ writeXRefTableTrailer(std::move(trailerDict), yRef, false /* do not write unnecessary entries */,
uxrefOffset, outStr, getXRef());
outStr->close();
@@ -1112,7 +1112,7 @@ void PDFDoc::saveIncrementalUpdate (OutStream* outStr)
xref->getEncryptionParameters(&fileKey, &encAlgorithm, &keyLength);
uxref = new XRef();
- uxref->add(0, 65535, 0, gFalse);
+ uxref->add(0, 65535, 0, false);
xref->lock();
for(int i=0; i<xref->getNumObjects(); i++) {
if ((xref->getEntry(i)->type == xrefEntryFree) &&
@@ -1128,14 +1128,14 @@ void PDFDoc::saveIncrementalUpdate (OutStream* outStr)
Goffset offset = writeObjectHeader(&ref, outStr);
writeObject(&obj1, outStr, fileKey, encAlgorithm, keyLength, ref.num, ref.gen);
writeObjectFooter(outStr);
- uxref->add(ref.num, ref.gen, offset, gTrue);
+ uxref->add(ref.num, ref.gen, offset, true);
} else {
- uxref->add(ref.num, ref.gen, 0, gFalse);
+ uxref->add(ref.num, ref.gen, 0, false);
}
}
}
xref->unlock();
- // because of "uxref->add(0, 65535, 0, gFalse);" uxref->getNumObjects() will
+ // because of "uxref->add(0, 65535, 0, false);" uxref->getNumObjects() will
// always be >= 1; if it is 1, it means there is nothing to update
if (uxref->getNumObjects() == 1) {
delete uxref;
@@ -1150,20 +1150,20 @@ void PDFDoc::saveIncrementalUpdate (OutStream* outStr)
rootRef.gen = getXRef()->getRootGen();
// Output a xref stream if there is a xref stream already
- GBool xRefStream = xref->isXRefStream();
+ bool xRefStream = xref->isXRefStream();
if (xRefStream) {
// Append an entry for the xref stream itself
uxrefStreamRef.num = numobjects++;
uxrefStreamRef.gen = 0;
- uxref->add(uxrefStreamRef.num, uxrefStreamRef.gen, uxrefOffset, gTrue);
+ uxref->add(uxrefStreamRef.num, uxrefStreamRef.gen, uxrefOffset, true);
}
- Object trailerDict = createTrailerDict(numobjects, gTrue, getStartXRef(), &rootRef, getXRef(), fileNameA, uxrefOffset);
+ Object trailerDict = createTrailerDict(numobjects, true, getStartXRef(), &rootRef, getXRef(), fileNameA, uxrefOffset);
if (xRefStream) {
writeXRefStreamTrailer(std::move(trailerDict), uxref, &uxrefStreamRef, uxrefOffset, outStr, getXRef());
} else {
- writeXRefTableTrailer(std::move(trailerDict), uxref, gFalse, uxrefOffset, outStr, getXRef());
+ writeXRefTableTrailer(std::move(trailerDict), uxref, false, uxrefOffset, outStr, getXRef());
}
delete uxref;
@@ -1182,7 +1182,7 @@ void PDFDoc::saveCompleteRewrite (OutStream* outStr)
writeHeader(outStr, getPDFMajorVersion(), getPDFMinorVersion());
XRef *uxref = new XRef();
- uxref->add(0, 65535, 0, gFalse);
+ uxref->add(0, 65535, 0, false);
xref->lock();
for(int i=0; i<xref->getNumObjects(); i++) {
Ref ref;
@@ -1193,12 +1193,12 @@ void PDFDoc::saveCompleteRewrite (OutStream* outStr)
/* the XRef class adds a lot of irrelevant free entries, we only want the significant one
and we don't want the one with num=0 because it has already been added (gen = 65535)*/
if (ref.gen > 0 && ref.num > 0)
- uxref->add(ref.num, ref.gen, 0, gFalse);
+ uxref->add(ref.num, ref.gen, 0, false);
} else if (xref->getEntry(i)->getFlag(XRefEntry::DontRewrite)) {
// This entry must not be written, put a free entry instead (with incremented gen)
ref.num = i;
ref.gen = xref->getEntry(i)->gen + 1;
- uxref->add(ref.num, ref.gen, 0, gFalse);
+ uxref->add(ref.num, ref.gen, 0, false);
} else if (type == xrefEntryUncompressed){
ref.num = i;
ref.gen = xref->getEntry(i)->gen;
@@ -1211,7 +1211,7 @@ void PDFDoc::saveCompleteRewrite (OutStream* outStr)
writeObject(&obj1, outStr, fileKey, encAlgorithm, keyLength, ref.num, ref.gen);
}
writeObjectFooter(outStr);
- uxref->add(ref.num, ref.gen, offset, gTrue);
+ uxref->add(ref.num, ref.gen, offset, true);
} else if (type == xrefEntryCompressed) {
ref.num = i;
ref.gen = 0; //compressed entries have gen == 0
@@ -1219,13 +1219,13 @@ void PDFDoc::saveCompleteRewrite (OutStream* outStr)
Goffset offset = writeObjectHeader(&ref, outStr);
writeObject(&obj1, outStr, fileKey, encAlgorithm, keyLength, ref.num, ref.gen);
writeObjectFooter(outStr);
- uxref->add(ref.num, ref.gen, offset, gTrue);
+ uxref->add(ref.num, ref.gen, offset, true);
}
}
xref->unlock();
Goffset uxrefOffset = outStr->getPos();
- writeXRefTableTrailer(uxrefOffset, uxref, gTrue /* write all entries */,
- uxref->getNumObjects(), outStr, gFalse /* complete rewrite */);
+ writeXRefTableTrailer(uxrefOffset, uxref, true /* write all entries */,
+ uxref->getNumObjects(), outStr, false /* complete rewrite */);
delete uxref;
}
@@ -1249,7 +1249,7 @@ void PDFDoc::writeDictionnary (Dict* dict, OutStream* outStr, XRef *xRef, Guint
outStr->printf("<<");
for (int i=0; i<dict->getLength(); i++) {