[poppler] CMakeLists.txt goo/GooVector.h goo/Makefile.am poppler/CachedFile.cc poppler/CachedFile.h poppler/Catalog.cc poppler/Catalog.h poppler/Form.h poppler/Gfx.h poppler/Hints.cc poppler/Hints.h poppler/StdinCachedFile.cc poppler/StdinCachedFile.h poppler/Stream.h poppler/XRef.cc poppler/XRef.h utils/HtmlFonts.cc utils/HtmlFonts.h utils/HtmlLinks.cc utils/HtmlLinks.h

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Nov 10 15:30:22 PST 2010


 CMakeLists.txt             |    1 
 goo/GooVector.h            |  159 ---------------------------------------------
 goo/Makefile.am            |    1 
 poppler/CachedFile.cc      |   19 ++---
 poppler/CachedFile.h       |   15 ++--
 poppler/Catalog.cc         |   12 +--
 poppler/Catalog.h          |   10 +-
 poppler/Form.h             |    3 
 poppler/Gfx.h              |    7 +
 poppler/Hints.cc           |    5 -
 poppler/Hints.h            |    6 -
 poppler/StdinCachedFile.cc |    2 
 poppler/StdinCachedFile.h  |    2 
 poppler/Stream.h           |    1 
 poppler/XRef.cc            |   10 +-
 poppler/XRef.h             |    7 +
 utils/HtmlFonts.cc         |    8 +-
 utils/HtmlFonts.h          |   12 +--
 utils/HtmlLinks.cc         |    8 --
 utils/HtmlLinks.h          |    4 -
 20 files changed, 66 insertions(+), 226 deletions(-)

New commits:
commit 6296c28968613aadb7ea084092945a54005eca9b
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Nov 10 23:28:45 2010 +0000

    Kill GooVector
    
    std::vector does the same and GooVector is not part of xpdf so we don't
    need to maintain it in case we ever get a new xpdf release we want to
    merge with

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 65888be..8e50e9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -449,7 +449,6 @@ if(ENABLE_XPDF_HEADERS)
     goo/GooTimer.h
     goo/GooMutex.h
     goo/GooString.h
-    goo/GooVector.h
     goo/gtypes.h
     goo/gmem.h
     goo/gfile.h
