diff options
author | Oliver Sander <oliver.sander@tu-dresden.de> | 2018-10-21 08:28:56 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2018-10-23 14:19:10 +0200 |
commit | 163420b48bdddf9084208b3cadf04dafad52d40a (patch) | |
tree | e047526fa1d56b914453a6a489f2c91d10e958a3 /glib | |
parent | 22dd47a64222bf967d57b986539ae1be46bc06a7 (diff) |
Replace GBool, gTrue, and gFalse by bool, true, false, resp.
These are just non-standard names for bool, true, false, respectively.
Getting rid of these names saves on layer of mental redirection,
and enables proper syntax highlighting in editors.
Diffstat (limited to 'glib')
-rw-r--r-- | glib/poppler-action.cc | 6 | ||||
-rw-r--r-- | glib/poppler-document.cc | 4 | ||||
-rw-r--r-- | glib/poppler-form-field.cc | 2 | ||||
-rw-r--r-- | glib/poppler-input-stream.cc | 18 | ||||
-rw-r--r-- | glib/poppler-input-stream.h | 12 | ||||
-rw-r--r-- | glib/poppler-page.cc | 44 | ||||
-rw-r--r-- | glib/poppler-structure-element.cc | 4 |
7 files changed, 45 insertions, 45 deletions
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); } |