[Libreoffice-commits] core.git: 2 commits - sdext/source
David Tardon
dtardon at redhat.com
Fri Aug 1 01:21:56 PDT 2014
sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
New commits:
commit 787ed0a267bc1e8256fe4f38158be2225ae9b6c9
Author: David Tardon <dtardon at redhat.com>
Date: Wed Jul 30 18:50:17 2014 +0200
avoid memory leak
Change-Id: I9ac97c4e5c7b01b5e05cb1132c0d245f5843799e
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index c6294cc..d80ef66 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <boost/scoped_ptr.hpp>
+
#include "pdfioutdev_gpl.hxx"
#ifdef WNT
# include <io.h>
@@ -142,7 +144,7 @@ int main(int argc, char **argv)
}
else
{
- pdfi::PDFOutDev* pOutDev( new pdfi::PDFOutDev(&aDoc) );
+ boost::scoped_ptr<pdfi::PDFOutDev> pOutDev( new pdfi::PDFOutDev(&aDoc) );
// tell receiver early - needed for proper progress calculation
pOutDev->setPageNum( aDoc.getNumPages() );
@@ -154,12 +156,12 @@ int main(int argc, char **argv)
const int nPages = aDoc.getNumPages();
for( int i=1; i<=nPages; ++i )
{
- aDoc.displayPage( pOutDev,
+ aDoc.displayPage( pOutDev.get(),
i,
PDFI_OUTDEV_RESOLUTION,
PDFI_OUTDEV_RESOLUTION,
0, gTrue, gTrue, gTrue );
- aDoc.processLinks( pOutDev, i );
+ aDoc.processLinks( pOutDev.get(), i );
}
}
return 0;
commit e644bb59ff57430193c8abb7470cd1c058d6154c
Author: David Tardon <dtardon at redhat.com>
Date: Wed Jul 30 18:36:48 2014 +0200
fix parsing of cmdline args
Change-Id: I4005c08d4163d5d26f227e01c2520379f717343a
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 94171b0..c6294cc 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -37,23 +37,23 @@ int main(int argc, char **argv)
if (!strcmp(argv[k], "-f"))
{
outputFile = argv[k+1];
- --argc;
+ argc -= 2;
for (int j = k; j < argc; ++j)
- argv[j] = argv[j+1];
+ argv[j] = argv[j+2];
}
else if (!strcmp(argv[k], "-opw"))
{
ownerPassword = argv[k+1];
- --argc;
+ argc -= 2;
for (int j = k; j < argc; ++j)
- argv[j] = argv[j+1];
+ argv[j] = argv[j+2];
}
else if (!strcmp(argv[k], "-upw"))
{
userPassword = argv[k+1];
- --argc;
+ argc -= 2;
for (int j = k; j < argc; ++j)
- argv[j] = argv[j+1];
+ argv[j] = argv[j+2];
}
++k;
}
More information about the Libreoffice-commits
mailing list