diff --git a/goo/GooVector.h b/goo/GooVector.h
deleted file mode 100644
index e35fd8a..0000000
--- a/goo/GooVector.h
+++ /dev/null
@@ -1,159 +0,0 @@
-//========================================================================
-//
-// GooVector.h
-//
-// This file is licensed under the GPLv2 or later
-//
-// Copyright 2010 David Benjamin <davidben at mit.edu>
-// Copyright 2010 Albert Astals Cid <aacid at kde.org>
-//
-//========================================================================
-
-
-
-#ifndef GOO_GOOVECTOR_H
-#define GOO_GOOVECTOR_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma interface
-#endif
-
-#include <new> // vector implementations need placement-new
-
-#include <assert.h>
-#include <stdlib.h>
-
-/* Mostly STL-compatible vector class. Should correctly call constructors and
- * destructors, but does not carefully handle alignment requirements. */
-
-template<class T> class GooVector {
-public:
-  /* various STL-compatible typedefs */
-  typedef T value_type;
-  typedef T* pointer;
-  typedef T& reference;
-  typedef const T& const_reference;
-  typedef size_t size_type;
-  typedef int difference_type;
-  typedef T* iterator;
-  typedef const T* const_iterator;
-  // TODO: reverse_iterator, if we feel like it
-  
-  GooVector() : m_data(NULL), m_capacity(0), m_size(0) {}
-  explicit GooVector(size_type n) : m_data(NULL), m_capacity(0), m_size(0) {
-    resize(n);
-  }
-  explicit GooVector(size_type n, const T& t) : m_data(NULL), m_capacity(0), m_size(0) {
-    resize(n, t);
-  }
-  explicit GooVector(const GooVector& gv) : m_data(NULL), m_capacity(0), m_size(0) {
-    reserve(gv.size());
-    for (size_type i = 0; i < m_size; i++) {
-      push_back(gv[i]);
-    }
-  }
-
-  ~GooVector() {
-    clear();
-  }
-
-  iterator begin() { return m_data; }
-  const_iterator begin() const { return m_data; }
-  iterator end() { return m_data + m_size; }
-  const_iterator end() const { return m_data + m_size; }
-
-  size_type size() const { return m_size; }
-  size_type capacity() const { return m_capacity; }
-
-  bool empty() const { return m_size == 0; }
-
-  reference operator[] (size_type n) { return m_data[n]; }
-  const_reference operator[] (size_type n) const { return m_data[n]; }
-
-  reference at(size_type n) {
-    assert(n < m_size);
-    return m_data[n];
-  }
-  const_reference at(size_type n) const {
-    assert(n < m_size);
-    return m_data[n];
-  }
-
-  reference front() { assert(!empty()); return m_data[0]; }
-  const_reference front() const { assert(!empty()); return m_data[0]; }
-
-  reference back() { assert(!empty()); return m_data[m_size-1]; }
-  const_reference back() const { assert(!empty()); return m_data[m_size-1]; }
-
-  void push_back(const T& v) {
-    reserve(m_size + 1);
-    place_new(m_data + m_size, v);
-    m_size++;
-  }
-  void pop_back() {
-    assert(!empty());
-    m_size--;
-    destruct(m_data + m_size);
-  }
-
-  void clear() {
-    for (size_t i = 0; i < m_size; i++) {
-      destruct(m_data + i);
-    }
-    m_size = 0;
-    free(m_data);
-    m_data = NULL;
-    m_capacity = 0;
-  }
-
-  void reserve(size_type cap) {
-    if (m_capacity >= cap) return;
-    // make sure we always at least double
-    if (m_capacity*2 > cap)
-      cap = m_capacity*2;
-    resize_internal(cap);
-  }
-
-  void resize(size_type n) { resize(n, T()); }
-  void resize(size_type n, const T& t) {
-    reserve(n);
-    while (m_size < n)
-      push_back(t);
-    while (m_size > n)
-      pop_back();
-  }
-
-private:
-  T *m_data;
-  size_type m_capacity;
-  size_type m_size;
-
-  inline void destruct(T *obj) {
-    obj->~T();
-  }
-  inline void place_new(T *loc, const T& v) {
-    new (loc) T(v);
-  }
-
-  inline void resize_internal(size_type new_cap) {
-    assert(new_cap >= m_capacity);
-    // To be correct with ctors and dtors, we do not use realloc and friends.
-    // A more efficient implementation would specialize for POD types and just
-    // realloc() or something. Meh, if we care, we ought to use just STL's
-    T *new_data = (T*) malloc(sizeof(T) * new_cap);
-    assert(new_data);
-    // Move over old data
-    if (m_data) {
-      for (size_type i = 0; i < m_size; i++) {
-	place_new(new_data + i, m_data[i]);
-	destruct(m_data + i);
-      }
-      free(m_data);
-    }
-    // And set the new values
-    m_data = new_data;
-    m_capacity = new_cap;
-  }
-};
-
-#endif
diff --git a/goo/Makefile.am b/goo/Makefile.am
index e15c7ac..de894af 100644
--- a/goo/Makefile.am
+++ b/goo/Makefile.am
@@ -9,7 +9,6 @@ poppler_goo_include_HEADERS =			\
 	GooTimer.h				\
 	GooMutex.h				\
 	GooString.h				\
-	GooVector.h				\
 	gtypes.h				\
 	gmem.h					\
 	gfile.h					\
diff --git a/poppler/CachedFile.cc b/poppler/CachedFile.cc
index cc86c89..f1e49d1 100644
--- a/poppler/CachedFile.cc
+++ b/poppler/CachedFile.cc
@@ -23,7 +23,7 @@ CachedFile::CachedFile(CachedFileLoader *cachedFileLoaderA, GooString *uriA)
   loader = cachedFileLoaderA;
 
   streamPos = 0;
-  chunks = new GooVector<Chunk>();
+  chunks = new std::vector<Chunk>();
   length = 0;
 
   length = loader->init(uri, this);
@@ -70,15 +70,15 @@ int CachedFile::seek(long int offset, int origin)
   return 0;
 }
 
