[poppler] poppler/qt4/src: poppler-link.cc, 1.12, 1.13 poppler-private.h, 1.27, 1.28

Albert Astals Cid aacid at kemper.freedesktop.org
Thu May 17 14:32:59 PDT 2007


Update of /cvs/poppler/poppler/qt4/src
In directory kemper:/tmp/cvs-serv6775/qt4/src

Modified Files:
	poppler-link.cc poppler-private.h 
Log Message:
2007-05-17  Pino Toscano <pino at kde.org>

        * qt4/src/poppler-link.cc:
        Give some default values to LinkDestination
        * qt4/src/poppler-private.h:
        Fix memory leak when converting QString -> GooString


Index: poppler-link.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-link.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- poppler-link.cc	27 Apr 2007 22:41:10 -0000	1.12
+++ poppler-link.cc	17 May 2007 21:32:57 -0000	1.13
@@ -29,6 +29,18 @@
 
 	LinkDestination::LinkDestination(const LinkDestinationData &data)
 	{
+		// sane defaults
+		m_kind = destXYZ;
+		m_pageNum = 0;
+		m_left = 0;
+		m_bottom = 0;
+		m_right = 0;
+		m_top = 0;
+		m_zoom = 1;
+		m_changeLeft = true;
+		m_changeTop = true;
+		m_changeZoom = false;
+
 		bool deleteDest = false;
 		LinkDest *ld = data.ld;
 		

Index: poppler-private.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-private.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- poppler-private.h	28 Apr 2007 23:25:59 -0000	1.27
+++ poppler-private.h	17 May 2007 21:32:57 -0000	1.28
@@ -55,7 +55,9 @@
         char *cstring = (char *)gmallocn(s.length(), sizeof(char));
         for (int i = 0; i < len; ++i)
           cstring[i] = s.at(i).unicode();
-        return new GooString(cstring, len);
+        GooString *ret = new GooString(cstring, len);
+        gfree(cstring);
+        return ret;
     }
 
     static QString UnicodeParsedString(GooString *s1) {



More information about the poppler mailing list