Remove method GooList::get
Use operator[] instead. This is another move towards discarding
GooList in favor of std::vector.
diff --git a/cpp/poppler-font.cpp b/cpp/poppler-font.cpp
index 6cec12c..8b788cb 100644
--- a/cpp/poppler-font.cpp
+++ b/cpp/poppler-font.cpp
@@ -223,7 +223,7 @@
}
std::vector<font_info> fonts(items->size());
for (std::size_t i = 0; i < items->size(); ++i) {
- fonts[i] = font_info(*new font_info_private((FontInfo *)items->get(i)));
+ fonts[i] = font_info(*new font_info_private((*items)[i]));
}
for (auto entry : *items) {
delete entry;
diff --git a/cpp/poppler-toc.cpp b/cpp/poppler-toc.cpp
index 091b34c..7aacee9 100644
--- a/cpp/poppler-toc.cpp
+++ b/cpp/poppler-toc.cpp
@@ -79,7 +79,7 @@
const int num_items = items->size();
children.resize(num_items);
for (int i = 0; i < num_items; ++i) {
- OutlineItem *item = (OutlineItem *)items->get(i);
+ OutlineItem *item = (*items)[i];
toc_item *new_item = new toc_item();
new_item->d->load(item);
diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc
index b78d34f..d5c8dd8 100644
--- a/glib/poppler-action.cc
+++ b/glib/poppler-action.cc
@@ -590,7 +590,7 @@
}
for (std::size_t i = 0; i < st_list->size(); ++i) {
- LinkOCGState::StateList *list = (LinkOCGState::StateList *)st_list->get(i);
+ LinkOCGState::StateList *list = (*st_list)[i];
PopplerActionLayer *action_layer = g_slice_new0 (PopplerActionLayer);
switch (list->st) {
@@ -606,7 +606,7 @@
}
for (std::size_t j = 0; j < list->list->size(); ++j) {
- Ref *ref = (Ref *)list->list->get(j);
+ Ref *ref = (*list->list)[j];
PopplerLayer *layer = get_layer_for_ref (document, document->layers, ref, preserve_rb);
action_layer->layers = g_list_prepend (action_layer->layers, layer);
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 8f6c6b7..e1d4614 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -2273,7 +2273,7 @@
g_return_val_if_fail (parent != nullptr, NULL);
- item = (OutlineItem *)parent->items->get (parent->index);
+ item = (*parent->items)[parent->index];
item->open ();
if (! (item->hasKids() && item->getKids()) )
return nullptr;
@@ -2326,7 +2326,7 @@
{
OutlineItem *item;
- item = (OutlineItem *)iter->items->get (iter->index);
+ item = (*iter->items)[iter->index];
return item->isOpen();
}
@@ -2350,7 +2350,7 @@
g_return_val_if_fail (iter != nullptr, NULL);
- item = (OutlineItem *)iter->items->get (iter->index);
+ item = (*iter->items)[iter->index];
link_action = item->getAction ();
title = unicode_to_char (item->getTitle(),
@@ -2423,7 +2423,7 @@
GooString *name;
FontInfo *info;
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
name = info->getName();
if (name != nullptr) {
@@ -2448,7 +2448,7 @@
const char *name;
name = poppler_fonts_iter_get_full_name (iter);
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
if (info->getSubset() && name) {
while (*name && *name != '+')
@@ -2478,7 +2478,7 @@
GooString *name;
FontInfo *info;
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
name = info->getSubstituteName();
if (name != nullptr) {
@@ -2503,7 +2503,7 @@
GooString *file;
FontInfo *info;
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
file = info->getFile();
if (file != nullptr) {
@@ -2528,7 +2528,7 @@
g_return_val_if_fail (iter != nullptr, POPPLER_FONT_TYPE_UNKNOWN);
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
return (PopplerFontType)info->getType ();
}
@@ -2549,7 +2549,7 @@
GooString *encoding;
FontInfo *info;
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
encoding = info->getEncoding();
if (encoding != nullptr) {
@@ -2572,7 +2572,7 @@
{
FontInfo *info;
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
return info->getEmbedded();
}
@@ -2590,7 +2590,7 @@
{
FontInfo *info;
- info = (FontInfo *)iter->items->get (iter->index);
+ info = (*iter->items)[iter->index];
return info->getSubset();
}
@@ -2634,7 +2634,7 @@
new_iter->items = new GooList<FontInfo*> ();
for (std::size_t i = 0; i < iter->items->size(); i++) {
- FontInfo *info = (FontInfo *)iter->items->get(i);
+ FontInfo *info = (*iter->items)[i];
new_iter->items->push_back (new FontInfo (*info));
}
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index ec54950..b2db640 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -661,7 +661,7 @@
selection_style, scale);
for (std::size_t i = 0; i < list->size(); i++) {
- PDFRectangle *selection_rect = (PDFRectangle *) list->get(i);
+ PDFRectangle *selection_rect = (*list)[i];
PopplerRectangle *rect;
rect = poppler_rectangle_new ();
@@ -751,7 +751,7 @@
region = cairo_region_create ();
for (std::size_t i = 0; i < list->size(); i++) {
- PDFRectangle *selection_rect = (PDFRectangle *) list->get(i);
+ PDFRectangle *selection_rect = (*list)[i];
cairo_rectangle_int_t rect;
rect.x = (gint) ((selection_rect->x1 * scale) + 0.5);
@@ -2191,7 +2191,7 @@
n_rects += line_words->size() - 1;
for (std::size_t j = 0; j < line_words->size(); j++)
{
- TextWordSelection *word_sel = (TextWordSelection *)line_words->get(j);
+ TextWordSelection *word_sel = (*line_words)[j];
n_rects += word_sel->getEnd() - word_sel->getBegin();
}
}
@@ -2204,7 +2204,7 @@
auto *line_words = word_list[i];
for (std::size_t j = 0; j < line_words->size(); j++)
{
- TextWordSelection *word_sel = (TextWordSelection *)line_words->get(j);
+ TextWordSelection *word_sel = (*line_words)[j];
TextWord *word = word_sel->getWord();
int end = word_sel->getEnd();
@@ -2224,7 +2224,7 @@
if (j < line_words->size() - 1)
{
- TextWordSelection *word_sel = (TextWordSelection *)line_words->get(j + 1);
+ TextWordSelection *word_sel = (*line_words)[j + 1];
word_sel->getWord()->getBBox(&x3, &y3, &x4, &y4);
// space is from one word to other and with the same height as
@@ -2373,7 +2373,7 @@
auto *line_words = word_list[i];
for (std::size_t j = 0; j < line_words->size(); j++)
{
- TextWordSelection *word_sel = (TextWordSelection *)line_words->get(j);
+ TextWordSelection *word_sel = (*line_words)[j];
int end = word_sel->getEnd();
word = word_sel->getWord();
diff --git a/goo/GooList.h b/goo/GooList.h
index 3e64811..c95dbcc 100644
--- a/goo/GooList.h
+++ b/goo/GooList.h
@@ -48,10 +48,6 @@
// Zero cost conversion from std::vector
explicit GooList(const std::vector<T>& vec) : std::vector<T>(vec) {}
explicit GooList(std::vector<T>&& vec) : std::vector<T>(std::move(vec)) {}
-
- // Return the <i>th element.
- // Assumes 0 <= i < length.
- const T& get(int i) const { return (*this)[i]; }
};
#endif // GOO_LIST_H
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 61e4a07..7f459c1 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -760,29 +760,29 @@
int i = FormFieldText::tokenizeDA(da, daToks, "Tf");
if (i >= 1) {
- fontPtSize = gatof(( (GooString *)daToks->get(i-1) )->c_str());
+ fontPtSize = gatof( (*daToks)[i-1]->c_str());
}
if (i >= 2) {
// We are expecting a name, therefore the first letter should be '/'.
- if (((const char*)daToks->get(i-2)) && ((const char*)daToks->get(i-2))[0] == '/') {
+ if ((*daToks)[i-2] && ((const char*)((*daToks)[i-2]))[0] == '/') {
// The +1 is here to skip the leading '/'.
- fontName = Object(objName, ((const char*)daToks->get(i-2))+1);
+ fontName = Object(objName, ((const char*)(*daToks)[i-2])+1);
}
}
// Scan backwards: we are looking for the last set value
for (i = daToks->size()-1; i >= 0; --i) {
if (!fontColor) {
- if (!((GooString *)daToks->get(i))->cmp("g") && i >= 1) {
- fontColor = std::make_unique<AnnotColor>(gatof(( (GooString *)daToks->get(i-1) )->c_str()));
- } else if (!((GooString *)daToks->get(i))->cmp("rg") && i >= 3) {
- fontColor = std::make_unique<AnnotColor>(gatof(( (GooString *)daToks->get(i-3) )->c_str()),
- gatof(( (GooString *)daToks->get(i-2) )->c_str()),
- gatof(( (GooString *)daToks->get(i-1) )->c_str()));
- } else if (!((GooString *)daToks->get(i))->cmp("k") && i >= 4) {
- fontColor = std::make_unique<AnnotColor>(gatof(( (GooString *)daToks->get(i-4) )->c_str()),
- gatof(( (GooString *)daToks->get(i-3) )->c_str()),
- gatof(( (GooString *)daToks->get(i-2) )->c_str()),
- gatof(( (GooString *)daToks->get(i-1) )->c_str()));
+ if (!((*daToks)[i])->cmp("g") && i >= 1) {
+ fontColor = std::make_unique<AnnotColor>(gatof(( (*daToks)[i-1] )->c_str()));
+ } else if (!((*daToks)[i])->cmp("rg") && i >= 3) {
+ fontColor = std::make_unique<AnnotColor>(gatof(( (*daToks)[i-3] )->c_str()),
+ gatof(( (*daToks)[i-2] )->c_str()),
+ gatof(( (*daToks)[i-1] )->c_str()));
+ } else if (!((*daToks)[i])->cmp("k") && i >= 4) {
+ fontColor = std::make_unique<AnnotColor>(gatof(( (*daToks)[i-4] )->c_str()),
+ gatof(( (*daToks)[i-3] )->c_str()),
+ gatof(( (*daToks)[i-2] )->c_str()),
+ gatof(( (*daToks)[i-1] )->c_str()));
}
}
}
@@ -4064,9 +4064,9 @@
}
}
for (i = 2; i < (int)daToks->size(); ++i) {
- if (i >= 2 && !((GooString *)daToks->get(i))->cmp("Tf")) {
+ if (i >= 2 && !((*daToks)[i])->cmp("Tf")) {
tfPos = i - 2;
- } else if (i >= 6 && !((GooString *)daToks->get(i))->cmp("Tm")) {
+ } else if (i >= 6 && !((*daToks)[i])->cmp("Tm")) {
tmPos = i - 6;
}
}
@@ -4081,7 +4081,7 @@
*addedDingbatsResource = false;
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos);
+ tok = (*daToks)[tfPos];
if (tok->cmp("/ZaDb")) {
tok->clear();
tok->append("/ZaDb");
@@ -4092,7 +4092,7 @@
font = nullptr;
fontSize = 0;
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos);
+ tok = (*daToks)[tfPos];
if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
if (!resources || !(font = resources->lookupFont(tok->c_str() + 1))) {
if (forceZapfDingbats) {
@@ -4113,7 +4113,7 @@
} else {
error(errSyntaxError, -1, "Invalid font name in 'Tf' operator in field's DA string");
}
- tok = (GooString *)daToks->get(tfPos + 1);
+ tok = (*daToks)[tfPos + 1];
fontSize = gatof(tok->c_str());
} else {
error(errSyntaxError, -1, "Missing 'Tf' operator in field's DA string");
@@ -4197,7 +4197,7 @@
}
}
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos + 1);
+ tok = (*daToks)[tfPos + 1];
tok->clear();
tok->appendf("{0:.2f}", fontSize);
}
@@ -4210,10 +4210,10 @@
// set the font matrix
if (tmPos >= 0) {
- tok = (GooString *)daToks->get(tmPos + 4);
+ tok = (*daToks)[tmPos + 4];
tok->clear();
tok->append('0');
- tok = (GooString *)daToks->get(tmPos + 5);
+ tok = (*daToks)[tmPos + 5];
tok->clear();
tok->appendf("{0:.2f}", y);
}
@@ -4221,7 +4221,7 @@
// write the DA string
if (daToks) {
for (i = 0; i < (int)daToks->size(); ++i) {
- appearBuf->append((GooString *)daToks->get(i))->append(' ');
+ appearBuf->append((*daToks)[i])->append(' ');
}
}
@@ -4280,7 +4280,7 @@
}
fontSize = floor(fontSize);
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos + 1);
+ tok = (*daToks)[tfPos + 1];
tok->clear();
tok->appendf("{0:.2f}", fontSize);
}
@@ -4309,10 +4309,10 @@
// set the font matrix
if (tmPos >= 0) {
- tok = (GooString *)daToks->get(tmPos + 4);
+ tok = (*daToks)[tmPos + 4];
tok->clear();
tok->appendf("{0:.2f}", x);
- tok = (GooString *)daToks->get(tmPos + 5);
+ tok = (*daToks)[tmPos + 5];
tok->clear();
tok->appendf("{0:.2f}", y);
}
@@ -4320,7 +4320,7 @@
// write the DA string
if (daToks) {
for (i = 0; i < (int)daToks->size(); ++i) {
- appearBuf->append((GooString *)daToks->get(i))->append(' ');
+ appearBuf->append((*daToks)[i])->append(' ');
}
}
@@ -4375,7 +4375,7 @@
}
fontSize = floor(fontSize);
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos + 1);
+ tok = (*daToks)[tfPos + 1];
tok->clear();
tok->appendf("{0:.2f}", fontSize);
}
@@ -4399,10 +4399,10 @@
// set the font matrix
if (tmPos >= 0) {
- tok = (GooString *)daToks->get(tmPos + 4);
+ tok = (*daToks)[tmPos + 4];
tok->clear();
tok->appendf("{0:.2f}", x);
- tok = (GooString *)daToks->get(tmPos + 5);
+ tok = (*daToks)[tmPos + 5];
tok->clear();
tok->appendf("{0:.2f}", y);
}
@@ -4410,7 +4410,7 @@
// write the DA string
if (daToks) {
for (std::size_t i = 0; i < daToks->size(); ++i) {
- appearBuf->append((GooString *)daToks->get(i))->append(' ');
+ appearBuf->append((*daToks)[i])->append(' ');
}
}
@@ -4478,9 +4478,9 @@
}
}
for (std::size_t i = 2; i < daToks->size(); ++i) {
- if (i >= 2 && !((GooString *)daToks->get(i))->cmp("Tf")) {
+ if (i >= 2 && !((*daToks)[i])->cmp("Tf")) {
tfPos = i - 2;
- } else if (i >= 6 && !((GooString *)daToks->get(i))->cmp("Tm")) {
+ } else if (i >= 6 && !((*daToks)[i])->cmp("Tm")) {
tmPos = i - 6;
}
}
@@ -4492,7 +4492,7 @@
font = nullptr;
fontSize = 0;
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos);
+ tok = (*daToks)[tfPos];
if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
if (!resources || !(font = resources->lookupFont(tok->c_str() + 1))) {
error(errSyntaxError, -1, "Unknown font in field's DA string");
@@ -4500,7 +4500,7 @@
} else {
error(errSyntaxError, -1, "Invalid font name in 'Tf' operator in field's DA string");
}
- tok = (GooString *)daToks->get(tfPos + 1);
+ tok = (*daToks)[tfPos + 1];
fontSize = gatof(tok->c_str());
} else {
error(errSyntaxError, -1, "Missing 'Tf' operator in field's DA string");
@@ -4545,7 +4545,7 @@
}
fontSize = floor(fontSize);
if (tfPos >= 0) {
- tok = (GooString *)daToks->get(tfPos + 1);
+ tok = (*daToks)[tfPos + 1];
tok->clear();
tok->appendf("{0:.2f}", fontSize);
}
@@ -4588,10 +4588,10 @@
// set the font matrix
if (tmPos >= 0) {
- tok = (GooString *)daToks->get(tmPos + 4);
+ tok = (*daToks)[tmPos + 4];
tok->clear();
tok->appendf("{0:.2f}", x);
- tok = (GooString *)daToks->get(tmPos + 5);
+ tok = (*daToks)[tmPos + 5];
tok->clear();
tok->appendf("{0:.2f}", y);
}
@@ -4599,7 +4599,7 @@
// write the DA string
if (daToks) {
for (std::size_t j = 0; j < daToks->size(); ++j) {
- appearBuf->append((GooString *)daToks->get(j))->append(' ');
+ appearBuf->append((*daToks)[j])->append(' ');
}
}
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 95d4889..880c233 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -1218,7 +1218,7 @@
double fontSize = -1;
if (idx >= 0) {
char* p = nullptr;
- fontSize = strtod(static_cast<GooString*>(daToks->get(idx))->c_str(), &p);
+ fontSize = strtod((*daToks)[idx]->c_str(), &p);
if (!p || *p)
fontSize = -1;
}
@@ -1251,7 +1251,7 @@
if (i == (std::size_t)idx) {
defaultAppearance->appendf("{0:d}", fontSize);
} else {
- defaultAppearance->append(static_cast<GooString*>(daToks->get(i)));
+ defaultAppearance->append((*daToks)[i]);
}
}
for (auto entry : *daToks) {
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 00452af..c1f1742 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -2877,7 +2877,7 @@
default:
unsigned int newOverprintMask = 0x10;
for (std::size_t i = 0; i < separationList->size(); i++) {
- GfxSeparationColorSpace *sepCS = (GfxSeparationColorSpace *)separationList->get(i);
+ GfxSeparationColorSpace *sepCS = (*separationList)[i];
if (!sepCS->getName()->cmp(name)) {
if (sepCS->getFunc()->hasDifferentResultSet(func)) {
error(errSyntaxWarning, -1,
@@ -2990,7 +2990,7 @@
auto sepsCSA = new GooList<GfxSeparationColorSpace*>();
sepsCSA->reserve(sepsCS->size());
for (std::size_t i = 0; i < sepsCS->size(); i++) {
- GfxSeparationColorSpace *scs = (GfxSeparationColorSpace *) sepsCS->get(i);
+ GfxSeparationColorSpace *scs = (*sepsCS)[i];
if (likely(scs != nullptr)) {
sepsCSA->push_back((GfxSeparationColorSpace*)scs->copy());
}
@@ -3182,7 +3182,7 @@
sepFunc = func;
else {
for (std::size_t k = 0; k < sepsCS->size(); k++) {
- GfxSeparationColorSpace *sepCS = (GfxSeparationColorSpace *)sepsCS->get(k);
+ GfxSeparationColorSpace *sepCS = (*sepsCS)[k];
if (!sepCS->getName()->cmp(names[i])) {
sepFunc = sepCS->getFunc();
break;
@@ -3190,7 +3190,7 @@
}
}
for (std::size_t j = 0; j < separationList->size(); j++) {
- GfxSeparationColorSpace *sepCS = (GfxSeparationColorSpace *)separationList->get(j);
+ GfxSeparationColorSpace *sepCS = (*separationList)[j];
if (!sepCS->getName()->cmp(names[i])) {
if (sepFunc != nullptr && sepCS->getFunc()->hasDifferentResultSet(sepFunc)) {
error(errSyntaxWarning, -1,
@@ -3222,7 +3222,7 @@
separationList->push_back(new GfxSeparationColorSpace(names[i]->copy(),alt->copy(), func->copy()));
else {
for (std::size_t k = 0; k < sepsCS->size(); k++) {
- GfxSeparationColorSpace *sepCS = (GfxSeparationColorSpace *)sepsCS->get(k);
+ GfxSeparationColorSpace *sepCS = (*sepsCS)[k];
if (!sepCS->getName()->cmp(names[i])) {
found = true;
separationList->push_back((GfxSeparationColorSpace*)sepCS->copy());
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 93f6027..3acd60d 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -341,7 +341,7 @@
// search for the font
fi = nullptr;
for (std::size_t i = 0; i < fonts->size(); ++i) {
- fi = (SysFontInfo *)fonts->get(i);
+ fi = (*fonts)[i];
if (fi->match(name2, bold, italic, oblique, fixedWidth)) {
break;
}
@@ -350,7 +350,7 @@
if (!fi && !exact && bold) {
// try ignoring the bold flag
for (std::size_t i = 0; i < fonts->size(); ++i) {
- fi = (SysFontInfo *)fonts->get(i);
+ fi = (*fonts)[i];
if (fi->match(name2, false, italic)) {
break;
}
@@ -360,7 +360,7 @@
if (!fi && !exact && (bold || italic)) {
// try ignoring the bold and italic flags
for (std::size_t i = 0; i < fonts->size(); ++i) {
- fi = (SysFontInfo *)fonts->get(i);
+ fi = (*fonts)[i];
if (fi->match(name2, false, false)) {
break;
}
@@ -640,7 +640,7 @@
globalParamsLocker();
for (std::size_t i = 0; i < toUnicodeDirs->size(); ++i) {
- dir = (GooString *)toUnicodeDirs->get(i);
+ dir = (*toUnicodeDirs)[i];
fileName = appendToPath(dir->copy(), name->c_str());
f = openFile(fileName->c_str(), "r");
delete fileName;
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 54c0682..e9177ab 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1713,7 +1713,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffDHTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffDW == 0) {
huffDWTable = huffTableB;
@@ -1723,7 +1723,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffDWTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffBMSize == 0) {
huffBMSizeTable = huffTableA;
@@ -1732,7 +1732,7 @@
goto codeTableError;
}
huffBMSizeTable =
- ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffAggInst == 0) {
huffAggInstTable = huffTableA;
@@ -1741,7 +1741,7 @@
goto codeTableError;
}
huffAggInstTable =
- ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
}
delete codeTables;
@@ -2145,7 +2145,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffFSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffFSTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffDS == 0) {
huffDSTable = huffTableH;
@@ -2157,7 +2157,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffDSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffDSTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffDT == 0) {
huffDTTable = huffTableK;
@@ -2169,7 +2169,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffDTTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffDTTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffRDW == 0) {
huffRDWTable = huffTableN;
@@ -2179,7 +2179,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffRDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffRDWTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffRDH == 0) {
huffRDHTable = huffTableN;
@@ -2189,7 +2189,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffRDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffRDHTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffRDX == 0) {
huffRDXTable = huffTableN;
@@ -2199,7 +2199,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffRDXTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffRDXTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffRDY == 0) {
huffRDYTable = huffTableN;
@@ -2209,7 +2209,7 @@
if (i >= codeTables->size()) {
goto codeTableError;
}
- huffRDYTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ huffRDYTable = ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffRSize == 0) {
huffRSizeTable = huffTableA;
@@ -2218,7 +2218,7 @@
goto codeTableError;
}
huffRSizeTable =
- ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ ((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
}
delete codeTables;
@@ -4183,13 +4183,13 @@
JBIG2Segment *seg;
for (std::size_t i = 0; i < globalSegments->size(); ++i) {
- seg = (JBIG2Segment *)globalSegments->get(i);
+ seg = (*globalSegments)[i];
if (seg->getSegNum() == segNum) {
return seg;
}
}
for (std::size_t i = 0; i < segments->size(); ++i) {
- seg = (JBIG2Segment *)segments->get(i);
+ seg = (*segments)[i];
if (seg->getSegNum() == segNum) {
return seg;
}
diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc
index 886156e..e2b293a 100644
--- a/poppler/OptionalContent.cc
+++ b/poppler/OptionalContent.cc
@@ -471,5 +471,5 @@
}
OCDisplayNode *OCDisplayNode::getChild(int idx) const {
- return (OCDisplayNode *)children->get(idx);
+ return (*children)[idx];
}
diff --git a/poppler/PDFDocFactory.cc b/poppler/PDFDocFactory.cc
index 33bba59..9ac973f 100644
--- a/poppler/PDFDocFactory.cc
+++ b/poppler/PDFDocFactory.cc
@@ -58,7 +58,7 @@
GooString *userPassword, void *guiDataA)
{
for (int i = builders->size() - 1; i >= 0 ; i--) {
- PDFDocBuilder *builder = (PDFDocBuilder *) builders->get(i);
+ PDFDocBuilder *builder = (*builders)[i];
if (builder->supports(uri)) {
return builder->buildPDFDoc(uri, ownerPassword, userPassword, guiDataA);
}
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 8f10be7..cd65ee0 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -1358,7 +1358,7 @@
if (h > paperHeight)
paperHeight = h;
for (i = 0; i < (int)paperSizes->size(); ++i) {
- size = (PSOutPaperSize *)paperSizes->get(i);
+ size = (*paperSizes)[i];
if (pageDimensionEqual(w, size->w) && pageDimensionEqual(h, size->h))
break;
}
@@ -1570,7 +1570,7 @@
switch (mode) {
case psModePS:
for (std::size_t i = 0; i < paperSizes->size(); ++i) {
- size = (PSOutPaperSize *)paperSizes->get(i);
+ size = (*paperSizes)[i];
writePSFmt("%%{0:s} {1:t} {2:d} {3:d} 0 () ()\n",
i==0 ? "DocumentMedia:" : "+", size->name, size->w, size->h);
}
@@ -1578,7 +1578,7 @@
writePSFmt("%%Pages: {0:d}\n", static_cast<int>(pages.size()));
writePS("%%EndComments\n");
if (!paperMatch) {
- size = (PSOutPaperSize *)paperSizes->get(0);
+ size = (*paperSizes)[0];
writePS("%%BeginDefaults\n");
writePSFmt("%%PageMedia: {0:t}\n", size->name);
writePS("%%EndDefaults\n");
@@ -3839,7 +3839,7 @@
ty += (rotate == 0 || rotate == 180) ? imgLLY : -imgLLX;
if (paperMatch) {
- paperSize = (PSOutPaperSize *)paperSizes->get(pagePaperSize[pageNum]);
+ paperSize = (*paperSizes)[pagePaperSize[pageNum]];
writePSFmt("%%PageMedia: {0:t}\n", paperSize->name);
}
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 151437f..d8b7f0d 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -2343,7 +2343,7 @@
if (idx < 0 || idx >= (int)words->size()) {
return nullptr;
}
- return (TextWord *)words->get(idx);
+ return (*words)[idx];
}
#endif // TEXTOUT_WORD_LIST
@@ -2495,7 +2495,7 @@
// get the font info object
curFont = nullptr;
for (std::size_t i = 0; i < fonts->size(); ++i) {
- curFont = (TextFontInfo *)fonts->get(i);
+ curFont = (*fonts)[i];
if (curFont->matches(state)) {
break;
}
@@ -2849,7 +2849,7 @@
//----- handle underlining
for (std::size_t i = 0; i < underlines->size(); ++i) {
- underline = (TextUnderline *)underlines->get(i);
+ underline = (*underlines)[i];
if (underline->horiz) {
// rot = 0
if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) {
@@ -2912,7 +2912,7 @@
//----- handle links
for (std::size_t i = 0; i < links->size(); ++i) {
- link = (TextLink *)links->get(i);
+ link = (*links)[i];
// rot = 0
if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) {
@@ -4551,7 +4551,7 @@
for (i = 0; i < nLines; i++) {
GooList<TextWordSelection*> *lineWords = lines[i];
for (std::size_t j = 0; j < lineWords->size(); j++) {
- TextWordSelection *sel = (TextWordSelection *)lineWords->get(j);
+ TextWordSelection *sel = (*lineWords)[j];
page->dumpFragment (sel->word->text + sel->begin, sel->end - sel->begin, uMap, text);
if (j < lineWords->size() - 1)
@@ -4755,7 +4755,7 @@
out->updateFillColor(state);
for (std::size_t i = 0; i < selectionList->size(); i++) {
- TextWordSelection *sel = (TextWordSelection *) selectionList->get(i);
+ TextWordSelection *sel = (*selectionList)[i];
int begin = sel->begin;
while (begin < sel->end) {
diff --git a/qt5/src/poppler-fontinfo.cc b/qt5/src/poppler-fontinfo.cc
index ab2206c..08a2422 100644
--- a/qt5/src/poppler-fontinfo.cc
+++ b/qt5/src/poppler-fontinfo.cc
@@ -132,7 +132,7 @@
return fonts;
fonts.reserve( items->size() );
for ( std::size_t i = 0; i < items->size(); ++i ) {
- fonts.append( FontInfo( FontInfoData( ( ::FontInfo* )items->get( i ) ) ) );
+ fonts.append( FontInfo( FontInfoData( (*items)[ i ] ) ) );
}
for ( auto entry : *items ) {
delete entry;
diff --git a/qt5/src/poppler-optcontent.cc b/qt5/src/poppler-optcontent.cc
index f72981f..d010d0c 100644
--- a/qt5/src/poppler-optcontent.cc
+++ b/qt5/src/poppler-optcontent.cc
@@ -400,11 +400,11 @@
const auto *statesList = popplerLinkOCGState->getStateList();
for (std::size_t i = 0; i < statesList->size(); ++i) {
- ::LinkOCGState::StateList *stateList = (::LinkOCGState::StateList*)statesList->get(i);
+ ::LinkOCGState::StateList *stateList = (*statesList)[i];
auto *refsList = stateList->list;
for (std::size_t j = 0; j < refsList->size(); ++j) {
- Ref *ref = (Ref *)refsList->get(j);
+ Ref *ref = (*refsList)[j];
OptContentItem *item = d->itemFromRef(QString::number(ref->num));
if (stateList->st == ::LinkOCGState::On) {
diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc
index 6115b02..7e7193d 100644
--- a/qt5/src/poppler-page.cc
+++ b/qt5/src/poppler-page.cc
@@ -368,7 +368,7 @@
QVector<Link *> links;
for ( std::size_t i = 0; i < nextActions->size(); ++i )
{
- links << convertLinkActionToLink( static_cast< ::LinkAction * >( nextActions->get( i ) ), parentDoc, linkArea );
+ links << convertLinkActionToLink( (*nextActions)[ i ], parentDoc, linkArea );
}
LinkPrivate::get(popplerLink)->nextLinks = links;
}
diff --git a/qt5/src/poppler-private.cc b/qt5/src/poppler-private.cc
index d49596a..9fb230e 100644
--- a/qt5/src/poppler-private.cc
+++ b/qt5/src/poppler-private.cc
@@ -287,7 +287,7 @@
for ( std::size_t i = 0; i < items->size(); ++i )
{
// iterate over every object in 'items'
- ::OutlineItem * outlineItem = (::OutlineItem *)items->get( i );
+ ::OutlineItem * outlineItem = (*items)[ i ];
// 1. create element using outlineItem's title as tagName
QString name;
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 86b4fcd..6be2477 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -5285,7 +5285,7 @@
if(src->getSeparationList()->size() > bitmap->getSeparationList()->size()) {
for (x = bitmap->getSeparationList()->size(); x < (int)src->getSeparationList()->size(); x++)
- bitmap->getSeparationList()->push_back((GfxSeparationColorSpace *)((GfxSeparationColorSpace *)src->getSeparationList()->get(x))->copy());
+ bitmap->getSeparationList()->push_back((GfxSeparationColorSpace *)((*src->getSeparationList())[x])->copy());
}
if (src->alpha) {
pipeInit(&pipe, xDest, yDest, nullptr, pixel,
diff --git a/splash/SplashBitmap.cc b/splash/SplashBitmap.cc
index d4411a0..0afa3fc 100644
--- a/splash/SplashBitmap.cc
+++ b/splash/SplashBitmap.cc
@@ -127,7 +127,7 @@
separationList = new GooList<GfxSeparationColorSpace*>();
if (separationListA != nullptr)
for (std::size_t i = 0; i < separationListA->size(); i++)
- separationList->push_back((GfxSeparationColorSpace*)((GfxSeparationColorSpace *) separationListA->get(i))->copy());
+ separationList->push_back((GfxSeparationColorSpace*)( (*separationListA)[i])->copy());
}
SplashBitmap *SplashBitmap::copy(SplashBitmap *src) {
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 3e894d0..721a6f0 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1674,7 +1674,7 @@
for(std::size_t i = 0; i < glMetaVars->size(); i++)
{
- HtmlMetaVar *t = (HtmlMetaVar*)glMetaVars->get(i);
+ HtmlMetaVar *t = (*glMetaVars)[i];
var = t->toString();
fprintf(file, "%s\n", var->c_str());
delete var;
@@ -1763,7 +1763,7 @@
for (std::size_t i = 0; i < outlines->size(); i++)
{
- OutlineItem *item = (OutlineItem*)outlines->get(i);
+ OutlineItem *item = (*outlines)[i];
GooString *titleStr = HtmlFont::HtmlFilter(item->getTitle(),
item->getTitleLength());
@@ -1824,7 +1824,7 @@
for (std::size_t i = 0; i < outlines->size(); i++)
{
- OutlineItem *item = (OutlineItem*)outlines->get(i);
+ OutlineItem *item = (*outlines)[i];
GooString *titleStr = HtmlFont::HtmlFilter(item->getTitle(),
item->getTitleLength());
int page = getOutlinePageNum(item);
diff --git a/utils/pdffonts.cc b/utils/pdffonts.cc
index 9317ca1..26be4b9 100644
--- a/utils/pdffonts.cc
+++ b/utils/pdffonts.cc
@@ -172,7 +172,7 @@
printf("------------------------------------ --------- ------------------------------------ ------------------------------------\n");
if (fonts) {
for (std::size_t i = 0; i < fonts->size(); ++i) {
- FontInfo *font = (FontInfo *)fonts->get(i);
+ FontInfo *font = (*fonts)[i];
if (font->getFile()) {
printf("%-36s",
font->getName() ? font->getName()->c_str() : "[none]");
@@ -196,7 +196,7 @@
printf("------------------------------------ ----------------- ---------------- --- --- --- ---------\n");
if (fonts) {
for (std::size_t i = 0; i < fonts->size(); ++i) {
- FontInfo *font = (FontInfo *)fonts->get(i);
+ FontInfo *font = (*fonts)[i];
printf("%-36s %-17s %-16s %-3s %-3s %-3s",
font->getName() ? font->getName()->c_str() : "[none]",
fontTypeNames[font->getType()],
diff --git a/utils/printencodings.cc b/utils/printencodings.cc
index 6c37ab1..841bcde 100644
--- a/utils/printencodings.cc
+++ b/utils/printencodings.cc
@@ -34,7 +34,7 @@
printf("Available encodings are:\n");
for (std::size_t i = 0; i < encNames->size(); ++i) {
- GooString *enc = (GooString*)encNames->get(i);
+ GooString *enc = (*encNames)[i];
printf("%s\n", enc->c_str());
}