Commit fa8f3f22 authored by Oliver Sander's avatar Oliver Sander Committed by Albert Astals Cid

Remove method GooList::get

Use operator[] instead.  This is another move towards discarding
GooList in favor of std::vector.
parent 760ca656
......@@ -223,7 +223,7 @@ std::vector<font_info> font_iterator::next()
}
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;
......
......@@ -79,7 +79,7 @@ void toc_item_private::load_children(const GooList<OutlineItem*> *items)
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);
......
......@@ -590,7 +590,7 @@ build_ocg_state (PopplerDocument *document,
}
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 @@ build_ocg_state (PopplerDocument *document,
}
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);
......
......@@ -2273,7 +2273,7 @@ poppler_index_iter_get_child (PopplerIndexIter *parent)
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 @@ poppler_index_iter_is_open (PopplerIndexIter *iter)
{
OutlineItem *item;
item = (OutlineItem *)iter->items->get (iter->index);
item = (*iter->items)[iter->index];
return item->isOpen();
}
......@@ -2350,7 +2350,7 @@ poppler_index_iter_get_action (PopplerIndexIter *iter)
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 @@ poppler_fonts_iter_get_full_name (PopplerFontsIter *iter)
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 @@ poppler_fonts_iter_get_name (PopplerFontsIter *iter)
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 @@ poppler_fonts_iter_get_substitute_name (PopplerFontsIter *iter)
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 @@ poppler_fonts_iter_get_file_name (PopplerFontsIter *iter)
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 @@ poppler_fonts_iter_get_font_type (PopplerFontsIter *iter)
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 @@ poppler_fonts_iter_get_encoding (PopplerFontsIter *iter)
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 @@ poppler_fonts_iter_is_embedded (PopplerFontsIter *iter)
{
FontInfo *info;
info = (FontInfo *)iter->items->get (iter->index);
info = (*iter->items)[iter->index];
return info->getEmbedded();
}
......@@ -2590,7 +2590,7 @@ poppler_fonts_iter_is_subset (PopplerFontsIter *iter)
{
FontInfo *info;
info = (FontInfo *)iter->items->get (iter->index);
info = (*iter->items)[iter->index];
return info->getSubset();
}
......@@ -2634,7 +2634,7 @@ poppler_fonts_iter_copy (PopplerFontsIter *iter)
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));
}
......
......@@ -661,7 +661,7 @@ poppler_page_get_selection_region (PopplerPage *page,
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 @@ poppler_page_get_selected_region (PopplerPage *page,
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 @@ poppler_page_get_text_layout_for_area (PopplerPage *page,
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 @@ poppler_page_get_text_layout_for_area (PopplerPage *page,
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 @@ poppler_page_get_text_layout_for_area (PopplerPage *page,
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 @@ poppler_page_get_text_attributes_for_area (PopplerPage *page,
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();
......
......@@ -48,10 +48,6 @@ public:
// 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
This diff is collapsed.
......@@ -1218,7 +1218,7 @@ double FormFieldText::getTextFontSize()
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 @@ void FormFieldText::setTextFontSize(int fontSize)
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) {
......
......@@ -2877,7 +2877,7 @@ void GfxSeparationColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *s
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 @@ GfxColorSpace *GfxDeviceNColorSpace::copy() {
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 @@ void GfxDeviceNColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *sepa
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 @@ void GfxDeviceNColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *sepa
}
}
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 @@ void GfxDeviceNColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *sepa
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());
......
......@@ -341,7 +341,7 @@ SysFontInfo *SysFontList::find(const GooString *name, bool fixedWidth, bool exac
// 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 @@ SysFontInfo *SysFontList::find(const GooString *name, bool fixedWidth, bool exac
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 @@ SysFontInfo *SysFontList::find(const GooString *name, bool fixedWidth, bool exac
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 @@ FILE *GlobalParams::findToUnicodeFile(const GooString *name) {
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;
......
......@@ -1713,7 +1713,7 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length,
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 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length,
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 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length,
goto codeTableError;
}
huffBMSizeTable =
((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
if (huffAggInst == 0) {
huffAggInstTable = huffTableA;
......@@ -1741,7 +1741,7 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length,
goto codeTableError;
}
huffAggInstTable =
((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
}
delete codeTables;
......@@ -2145,7 +2145,7 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
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 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
goto codeTableError;
}
huffRSizeTable =
((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
((JBIG2CodeTable *)(*codeTables)[i++])->getHuffTable();
}
}
delete codeTables;
......@@ -4183,13 +4183,13 @@ JBIG2Segment *JBIG2Stream::findSegment(unsigned int segNum) {
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;
}
......
......@@ -471,5 +471,5 @@ int OCDisplayNode::getNumChildren() const {
}
OCDisplayNode *OCDisplayNode::getChild(int idx) const {
return (OCDisplayNode *)children->get(idx);
return (*children)[idx];
}
......@@ -58,7 +58,7 @@ PDFDocFactory::createPDFDoc(const GooString &uri, GooString *ownerPassword,
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);
}
......
......@@ -1358,7 +1358,7 @@ void PSOutputDev::postInit()
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 @@ void PSOutputDev::writeHeader(const std::vector<int> &pages,
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 @@ void PSOutputDev::writeHeader(const std::vector<int> &pages,
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 @@ void PSOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
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);
}
......
......@@ -2343,7 +2343,7 @@ TextWord *TextWordList::get(int idx) {
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 @@ void TextPage::updateFont(GfxState *state) {
// 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 @@ void TextPage::coalesce(bool physLayout, double fixedPitch, bool doHTML) {
//----- 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 @@ void TextPage::coalesce(bool physLayout, double fixedPitch, bool doHTML) {
//----- 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 @@ GooString *TextSelectionDumper::getText (void)
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 @@ void TextSelectionPainter::endPage()
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) {
......
......@@ -132,7 +132,7 @@ QList<FontInfo> FontIterator::next()
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;
......
......@@ -400,11 +400,11 @@ namespace Poppler
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) {
......
......@@ -368,7 +368,7 @@ Link* PageData::convertLinkActionToLink(::LinkAction * a, DocumentData *parentDo
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;
}
......
......@@ -287,7 +287,7 @@ namespace Debug {
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;
......
......@@ -5285,7 +5285,7 @@ SplashError Splash::composite(SplashBitmap *src, int xSrc, int ySrc,
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,
......
......@@ -127,7 +127,7 @@ SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPadA,
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) {
......
......@@ -1674,7 +1674,7 @@ void HtmlOutputDev::dumpMetaVars(FILE *file)
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 @@ bool HtmlOutputDev::newHtmlOutlineLevel(FILE *output, const GooList<OutlineItem*
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 @@ void HtmlOutputDev::newXmlOutlineLevel(FILE *output, const GooList<OutlineItem*>
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);
......
......@@ -172,7 +172,7 @@ int main(int argc, char *argv[]) {
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 @@ int main(int argc, char *argv[]) {
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()],
......
......@@ -34,7 +34,7 @@ void printEncodings()
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());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment