r14775 by jghali - pdf image loader : check page number when loading pdf so as not to load a non existing page

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 20 02:50:18 CET 2010


Revision: 14775
Author: jghali
Date: 2010-02-20T01:49:47.630090Z
Commit message: pdf image loader : check page number when loading pdf so as not to load a non existing page

Changeset: 
M  /branches/Version135/Scribus/scribus/scimgdataloader_pdf.cpp

Diffs:
Index: scribus/scimgdataloader_pdf.cpp
===================================================================
--- scribus/scimgdataloader_pdf.cpp	(revision 14774)
+++ scribus/scimgdataloader_pdf.cpp	(revision 14775)
@@ -64,10 +64,15 @@
 		PoDoFo::PdfDocument doc( fn.toLocal8Bit().data() );
 #endif
 		m_imageInfoRecord.numberOfPages = doc.GetPageCount();
+		if (page > m_imageInfoRecord.numberOfPages)
+		{
+			qDebug() << "Incorrect page number specified!";
+			m_imageInfoRecord.actualPageNumber = page = 0;
+		}
 	}
 	catch(PoDoFo::PdfError& e)
 	{
-		qDebug("PoDoFo error while reading page count!");
+		qDebug() << "PoDoFo error while reading page count!";
 		e.PrintErrorMsg();
 	}		
 #endif




More information about the scribus-commit mailing list