[poppler] Branch 'poppler-0.22' - 2 commits - poppler/CachedFile.cc poppler/Catalog.cc qt4/src utils/HtmlFonts.cc utils/HtmlLinks.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jun 9 03:16:30 PDT 2013


 poppler/CachedFile.cc     |    3 ++-
 poppler/Catalog.cc        |    5 +++--
 qt4/src/poppler-private.h |    3 ++-
 utils/HtmlFonts.cc        |    3 ++-
 utils/HtmlLinks.cc        |    3 ++-
 5 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 25f453ef49004452ac4c201d59d9ce2ef52ffeee
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jun 9 12:12:06 2013 +0200

    Prefer prefix ++/-- operators for non-primitive types
    
    Part of bug #80537

diff --git a/poppler/CachedFile.cc b/poppler/CachedFile.cc
index 4c20dae..b0ae838 100644
--- a/poppler/CachedFile.cc
+++ b/poppler/CachedFile.cc
@@ -7,6 +7,7 @@
 // Copyright 2009 Stefan Thomas <thomas at eload24.com>
 // Copyright 2010, 2011 Hib Eris <hib at hiberis.nl>
 // Copyright 2010 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
 //
 //========================================================================
 
@@ -213,7 +214,7 @@ size_t CachedFileWriter::write(const char *ptr, size_t size)
   while (len) {
     if (chunks) {
       if (offset == CachedFileChunkSize) {
-         it++;
+         ++it;
          if (it == (*chunks).end()) return written;
          offset = 0;
       }
diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc
index cf6dff0..9b4f3a3 100644
--- a/poppler/Catalog.cc
+++ b/poppler/Catalog.cc
@@ -25,6 +25,7 @@
 // Copyright (C) 2009 Ilya Gorenbein <igorenbein at finjan.com>
 // Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
+// Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
 //
 // 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
@@ -129,7 +130,7 @@ Catalog::~Catalog() {
   delete kidsIdxList;
   if (attrsList) {
     std::vector<PageAttrs *>::iterator it;
-    for (it = attrsList->begin() ; it < attrsList->end(); it++ ) {
+    for (it = attrsList->begin() ; it != attrsList->end(); ++it ) {
       delete *it;
     }
     delete attrsList;
@@ -137,7 +138,7 @@ Catalog::~Catalog() {
   delete pagesRefList;
   if (pagesList) {
     std::vector<Dict *>::iterator it;
-    for (it = pagesList->begin() ; it < pagesList->end(); it++ ) {
+    for (it = pagesList->begin() ; it != pagesList->end(); ++it ) {
       if (!(*it)->decRef()) {
          delete *it;
       }
diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index d8334bc..a12992e 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -25,6 +25,7 @@
 // Copyright (C) 2011 Stephen Reichling <sreichling at chegg.com>
 // Copyright (C) 2012 Igor Slepchin <igor.slepchin at gmail.com>
 // Copyright (C) 2012 Luis Parravicini <lparravi at gmail.com>
+// Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
 //
 // 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
@@ -297,7 +298,7 @@ HtmlFontAccu::~HtmlFontAccu(){
 
 int HtmlFontAccu::AddFont(const HtmlFont& font){
  std::vector<HtmlFont>::iterator i; 
- for (i=accu->begin();i!=accu->end();i++)
+ for (i=accu->begin();i!=accu->end();++i)
  {
 	if (font.isEqual(*i)) 
 	{
diff --git a/utils/HtmlLinks.cc b/utils/HtmlLinks.cc
index 1d609f6..34b246e 100644
--- a/utils/HtmlLinks.cc
+++ b/utils/HtmlLinks.cc
@@ -19,6 +19,7 @@
 //
 // Copyright (C) 2008 Boris Toloknov <tlknv at yandex.ru>
 // Copyright (C) 2010 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
 //
 // 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
@@ -128,7 +129,7 @@ HtmlLinks::~HtmlLinks(){
 
 GBool HtmlLinks::inLink(double xmin,double ymin,double xmax,double ymax,int& p)const {
   
-  for(std::vector<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;
commit ed01688a899c5e7560a93ca2424ca302ff3452f1
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jun 9 12:10:01 2013 +0200

    Fix mismatched allocation and deallocation
    
    Part of bug #65551

diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 5a9e1b8..9748ebb 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -6,6 +6,7 @@
  * Copyright (C) 2011 Andreas Hartmetz <ahartmetz at gmail.com>
  * Copyright (C) 2011 Hib Eris <hib at hiberis.nl>
  * Copyright (C) 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
+ * Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
  * Inspired on code by
  * Copyright (C) 2004 by Albert Astals Cid <tsdgeos at terra.es>
  * Copyright (C) 2004 by Enrico Ros <eros.kde at email.it>
@@ -87,7 +88,7 @@ namespace Poppler {
 		wchar_t *fileName = new WCHAR[filePath.length()];
 		int length = filePath.toWCharArray(fileName); 
 		doc = new PDFDoc(fileName, length, ownerPassword, userPassword);
-		delete fileName;
+		delete[] fileName;
 #else
 		GooString *fileName = new GooString(QFile::encodeName(filePath));
 		doc = new PDFDoc(fileName, ownerPassword, userPassword);


More information about the poppler mailing list