-int CachedFile::cache(const GooVector<ByteRange> &origRanges)
+int CachedFile::cache(const std::vector<ByteRange> &origRanges)
 {
-  GooVector<int> loadChunks;
+  std::vector<int> loadChunks;
   int numChunks = length/CachedFileChunkSize + 1;
-  GooVector<bool> chunkNeeded(numChunks);
+  std::vector<bool> chunkNeeded(numChunks);
   int startChunk, endChunk;
-  GooVector<ByteRange> chunk_ranges, all;
+  std::vector<ByteRange> chunk_ranges, all;
   ByteRange range;
-  const GooVector<ByteRange> *ranges = &origRanges;
+  const std::vector<ByteRange> *ranges = &origRanges;
 
   if (ranges->empty()) {
     range.offset = 0;
@@ -87,7 +87,8 @@ int CachedFile::cache(const GooVector<ByteRange> &origRanges)
     ranges = &all;
   }
 
-  memset(&chunkNeeded[0], 0, sizeof(bool) * numChunks);
+  for (int i = 0; i < numChunks; ++i)
+    chunkNeeded[i] = false;
   for (size_t i = 0; i < ranges->size(); i++) {
 
     if ((*ranges)[i].length == 0) continue;
@@ -166,7 +167,7 @@ size_t CachedFile::read(void *ptr, size_t unitsize, size_t count)
 
 int CachedFile::cache(size_t offset, size_t length)
 {
-  GooVector<ByteRange> r;
+  std::vector<ByteRange> r;
   ByteRange range;
   range.offset = offset;
   range.length = length;
@@ -178,7 +179,7 @@ int CachedFile::cache(size_t offset, size_t length)
 // CachedFileWriter
 //------------------------------------------------------------------------
 
-CachedFileWriter::CachedFileWriter(CachedFile *cachedFileA, GooVector<int> *chunksA)
+CachedFileWriter::CachedFileWriter(CachedFile *cachedFileA, std::vector<int> *chunksA)
 {
    cachedFile = cachedFileA;
    chunks = chunksA;
diff --git a/poppler/CachedFile.h b/poppler/CachedFile.h
index e1ff817..b99ea1e 100644
--- a/poppler/CachedFile.h
+++ b/poppler/CachedFile.h
@@ -20,7 +20,8 @@
 #include "goo/gtypes.h"
 #include "Object.h"
 #include "Stream.h"
-#include "goo/GooVector.h"
+
+#include <vector>
 
 //------------------------------------------------------------------------
 
@@ -51,7 +52,7 @@ public:
   int seek(long int offset, int origin);
   size_t read(void * ptr, size_t unitsize, size_t count);
   size_t write(const char *ptr, size_t size, size_t fromByte);
-  int cache(const GooVector<ByteRange> &ranges);
+  int cache(const std::vector<ByteRange> &ranges);
 
   // Reference counting.
   void incRefCnt();
@@ -79,7 +80,7 @@ private:
   size_t length;
   size_t streamPos;
 
-  GooVector<Chunk> *chunks;
+  std::vector<Chunk> *chunks;
 
   int refCnt;  // reference count
 
@@ -99,7 +100,7 @@ public:
 
   // Construct a CachedFile Writer.
   // The caller is responsible for deleting the cachedFile and chunksA.
-  CachedFileWriter(CachedFile *cachedFile, GooVector<int> *chunksA);
+  CachedFileWriter(CachedFile *cachedFile, std::vector<int> *chunksA);
 
   ~CachedFileWriter();
 
@@ -109,8 +110,8 @@ public:
 private:
 
   CachedFile *cachedFile;
-  GooVector<int> *chunks;
-  GooVector<int>::iterator it;
+  std::vector<int> *chunks;
+  std::vector<int>::iterator it;
   size_t offset;
 
 };
@@ -136,7 +137,7 @@ public:
   // Loads speficified byte ranges and passes it to the writer to store them.
   // Returns 0 on success, Anything but 0 on failure.
   // The caller is responsible for deleting the writer.
-  virtual int load(const GooVector<ByteRange> &ranges, CachedFileWriter *writer) = 0;
+  virtual int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer) = 0;
 
 };
 
diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc
index 790293b..6b28997 100644
--- a/poppler/Catalog.cc
+++ b/poppler/Catalog.cc
@@ -124,7 +124,7 @@ Catalog::Catalog(XRef *xrefA) {
 Catalog::~Catalog() {
   delete kidsIdxList;
   if (attrsList) {
-    GooVector<PageAttrs *>::iterator it;
+    std::vector<PageAttrs *>::iterator it;
     for (it = attrsList->begin() ; it < attrsList->end(); it++ ) {
       delete *it;
     }
@@ -132,7 +132,7 @@ Catalog::~Catalog() {
   }
   delete pagesRefList;
   if (pagesList) {
-    GooVector<Dict *>::iterator it;
+    std::vector<Dict *>::iterator it;
     for (it = pagesList->begin() ; it < pagesList->end(); it++ ) {
       if (!(*it)->decRef()) {
          delete *it;
@@ -267,13 +267,13 @@ GBool Catalog::cachePageTree(int page)
       pageRefs[i].gen = -1;
     }
 
-    pagesList = new GooVector<Dict *>();
+    pagesList = new std::vector<Dict *>();
     pagesList->push_back(pagesDict);
-    pagesRefList = new GooVector<Ref>();
+    pagesRefList = new std::vector<Ref>();
     pagesRefList->push_back(pagesRef);
-    attrsList = new GooVector<PageAttrs *>();
+    attrsList = new std::vector<PageAttrs *>();
     attrsList->push_back(new PageAttrs(NULL, pagesDict));
-    kidsIdxList = new GooVector<int>();
+    kidsIdxList = new std::vector<int>();
     kidsIdxList->push_back(0);
     lastCachedPage = 0;
 
diff --git a/poppler/Catalog.h b/poppler/Catalog.h
index 8bca80b..cea808c 100644
--- a/poppler/Catalog.h
+++ b/poppler/Catalog.h
@@ -33,6 +33,8 @@
 #pragma interface
 #endif
 
+#include <vector>
+
 class XRef;
 class Object;
 class Page;
@@ -233,10 +235,10 @@ private:
   Page **pages;			// array of pages
   Ref *pageRefs;		// object ID for each page
   int lastCachedPage;
-  GooVector<Dict *> *pagesList;
-  GooVector<Ref> *pagesRefList;
-  GooVector<PageAttrs *> *attrsList;
-  GooVector<int> *kidsIdxList;
+  std::vector<Dict *> *pagesList;
+  std::vector<Ref> *pagesRefList;
+  std::vector<PageAttrs *> *attrsList;
+  std::vector<int> *kidsIdxList;
   Form *form;
   int numPages;			// number of pages
   int pagesSize;		// size of pages array
diff --git a/poppler/Form.h b/poppler/Form.h
index 751a915..eb76fbb 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -6,7 +6,7 @@
 //
 // Copyright 2006 Julien Rebetez <julienr at svn.gnome.org>
 // Copyright 2007, 2008 Carlos Garcia Campos <carlosgc at gnome.org>
-// Copyright 2007-2009 Albert Astals Cid <aacid at kde.org>
+// Copyright 2007-2010 Albert Astals Cid <aacid at kde.org>
 // Copyright 2010 Mark Riedesel <mark at klowner.com>
 //
 //========================================================================
@@ -19,7 +19,6 @@
 #endif
 
 #include "Object.h"
-#include "goo/GooVector.h"
 
 class GooString;
 class Array;
diff --git a/poppler/Gfx.h b/poppler/Gfx.h
index adabe7d..d88b8d8 100644
--- a/poppler/Gfx.h
+++ b/poppler/Gfx.h
@@ -17,7 +17,7 @@
 // Copyright (C) 2007 Iñigo Martínez <inigomartinez at gmail.com>
 // Copyright (C) 2008 Brad Hards <bradh at kde.org>
 // Copyright (C) 2008, 2010 Carlos Garcia Campos <carlosgc at gnome.org>
-// Copyright (C) 2009 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009, 2010 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2009, 2010 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2010 David Benjamin <davidben at mit.edu>
 // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger at googlemail.com>
@@ -36,11 +36,12 @@
 
 #include "goo/gtypes.h"
 #include "goo/GooList.h"
-#include "goo/GooVector.h"
 #include "GfxState.h"
 #include "Object.h"
 #include "PopplerCache.h"
 
+#include <vector>
+
 class GooString;
 class XRef;
 class Array;
@@ -202,7 +203,7 @@ private:
 
   GfxState *state;		// current graphics state
   int stackHeight;		// the height of the current graphics stack
-  GooVector<int> stateGuards;   // a stack of state limits; to guard against unmatched pops
+  std::vector<int> stateGuards;   // a stack of state limits; to guard against unmatched pops
   GBool fontChanged;		// set if font or text matrix has changed
   GfxClipType clip;		// do a clip?
   int ignoreUndef;		// current BX/EX nesting level
diff --git a/poppler/Hints.cc b/poppler/Hints.cc
index 446e4d8..c9cb151 100644
--- a/poppler/Hints.cc
+++ b/poppler/Hints.cc
@@ -5,6 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2010 Hib Eris <hib at hiberis.nl>
+// Copyright 2010 Albert Astals Cid <aacid at kde.org>
 //
 //========================================================================
 
@@ -351,7 +352,7 @@ Guint Hints::getPageOffset(int page)
     return pageOffset[0];
 }
 
-GooVector<ByteRange>* Hints::getPageRanges(int page)
+std::vector<ByteRange>* Hints::getPageRanges(int page)
 {
   if ((page < 1) || (page > nPages)) return NULL;
 
@@ -364,7 +365,7 @@ GooVector<ByteRange>* Hints::getPageRanges(int page)
      idx = 0;
 
   ByteRange pageRange;
-  GooVector<ByteRange> *v = new GooVector<ByteRange>;
+  std::vector<ByteRange> *v = new std::vector<ByteRange>;
 
   pageRange.offset = pageOffset[idx];
   pageRange.length = pageLength[idx];
diff --git a/poppler/Hints.h b/poppler/Hints.h
index cdba526..d598e79 100644
--- a/poppler/Hints.h
+++ b/poppler/Hints.h
@@ -5,6 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2010 Hib Eris <hib at hiberis.nl>
+// Copyright 2010 Albert Astals Cid <aacid at kde.org>
 //
 //========================================================================
 
@@ -13,8 +14,7 @@
 
 #include <string.h>
 #include "goo/gtypes.h"
-#include "goo/GooVector.h"
-//#include <vector>
+#include <vector>
 #include "PDFDoc.h"
 
 class Stream;
@@ -34,7 +34,7 @@ public:
 
   int getPageObjectNum(int page);
   Guint getPageOffset(int page);
-  GooVector<ByteRange>* getPageRanges(int page);
+  std::vector<ByteRange>* getPageRanges(int page);
 
 private:
 
diff --git a/poppler/StdinCachedFile.cc b/poppler/StdinCachedFile.cc
index 3a91e62..db96637 100644
--- a/poppler/StdinCachedFile.cc
+++ b/poppler/StdinCachedFile.cc
@@ -40,7 +40,7 @@ size_t StdinCacheLoader::init(GooString *dummy, CachedFile *cachedFile)
   return size;
 }
 
-int StdinCacheLoader::load(const GooVector<ByteRange> &ranges, CachedFileWriter *writer)
+int StdinCacheLoader::load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer)
 {
   return 0;
 }
diff --git a/poppler/StdinCachedFile.h b/poppler/StdinCachedFile.h
index 11b064b..5be6fa8 100644
--- a/poppler/StdinCachedFile.h
+++ b/poppler/StdinCachedFile.h
@@ -19,7 +19,7 @@ class StdinCacheLoader : public CachedFileLoader {
 public:
 
   size_t init(GooString *dummy, CachedFile* cachedFile);
-  int load(const GooVector<ByteRange> &ranges, CachedFileWriter *writer);
+  int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer);
 
 };
 
diff --git a/poppler/Stream.h b/poppler/Stream.h
index 6cdcb2a..de72f98 100644
--- a/poppler/Stream.h
+++ b/poppler/Stream.h
@@ -34,7 +34,6 @@
 
 #include <stdio.h>
 #include "goo/gtypes.h"
-#include "goo/GooVector.h"
 #include "Object.h"
 
 class BaseStream;
diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index a6b7197..97bbcb7 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -303,7 +303,7 @@ XRef::XRef(BaseStream *strA, Guint pos, Guint mainXRefEntriesOffsetA, GBool *was
 
     // read the xref table
     } else {
-      GooVector<Guint> followedXRefStm;
+      std::vector<Guint> followedXRefStm;
       readXRef(&prevXRefOffset, &followedXRefStm);
 
       // if there was a problem with the xref table,
@@ -419,7 +419,7 @@ int XRef::resize(int newSize)
 
 // Read one xref table section.  Also reads the associated trailer
 // dictionary, and returns the prev pointer (if any).
-GBool XRef::readXRef(Guint *pos, GooVector<Guint> *followedXRefStm) {
+GBool XRef::readXRef(Guint *pos, std::vector<Guint> *followedXRefStm) {
   Parser *parser;
   Object obj;
   GBool more;
@@ -471,7 +471,7 @@ GBool XRef::readXRef(Guint *pos, GooVector<Guint> *followedXRefStm) {
   return gFalse;
 }
 
-GBool XRef::readXRefTable(Parser *parser, Guint *pos, GooVector<Guint> *followedXRefStm) {
+GBool XRef::readXRefTable(Parser *parser, Guint *pos, std::vector<Guint> *followedXRefStm) {
   XRefEntry entry;
   GBool more;
   Object obj, obj2;
@@ -1282,7 +1282,7 @@ XRefEntry *XRef::getEntry(int i)
         error(-1, "Failed to parse XRef entry [%d].", i);
       }
     } else {
-      GooVector<Guint> followedPrev;
+      std::vector<Guint> followedPrev;
       while (prevXRefOffset && entries[i].type == xrefEntryNone) {
         bool followed = false;
         for (size_t j = 0; j < followedPrev.size(); j++) {
@@ -1301,7 +1301,7 @@ XRefEntry *XRef::getEntry(int i)
 
         followedPrev.push_back (prevXRefOffset);
 
-        GooVector<Guint> followedXRefStm;
+        std::vector<Guint> followedXRefStm;
         if (!readXRef(&prevXRefOffset, &followedXRefStm)) {
             prevXRefOffset = 0;
         }
diff --git a/poppler/XRef.h b/poppler/XRef.h
index 15efe76..2401332 100644
--- a/poppler/XRef.h
+++ b/poppler/XRef.h
@@ -33,9 +33,10 @@
 #endif
 
 #include "goo/gtypes.h"
-#include "goo/GooVector.h"
 #include "Object.h"
 
+#include <vector>
+
 class Dict;
 class Stream;
 class Parser;
@@ -163,8 +164,8 @@ private:
   int reserve(int newSize);
   int resize(int newSize);
   Guint getStartXref();
-  GBool readXRef(Guint *pos, GooVector<Guint> *followedXRefStm);
-  GBool readXRefTable(Parser *parser, Guint *pos, GooVector<Guint> *followedXRefStm);
+  GBool readXRef(Guint *pos, std::vector<Guint> *followedXRefStm);
+  GBool readXRefTable(Parser *parser, Guint *pos, std::vector<Guint> *followedXRefStm);
   GBool readXRefStreamSection(Stream *xrefStr, int *w, int first, int n);
   GBool readXRefStream(Stream *xrefStr, Guint *pos);
   GBool constructXRef(GBool *wasReconstructed);
diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index 4b592d5..e2839e3 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -17,7 +17,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2007 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2007, 2010 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2008 Boris Toloknov <tlknv at yandex.ru>
 // Copyright (C) 2008 Tomas Are Haavet <tomasare at gmail.com>
 // Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (leenac at cdacmumbai.in) and Onkar Potdar (onkar at cdacmumbai.in)
@@ -267,7 +267,7 @@ GooString* HtmlFont::simple(HtmlFont* font, Unicode* content, int uLen){
 }
 
 HtmlFontAccu::HtmlFontAccu(){
-  accu=new GooVector<HtmlFont>();
+  accu=new std::vector<HtmlFont>();
 }
 
 HtmlFontAccu::~HtmlFontAccu(){
@@ -275,7 +275,7 @@ HtmlFontAccu::~HtmlFontAccu(){
 }
 
 int HtmlFontAccu::AddFont(const HtmlFont& font){
- GooVector<HtmlFont>::iterator i; 
+ std::vector<HtmlFont>::iterator i; 
  for (i=accu->begin();i!=accu->end();i++)
  {
 	if (font.isEqual(*i)) 
@@ -317,7 +317,7 @@ GooString* HtmlFontAccu::CSStyle(int i, int j){
    GooString *iStr=GooString::fromInt(i);
    GooString *jStr=GooString::fromInt(j);
 
-   GooVector<HtmlFont>::iterator g=accu->begin();
+   std::vector<HtmlFont>::iterator g=accu->begin();
    g+=i;
    HtmlFont font=*g;
    GooString *Size=GooString::fromInt(font.getSize());
diff --git a/utils/HtmlFonts.h b/utils/HtmlFonts.h
index 54deaf8..a0ca78a 100644
--- a/utils/HtmlFonts.h
+++ b/utils/HtmlFonts.h
@@ -18,6 +18,7 @@
 // under GPL version 2 or later
 //
 // Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (leenac at cdacmumbai.in) and Onkar Potdar (onkar at cdacmumbai.in)
+// Copyright (C) 2010 Albert Astals Cid <aacid at kde.org>
 //
 // 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
@@ -26,11 +27,10 @@
 
 #ifndef _HTML_FONTS_H
 #define _HTML_FONTS_H
-#include "goo/GooVector.h"
 #include "goo/GooString.h"
 #include "GfxState.h"
 #include "CharTypes.h"
-
+#include <vector>
 
 class HtmlFontColor{
  private:
@@ -92,16 +92,14 @@ public:
 
 class HtmlFontAccu{
 private:
-  GooVector<HtmlFont> *accu;
+  std::vector<HtmlFont> *accu;
   
 public:
   HtmlFontAccu();
   ~HtmlFontAccu();
   int AddFont(const HtmlFont& font);
-  HtmlFont* Get(int i){
-    GooVector<HtmlFont>::iterator g=accu->begin();
-    g+=i;  
-    return g;
+  HtmlFont *Get(int i){
+    return &(*accu)[i];
   } 
   GooString* getCSStyle (int i,GooString* content, int j = 0);
   GooString* CSStyle(int i, int j = 0);
diff --git a/utils/HtmlLinks.cc b/utils/HtmlLinks.cc
index c0ca89a..1d609f6 100644
--- a/utils/HtmlLinks.cc
+++ b/utils/HtmlLinks.cc
@@ -118,7 +118,7 @@ GooString* HtmlLink::getLinkStart() {
    
 
 HtmlLinks::HtmlLinks(){
-  accu=new GooVector<HtmlLink>();
+  accu=new std::vector<HtmlLink>();
 }
 
 HtmlLinks::~HtmlLinks(){
@@ -128,7 +128,7 @@ HtmlLinks::~HtmlLinks(){
 
 GBool HtmlLinks::inLink(double xmin,double ymin,double xmax,double ymax,int& p)const {
   
-  for(GooVector<HtmlLink>::iterator i=accu->begin();i!=accu->end();i++){
+  for(std::vector<HtmlLink>::iterator i=accu->begin();i!=accu->end();i++){
     if (i->inLink(xmin,ymin,xmax,ymax)) {
         p=(i - accu->begin());
         return 1;
@@ -138,8 +138,6 @@ GBool HtmlLinks::inLink(double xmin,double ymin,double xmax,double ymax,int& p)c
 }
 
 HtmlLink* HtmlLinks::getLink(int i) const{
-  GooVector<HtmlLink>::iterator g=accu->begin();
-  g+=i; 
-  return g;
+  return &(*accu)[i];
 }
 
diff --git a/utils/HtmlLinks.h b/utils/HtmlLinks.h
index 1212844..4a48dfa 100644
--- a/utils/HtmlLinks.h
+++ b/utils/HtmlLinks.h
@@ -29,7 +29,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "goo/GooVector.h"
+#include <vector>
 #include "goo/GooString.h"
 
 class HtmlLink{
@@ -59,7 +59,7 @@ public:
 
 class HtmlLinks{
 private:
- GooVector<HtmlLink> *accu;
+ std::vector<HtmlLink> *accu;
 public:
  HtmlLinks();
  ~HtmlLinks();


More information about the poppler mailing list