Merge remote-tracking branch 'origin/poppler-0.22'

Conflicts:
	poppler/Catalog.cc
	qt4/src/poppler-private.h
	utils/HtmlOutputDev.cc
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@eload24.com>
 // Copyright 2010, 2011 Hib Eris <hib@hiberis.nl>
 // Copyright 2010 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2013 Julien Nabet <serval2412@yahoo.fr>
 //
 //========================================================================
 
@@ -213,7 +214,7 @@
   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 f49049a..6bd511a 100644
--- a/poppler/Catalog.cc
+++ b/poppler/Catalog.cc
@@ -26,6 +26,7 @@
 // Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
+// Copyright (C) 2013 Julien Nabet <serval2412@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
@@ -138,7 +139,7 @@
   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;
@@ -146,7 +147,7 @@
   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/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 5759a4e..0d11e83 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -6,6 +6,7 @@
  * Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
  * Copyright (C) 2011 Hib Eris <hib@hiberis.nl>
  * Copyright (C) 2012, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
+ * Copyright (C) 2013 Julien Nabet <serval2412@yahoo.fr>
  * Inspired on code by
  * Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es>
  * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
@@ -87,7 +88,7 @@
 		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);
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@chegg.com>
 // Copyright (C) 2012 Igor Slepchin <igor.slepchin@gmail.com>
 // Copyright (C) 2012 Luis Parravicini <lparravi@gmail.com>
+// Copyright (C) 2013 Julien Nabet <serval2412@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 @@
 
 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@yandex.ru>
 // Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2013 Julien Nabet <serval2412@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 @@
 
 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;
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 03864b5..23d8b6e 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -35,6 +35,7 @@
 // Copyright (C) 2012 Gerald Schmidt <solahcin@gmail.com>
 // Copyright (C) 2012 Pino Toscano <pino@kde.org>
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
+// Copyright (C) 2013 Julien Nabet <serval2412@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
@@ -1700,9 +1701,9 @@
 			GooString *str = Docname->copy();
 			str->append("-outline.html");
 			output = fopen(str->getCString(), "w");
+			delete str;
 			if (output == NULL)
 				return gFalse;
-			delete str;
 			bClose = gTrue;
 
 			GooString *htmlEncoding =