r14776 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 03:00:18 CET 2010


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

Changeset: 
M  /trunk/Scribus/scribus/scimgdataloader_pdf.cpp

Diffs:
Index: scribus/scimgdataloader_pdf.cpp
===================================================================
--- scribus/scimgdataloader_pdf.cpp	(revision 14775)
+++ scribus/scimgdataloader_pdf.cpp	(revision 14776)
@@ -65,10 +65,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