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

Remove GooList completely

parent fa8f3f22
......@@ -580,7 +580,6 @@ if(ENABLE_UNSTABLE_API_ABI_HEADERS)
${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h
DESTINATION include/poppler)
install(FILES
goo/GooList.h
goo/GooTimer.h
goo/GooString.h
goo/gmem.h
......
......@@ -217,7 +217,7 @@ std::vector<font_info> font_iterator::next()
++d->current_page;
GooList<FontInfo*> *items = d->font_info_scanner.scan(1);
std::vector<FontInfo*> *items = d->font_info_scanner.scan(1);
if (!items) {
return std::vector<font_info>();
}
......
......@@ -25,8 +25,6 @@
#include <vector>
#include "goo/GooList.h"
class Outline;
class OutlineItem;
......@@ -55,7 +53,7 @@ public:
toc_item_private& operator=(const toc_item_private &) = delete;
void load(const OutlineItem *item);
void load_children(const GooList<OutlineItem*> *items);
void load_children(const std::vector<OutlineItem*> *items);
std::vector<toc_item*> children;
ustring title;
......
......@@ -25,7 +25,6 @@
#include "poppler-toc-private.h"
#include "poppler-private.h"
#include "GooList.h"
#include "Outline.h"
using namespace poppler;
......@@ -44,7 +43,7 @@ toc* toc_private::load_from_outline(Outline *outline)
return nullptr;
}
const GooList<OutlineItem*> *items = outline->getItems();
const std::vector<OutlineItem*> *items = outline->getItems();
if (!items || items->size() < 1) {
return nullptr;
}
......@@ -74,7 +73,7 @@ void toc_item_private::load(const OutlineItem *item)
is_open = item->isOpen();
}
void toc_item_private::load_children(const GooList<OutlineItem*> *items)
void toc_item_private::load_children(const std::vector<OutlineItem*> *items)
{
const int num_items = items->size();
children.resize(num_items);
......@@ -86,7 +85,7 @@ void toc_item_private::load_children(const GooList<OutlineItem*> *items)
children[i] = new_item;
item->open();
const GooList<OutlineItem*> *item_children = item->getKids();
const std::vector<OutlineItem*> *item_children = item->getKids();
if (item_children) {
new_item->d->load_children(item_children);
}
......
......@@ -23,7 +23,6 @@
#include <string.h>
#ifndef __GI_SCANNER__
#include <goo/GooList.h>
#include <splash/SplashBitmap.h>
#include <DateInfo.h>
#include <GlobalParams.h>
......@@ -2163,7 +2162,7 @@ poppler_document_init (PopplerDocument *document)
struct _PopplerIndexIter
{
PopplerDocument *document;
const GooList<OutlineItem*> *items;
const std::vector<OutlineItem*> *items;
int index;
};
......@@ -2238,7 +2237,7 @@ poppler_index_iter_new (PopplerDocument *document)
{
PopplerIndexIter *iter;
Outline *outline;
const GooList<OutlineItem*> *items;
const std::vector<OutlineItem*> *items;
outline = document->doc->getOutline();
if (outline == nullptr)
......@@ -2401,7 +2400,7 @@ poppler_index_iter_free (PopplerIndexIter *iter)
struct _PopplerFontsIter
{
GooList<FontInfo*> *items;
std::vector<FontInfo*> *items;
int index;
};
......@@ -2632,7 +2631,7 @@ poppler_fonts_iter_copy (PopplerFontsIter *iter)
new_iter = g_slice_dup (PopplerFontsIter, iter);
new_iter->items = new GooList<FontInfo*> ();
new_iter->items = new std::vector<FontInfo*> ();
for (std::size_t i = 0; i < iter->items->size(); i++) {
FontInfo *info = (*iter->items)[i];
new_iter->items->push_back (new FontInfo (*info));
......@@ -2662,7 +2661,7 @@ poppler_fonts_iter_free (PopplerFontsIter *iter)
}
static PopplerFontsIter *
poppler_fonts_iter_new (GooList<FontInfo*> *items)
poppler_fonts_iter_new (std::vector<FontInfo*> *items)
{
PopplerFontsIter *iter;
......@@ -2766,7 +2765,7 @@ poppler_font_info_scan (PopplerFontInfo *font_info,
int n_pages,
PopplerFontsIter **iter)
{
GooList<FontInfo*> *items;
std::vector<FontInfo*> *items;
g_return_val_if_fail (iter != nullptr, FALSE);
......
......@@ -20,7 +20,6 @@
#include <math.h>
#ifndef __GI_SCANNER__
#include <goo/GooList.h>
#include <GlobalParams.h>
#include <PDFDoc.h>
#include <Outline.h>
......
//========================================================================
//
// GooList.h
//
// Copyright 2001-2003 Glyph & Cog, LLC
//
//========================================================================
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2012, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================
#ifndef GOO_LIST_H
#define GOO_LIST_H
#include <algorithm>
#include <vector>
//------------------------------------------------------------------------
// GooList
//------------------------------------------------------------------------
template <typename T>
class GooList : public std::vector<T> {
public:
// Create an empty list.
GooList() = default;
// Movable but not copyable
GooList(GooList &&other) = default;
GooList& operator=(GooList &&other) = default;
GooList(const GooList &other) = delete;
GooList& operator=(const GooList &other) = delete;
// 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)) {}
};
#endif // GOO_LIST_H
......@@ -56,7 +56,6 @@
#include <assert.h>
#include "goo/gmem.h"
#include "goo/gstrtod.h"
#include "GooList.h"
#include "Error.h"
#include "Object.h"
#include "Catalog.h"
......@@ -756,7 +755,7 @@ DefaultAppearance::DefaultAppearance(GooString *da) {
fontPtSize = -1;
if (da) {
GooList<GooString*> * daToks = new GooList<GooString*>();
std::vector<GooString*> * daToks = new std::vector<GooString*>();
int i = FormFieldText::tokenizeDA(da, daToks, "Tf");
if (i >= 1) {
......@@ -4031,7 +4030,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
bool txField, bool forceZapfDingbats,
XRef *xref, bool *addedDingbatsResource,
bool password) {
GooList<GooString*> *daToks;
std::vector<GooString*> *daToks;
GooString *tok;
GooString convertedText;
const GfxFont *font;
......@@ -4049,7 +4048,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
// parse the default appearance string
tfPos = tmPos = -1;
if (da) {
daToks = new GooList<GooString*>();
daToks = new std::vector<GooString*>();
i = 0;
while (i < da->getLength()) {
while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
......@@ -4449,7 +4448,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
// Draw the variable text or caption for a field.
bool AnnotAppearanceBuilder::drawListBox(const FormFieldChoice *fieldChoice, const AnnotBorder *border, const PDFRectangle *rect,
const GooString *da, const GfxResources *resources, int quadding) {
GooList<GooString*> *daToks;
std::vector<GooString*> *daToks;
GooString *tok;
GooString convertedText;
const GfxFont *font;
......@@ -4463,7 +4462,7 @@ bool AnnotAppearanceBuilder::drawListBox(const FormFieldChoice *fieldChoice, con
// parse the default appearance string
tfPos = tmPos = -1;
if (da) {
daToks = new GooList<GooString*>();
daToks = new std::vector<GooString*>();
i = 0;
while (i < da->getLength()) {
while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
......
......@@ -51,7 +51,7 @@ FontInfoScanner::FontInfoScanner(PDFDoc *docA, int firstPage) {
FontInfoScanner::~FontInfoScanner() {
}
GooList<FontInfo*> *FontInfoScanner::scan(int nPages) {
std::vector<FontInfo*> *FontInfoScanner::scan(int nPages) {
Page *page;
Dict *resDict;
Annots *annots;
......@@ -61,7 +61,7 @@ GooList<FontInfo*> *FontInfoScanner::scan(int nPages) {
return nullptr;
}
auto result = new GooList<FontInfo*>();
auto result = new std::vector<FontInfo*>();
lastPage = currentPage + nPages;
if (lastPage > doc->getNumPages() + 1) {
......@@ -92,7 +92,7 @@ GooList<FontInfo*> *FontInfoScanner::scan(int nPages) {
return result;
}
void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, GooList<FontInfo*> *fontsList) {
void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, std::vector<FontInfo*> *fontsList) {
GfxFontDict *gfxFontDict;
GfxFont *font;
......
......@@ -26,7 +26,6 @@
#define FONT_INFO_H
#include "Object.h"
#include "goo/GooList.h"
class GfxFont;
class PDFDoc;
......@@ -89,7 +88,7 @@ public:
// Destructor.
~FontInfoScanner();
GooList<FontInfo*> *scan(int nPages);
std::vector<FontInfo*> *scan(int nPages);
private:
......@@ -98,7 +97,7 @@ private:
std::set<int> fonts;
std::set<int> visitedObjects;
void scanFonts(XRef *xrefA, Dict *resDict, GooList<FontInfo*> *fontsList);
void scanFonts(XRef *xrefA, Dict *resDict, std::vector<FontInfo*> *fontsList);
};
#endif
......@@ -1213,7 +1213,7 @@ FormFieldText::~FormFieldText()
double FormFieldText::getTextFontSize()
{
GooList<GooString*>* daToks = new GooList<GooString*>();
std::vector<GooString*>* daToks = new std::vector<GooString*>();
int idx = parseDA(daToks);
double fontSize = -1;
if (idx >= 0) {
......@@ -1232,7 +1232,7 @@ double FormFieldText::getTextFontSize()
void FormFieldText::setTextFontSize(int fontSize)
{
if (fontSize > 0 && obj.isDict()) {
GooList<GooString*>* daToks = new GooList<GooString*>();
std::vector<GooString*>* daToks = new std::vector<GooString*>();
int idx = parseDA(daToks);
if (idx == -1) {
error(errSyntaxError, -1, "FormFieldText:: invalid DA object\n");
......@@ -1264,7 +1264,7 @@ void FormFieldText::setTextFontSize(int fontSize)
}
}
int FormFieldText::tokenizeDA(const GooString* da, GooList<GooString*>* daToks, const char* searchTok)
int FormFieldText::tokenizeDA(const GooString* da, std::vector<GooString*>* daToks, const char* searchTok)
{
int idx = -1;
if(da && daToks) {
......@@ -1288,7 +1288,7 @@ int FormFieldText::tokenizeDA(const GooString* da, GooList<GooString*>* daToks,
return idx;
}
int FormFieldText::parseDA(GooList<GooString*>* daToks)
int FormFieldText::parseDA(std::vector<GooString*>* daToks)
{
int idx = -1;
if (obj.isDict()) {
......
......@@ -24,7 +24,6 @@
#ifndef FORM_H
#define FORM_H
#include "goo/GooList.h"
#include "Object.h"
#include "Annot.h"
......@@ -426,10 +425,10 @@ public:
void print(int indent) override;
static int tokenizeDA(const GooString* daString, GooList<GooString*>* daToks, const char* searchTok);
static int tokenizeDA(const GooString* daString, std::vector<GooString*>* daToks, const char* searchTok);
protected:
int parseDA(GooList<GooString*>* daToks);
int parseDA(std::vector<GooString*>* daToks);
GooString* content;
bool multiline;
......
......@@ -34,7 +34,6 @@
#define GFX_H
#include "poppler-config.h"
#include "goo/GooList.h"
#include "GfxState.h"
#include "Object.h"
#include "PopplerCache.h"
......
......@@ -432,7 +432,7 @@ GfxColorSpace *GfxColorSpace::parse(GfxResources *res, Object *csObj, OutputDev
return cs;
}
void GfxColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps) {
void GfxColorSpace::createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps) {
return;
}
......@@ -2857,7 +2857,7 @@ void GfxSeparationColorSpace::getDefaultColor(GfxColor *color) {
color->c[0] = gfxColorComp1;
}
void GfxSeparationColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps) {
void GfxSeparationColorSpace::createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps) {
if (nonMarking)
return;
mapping = (int *)gmalloc(sizeof(int));
......@@ -2914,7 +2914,7 @@ GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA,
GooString **namesA,
GfxColorSpace *altA,
Function *funcA,
GooList<GfxSeparationColorSpace*> *sepsCSA) {
std::vector<GfxSeparationColorSpace*> *sepsCSA) {
int i;
nComps = nCompsA;
......@@ -2949,7 +2949,7 @@ GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA,
GooString **namesA,
GfxColorSpace *altA,
Function *funcA,
GooList<GfxSeparationColorSpace*> *sepsCSA,
std::vector<GfxSeparationColorSpace*> *sepsCSA,
int *mappingA,
bool nonMarkingA,
unsigned int overprintMaskA) {
......@@ -2987,7 +2987,7 @@ GfxColorSpace *GfxDeviceNColorSpace::copy() {
int i;
int *mappingA = nullptr;
auto sepsCSA = new GooList<GfxSeparationColorSpace*>();
auto sepsCSA = new std::vector<GfxSeparationColorSpace*>();
sepsCSA->reserve(sepsCS->size());
for (std::size_t i = 0; i < sepsCS->size(); i++) {
GfxSeparationColorSpace *scs = (*sepsCS)[i];
......@@ -3012,7 +3012,7 @@ GfxColorSpace *GfxDeviceNColorSpace::parse(GfxResources *res, Array *arr, Output
Function *funcA;
Object obj1;
int i;
auto separationList = new GooList<GfxSeparationColorSpace*>();
auto separationList = new std::vector<GfxSeparationColorSpace*>();
if (arr->getLength() != 4 && arr->getLength() != 5) {
error(errSyntaxWarning, -1, "Bad DeviceN color space");
......@@ -3154,7 +3154,7 @@ void GfxDeviceNColorSpace::getDefaultColor(GfxColor *color) {
}
}
void GfxDeviceNColorSpace::createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps) {
void GfxDeviceNColorSpace::createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps) {
if (nonMarking) // None
return;
mapping = (int *)gmalloc(sizeof(int) * nComps);
......
......@@ -235,7 +235,7 @@ public:
virtual void getDeviceNLine(unsigned char * /*in*/, unsigned char * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getDeviceNLine this should not happen"); }
// create mapping for spot colorants
virtual void createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps);
virtual void createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps);
// Does this ColorSpace support getRGBLine?
virtual bool useGetRGBLine() const { return false; }
......@@ -621,7 +621,7 @@ public:
unsigned char *getLookup() { return lookup; }
GfxColor *mapColorToBase(const GfxColor *color, GfxColor *baseColor) const;
unsigned int getOverprintMask() { return base->getOverprintMask(); }
void createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps) override
void createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps) override
{ base->createMapping(separationList, maxSepComps); }
......@@ -653,7 +653,7 @@ public:
void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override;
void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override;
void createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps) override;
void createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps) override;
int getNComps() const override { return 1; }
void getDefaultColor(GfxColor *color) override;
......@@ -685,7 +685,7 @@ class GfxDeviceNColorSpace: public GfxColorSpace {
public:
GfxDeviceNColorSpace(int nCompsA, GooString **namesA,
GfxColorSpace *alt, Function *func, GooList<GfxSeparationColorSpace*> *sepsCS);
GfxColorSpace *alt, Function *func, std::vector<GfxSeparationColorSpace*> *sepsCS);
~GfxDeviceNColorSpace();
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() override { return csDeviceN; }
......@@ -698,7 +698,7 @@ public:
void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override;
void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override;
void createMapping(GooList<GfxSeparationColorSpace*> *separationList, int maxSepComps) override;
void createMapping(std::vector<GfxSeparationColorSpace*> *separationList, int maxSepComps) override;
int getNComps() const override { return nComps; }
void getDefaultColor(GfxColor *color) override;
......@@ -713,13 +713,8 @@ public:
private:
GfxDeviceNColorSpace(int nCompsA, GooString **namesA,
<<<<<<< HEAD
GfxColorSpace *alt, Function *func, GooList *sepsCSA,
GfxColorSpace *alt, Function *func, std::vector<GfxSeparationColorSpace*> *sepsCSA,
int *mappingA, bool nonMarkingA, unsigned int overprintMaskA);
=======
GfxColorSpace *alt, Function *func, GooList<GfxSeparationColorSpace*> *sepsCSA,
int *mappingA, bool nonMarkingA, Guint overprintMaskA);
>>>>>>> Make GooList a template type
int nComps; // number of components
GooString // colorant names
......@@ -727,7 +722,7 @@ private:
GfxColorSpace *alt; // alternate color space
Function *func; // tint transform (into alternate color space)
bool nonMarking;
GooList<GfxSeparationColorSpace*> *sepsCS; // list of separation cs for spot colorants;
std::vector<GfxSeparationColorSpace*> *sepsCS; // list of separation cs for spot colorants;
};
//------------------------------------------------------------------------
......
......@@ -58,7 +58,6 @@
#include "goo/glibc.h"
#include "goo/gmem.h"
#include "goo/GooString.h"
#include "goo/GooList.h"
#include "goo/gfile.h"
#include "goo/gdir.h"
#include "Error.h"
......@@ -246,11 +245,11 @@ private:
const char *path);
#endif
GooList<SysFontInfo*> *fonts;
std::vector<SysFontInfo*> *fonts;
};
SysFontList::SysFontList() {
fonts = new GooList<SysFontInfo*>();
fonts = new std::vector<SysFontInfo*>();
}
SysFontList::~SysFontList() {
......@@ -397,7 +396,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
nameToUnicodeZapfDingbats = new NameToCharCode();
nameToUnicodeText = new NameToCharCode();
toUnicodeDirs = new GooList<GooString*>();
toUnicodeDirs = new std::vector<GooString*>();
sysFonts = new SysFontList();
psExpandSmaller = false;
psShrinkLarger = true;
......@@ -1209,9 +1208,9 @@ UnicodeMap *GlobalParams::getTextEncoding() {
return getUnicodeMap2(textEncoding);
}
GooList<GooString*> *GlobalParams::getEncodingNames()
std::vector<GooString*> *GlobalParams::getEncodingNames()
{
auto* const result = new GooList<GooString*>;
auto* const result = new std::vector<GooString*>;
for (const auto& unicodeMap : residentUnicodeMaps) {
result->push_back(new GooString(unicodeMap.first));
}
......
......@@ -44,6 +44,7 @@
#include <unordered_map>
#include <string>
#include <mutex>
#include <vector>
class GooString;
class NameToCharCode;
......@@ -144,7 +145,7 @@ public:
CMap *getCMap(const GooString *collection, GooString *cMapName, Stream *stream = nullptr);
UnicodeMap *getTextEncoding();
GooList<GooString*> *getEncodingNames();
std::vector<GooString*> *getEncodingNames();
//----- functions to set parameters
void addFontFile(GooString *fontName, GooString *path);
......@@ -194,7 +195,7 @@ private:
std::unordered_map<std::string, std::string> unicodeMaps;
// list of CMap dirs, indexed by collection
std::unordered_multimap<std::string, std::string> cMapDirs;
GooList<GooString*> *toUnicodeDirs; // list of ToUnicode CMap dirs
std::vector<GooString*> *toUnicodeDirs; // list of ToUnicode CMap dirs
bool baseFontsInitialized;
#ifdef _WIN32
// windows font substitutes (for CID fonts)
......
......@@ -34,7 +34,6 @@ description for all fonts available in Windows. That's how MuPDF works.
#include "goo/gmem.h"
#include "goo/GooString.h"
#include "goo/GooList.h"
#include "goo/gfile.h"
#include "Error.h"
#include "NameToCharCode.h"
......
......@@ -35,7 +35,6 @@
#include <stdlib.h>
#include <limits.h>
#include "goo/GooList.h"
#include "Error.h"
#include "JArithmeticDecoder.h"
#include "JBIG2Stream.h"
......@@ -1244,7 +1243,7 @@ JBIG2Stream::~JBIG2Stream() {
void JBIG2Stream::reset() {
// read the globals stream
globalSegments = new GooList<JBIG2Segment*>();
globalSegments = new std::vector<JBIG2Segment*>();
if (globalsStream.isStream()) {
segments = globalSegments;
curStr = globalsStream.getStream();
......@@ -1257,7 +1256,7 @@ void JBIG2Stream::reset() {
}
// read the main stream
segments = new GooList<JBIG2Segment*>();
segments = new std::vector<JBIG2Segment*>();
curStr = str;
curStr->reset();
arithDecoder->setStream(curStr);
......@@ -1562,7 +1561,7 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length,
JBIG2HuffmanTable *huffDHTable, *huffDWTable;
JBIG2HuffmanTable *huffBMSizeTable, *huffAggInstTable;
JBIG2Segment *seg;
GooList<JBIG2Segment*> *codeTables;
std::vector<JBIG2Segment*> *codeTables;
JBIG2SymbolDict *inputSymbolDict;
unsigned int flags, sdTemplate, sdrTemplate, huff, refAgg;
unsigned int huffDH, huffDW, huffBMSize, huffAggInst;
......@@ -1633,7 +1632,7 @@ bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length,
}
// get referenced segments: input symbol dictionaries and code tables
codeTables = new GooList<JBIG2Segment*>();
codeTables = new std::vector<JBIG2Segment*>();
numInputSyms = 0;
for (i = 0; i < nRefSegs; ++i) {
// This is need by bug 12014, returning false makes it not crash
......@@ -2025,7 +2024,7 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
JBIG2HuffmanTable *huffRDWTable, *huffRDHTable;
JBIG2HuffmanTable *huffRDXTable, *huffRDYTable, *huffRSizeTable;
JBIG2Segment *seg;
GooList<JBIG2Segment*> *codeTables;
std::vector<JBIG2Segment*> *codeTables;
JBIG2SymbolDict *symbolDict;
JBIG2Bitmap **syms;
unsigned int w, h, x, y, segInfoFlags, extCombOp;
......@@ -2089,7 +2088,7 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm,
}
// get symbol dictionaries and tables
codeTables = new GooList<JBIG2Segment*>();
codeTables = new std::vector<JBIG2Segment*>();
numSyms = 0;
for (i = 0; i < nRefSegs; ++i) {
if ((seg = findSegment(refSegs[i]))) {
......
......@@ -133,8 +133,8 @@ private:
unsigned int pageDefPixel;
JBIG2Bitmap *pageBitmap;
unsigned int defCombOp;
GooList<JBIG2Segment*> *segments;
GooList<JBIG2Segment*> *globalSegments;
std::vector<JBIG2Segment*> *segments;
std::vector<JBIG2Segment*> *globalSegments;
Stream *curStr;
unsigned char *dataPtr;
unsigned char *dataEnd;
......
......@@ -35,7 +35,6 @@
#include <string.h>
#include "goo/gmem.h"
#include "goo/GooString.h"
#include "goo/GooList.h"
#include "Error.h"
#include "Object.h"
#include "Array.h"
......@@ -162,7 +161,7 @@ LinkAction *LinkAction::parseAction(const Object *obj, const GooString *baseURI,
// parse the next actions
const Object nextObj = obj->dictLookup("Next");
GooList<LinkAction*> *actionList = nullptr;
std::vector<LinkAction*> *actionList = nullptr;
if (nextObj.isDict()) {
// Prevent circles in the tree by checking the ref against used refs in
......@@ -176,13 +175,13 @@ LinkAction *LinkAction::parseAction(const Object *obj, const GooString *baseURI,
}
}
actionList = new GooList<LinkAction*>();
actionList = new std::vector<LinkAction*>();
actionList->reserve(1);
actionList->push_back(parseAction(&nextObj, nullptr, seenNextActions));
} else if (nextObj.isArray()) {
const Array *a = nextObj.getArray();
const int n = a->getLength();
actionList = new GooList<LinkAction*>();
actionList = new std::vector<LinkAction*>();
actionList->reserve(n);
for (int i = 0; i < n; ++i) {
const Object obj3 = a->get(i);
......@@ -210,11 +209,11 @@ LinkAction *LinkAction::parseAction(const Object *obj, const GooString *baseURI,
return action;
}
const GooList<LinkAction*> *LinkAction::nextActions() const {
const std::vector<LinkAction*> *LinkAction::nextActions() const {
return nextActionList;
}
void LinkAction::setNextActions(GooList<LinkAction*> *actions) {
void LinkAction::setNextActions(std::vector<LinkAction*> *actions) {
delete nextActionList;
nextActionList = actions;
}
......@@ -828,7 +827,7 @@ LinkJavaScript::~LinkJavaScript() {
// LinkOCGState
//------------------------------------------------------------------------
LinkOCGState::LinkOCGState(const Object *obj) {
stateList = new GooList<StateList*>();
stateList = new std::vector<StateList*>();
preserveRB = true;
Object obj1 = obj->dictLookup("State");
......@@ -843,7 +842,7 @@ LinkOCGState::LinkOCGState(const Object *obj) {
const char *name = obj2.getName();
stList = new StateList();
stList->list = new GooList<Ref*>();
stList->list = new std::vector<Ref*>();
if (!strcmp (name, "ON")) {
stList->st = On;
} else if (!strcmp (name, "OFF")) {
......
......@@ -29,7 +29,6 @@
#ifndef LINK_H
#define LINK_H
#include "goo/GooList.h"
#include "Object.h"
#include <memory>
#include <set>
......@@ -85,15 +84,15 @@ public:
// A List of the next actions to execute in order.
// The list contains pointer to LinkAction objects.
const GooList<LinkAction*> *nextActions() const;
const std::vector<LinkAction*> *nextActions() const;
// Sets the next action list. Takes ownership of the actions.
void setNextActions(GooList<LinkAction*> *actions);
void setNextActions(std::vector<LinkAction*> *actions);
private:
static LinkAction *parseAction(const Object *obj, const GooString *baseURI, std::set<int> *seenNextActions);