r22513 by jghali - #15289: FTBFS when using poppler 0.64.0

scribus-commit scribus-commit at lists.scribus.net
Wed May 2 14:22:50 UTC 2018


Author: jghali
Date: Wed May  2 14:22:50 2018
New Revision: 22513

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22513
Log:
#15289: FTBFS when using poppler 0.64.0

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22513&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	Wed May  2 14:22:50 2018
@@ -6,7 +6,7 @@
 */
 
 #include "slaoutput.h"
-#include <poppler/cpp/poppler-version.h>
+
 #include <poppler/GlobalParams.h>
 #include <poppler/poppler-config.h>
 #include <poppler/FileSpec.h>
@@ -20,12 +20,6 @@
 #include "util_math.h"
 #include <tiffio.h>
 
-#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
-	  ((major) * 10000)				\
-	+ ((minor) *   100)				\
-	+ ((micro) *     1))
-#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
-
 LinkSubmitForm::LinkSubmitForm(Object *actionObj)
 {
 	Object obj1, obj2, obj3;
@@ -44,7 +38,7 @@
 				{
 					if (obj3.isName())
 					{
-						char *name = obj3.getName();
+						POPPLER_CONST char *name = obj3.getName();
 						if (!strcmp(name, "URL"))
 						{
 							obj2 = obj1.dictLookup("F");
@@ -508,8 +502,8 @@
 	QString fileName = "";
 	if (act->getKind() == actionGoTo)
 	{
-		LinkGoTo *gto = (LinkGoTo*)act;
-		LinkDest *dst = gto->getDest();
+		LinkGoTo *gto = (LinkGoTo*) act;
+		POPPLER_CONST LinkDest *dst = gto->getDest();
 		if (dst)
 		{
 			if (dst->getKind() == destXYZ)
@@ -528,7 +522,7 @@
 		}
 		else
 		{
-			GooString *ndst = gto->getNamedDest();
+			POPPLER_CONST GooString *ndst = gto->getNamedDest();
 			if (ndst)
 			{
 				LinkDest *dstn = pdfDoc->findDest(ndst);
@@ -555,7 +549,7 @@
 	{
 		LinkGoToR *gto = (LinkGoToR*)act;
 		fileName = UnicodeParsedString(gto->getFileName());
-		LinkDest *dst = gto->getDest();
+		POPPLER_CONST LinkDest *dst = gto->getDest();
 		if (dst)
 		{
 			if (dst->getKind() == destXYZ)
@@ -568,7 +562,7 @@
 		}
 		else
 		{
-			GooString *ndst = gto->getNamedDest();
+			POPPLER_CONST GooString *ndst = gto->getNamedDest();
 			if (ndst)
 			{
 				LinkDest *dstn = pdfDoc->findDest(ndst);
@@ -709,7 +703,7 @@
 			bool bgFound = false;
 			if (achar)
 			{
-				AnnotColor *bgCol = achar->getBackColor();
+				POPPLER_CONST AnnotColor *bgCol = achar->getBackColor();
 				if (bgCol)
 				{
 					bgFound = true;
@@ -717,7 +711,7 @@
 				}
 				else
 					CurrColorFill = CommonStrings::None;
-				AnnotColor *fgCol = achar->getBorderColor();
+				POPPLER_CONST AnnotColor *fgCol = achar->getBorderColor();
 				if (fgCol)
 				{
 					fgFound = true;
@@ -1054,7 +1048,7 @@
 			int xco = 0;
 			int yco = 0;
 			LinkGoTo *gto = (LinkGoTo*)Lact;
-			LinkDest *dst = gto->getDest();
+			POPPLER_CONST LinkDest *dst = gto->getDest();
 			if (dst)
 			{
 				if (dst->getKind() == destXYZ)
@@ -1075,7 +1069,7 @@
 			}
 			else
 			{
-				GooString *ndst = gto->getNamedDest();
+				POPPLER_CONST GooString *ndst = gto->getNamedDest();
 				if (ndst)
 				{
 					LinkDest *dstn = pdfDoc->findDest(ndst);
@@ -1107,7 +1101,7 @@
 			int yco = 0;
 			LinkGoToR *gto = (LinkGoToR*)Lact;
 			QString fileName = UnicodeParsedString(gto->getFileName());
-			LinkDest *dst = gto->getDest();
+			POPPLER_CONST LinkDest *dst = gto->getDest();
 			if (dst)
 			{
 				if (dst->getKind() == destXYZ)
@@ -1123,7 +1117,7 @@
 			}
 			else
 			{
-				GooString *ndst = gto->getNamedDest();
+				POPPLER_CONST GooString *ndst = gto->getNamedDest();
 				if (ndst)
 				{
 					LinkDest *dstn = pdfDoc->findDest(ndst);
@@ -3001,6 +2995,14 @@
 	if ((mm.type() == QTransform::TxShear) || (mm.type() == QTransform::TxRotate))
 	{
 		ite->setImageRotation(-tline.angle());
+		/*QTransform rotMat;
+		rotMat.rotate(tline.angle());
+		QTransform imgMat = m_ctm * rotMat.inverted();
+		double scaleX = sqrt(imgMat.m11() * imgMat.m11() + imgMat.m12() * imgMat.m12());
+		double scaleY = sqrt(imgMat.m21() * imgMat.m21() + imgMat.m22() * imgMat.m22());
+		imgMat.scale(1.0 / scaleX, 1.0 / scaleY);
+		if (!imgMat.isIdentity())
+			img = img.transformed(imgMat);*/
 	}
 	else
 	{
@@ -4031,7 +4033,7 @@
 	return fNam;
 }
 
-QString SlaOutputDev::getAnnotationColor(AnnotColor *color)
+QString SlaOutputDev::getAnnotationColor(const AnnotColor *color)
 {
 	QString fNam;
 	QString namPrefix = "FromPDF";

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22513&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h	Wed May  2 14:22:50 2018
@@ -26,6 +26,7 @@
 #include "selection.h"
 #include "vgradient.h"
 
+#include <poppler/cpp/poppler-version.h>
 #include <poppler/goo/gtypes.h>
 #include <poppler/Object.h>
 #include <poppler/OutputDev.h>
@@ -49,6 +50,18 @@
 #include <poppler/splash/SplashPath.h>
 #include <poppler/splash/SplashGlyphBitmap.h>
 
+#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
+	  ((major) * 10000)				\
+	+ ((minor) *   100)				\
+	+ ((micro) *     1))
+#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
+
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 64, 0)
+#define POPPLER_CONST const
+#else
+#define POPPLER_CONST
+#endif
+
 //------------------------------------------------------------------------
 // LinkSubmitData
 //------------------------------------------------------------------------
@@ -61,9 +74,9 @@
 	// Destructor.
 	virtual ~LinkSubmitForm();
 	// Was the LinkImportData created successfully?
-	virtual GBool isOk() { return fileName != NULL; }
+	virtual GBool isOk() POPPLER_CONST { return fileName != NULL; }
 	// Accessors.
-	virtual LinkActionKind getKind() { return actionUnknown; }
+	virtual LinkActionKind getKind() POPPLER_CONST { return actionUnknown; }
 	GooString *getFileName() { return fileName; }
 	int getFlags() { return m_flags; }
 private:
@@ -83,9 +96,9 @@
 	// Destructor.
 	virtual ~LinkImportData();
 	// Was the LinkImportData created successfully?
-	virtual GBool isOk() { return fileName != NULL; }
+	virtual GBool isOk() POPPLER_CONST { return fileName != NULL; }
 	// Accessors.
-	virtual LinkActionKind getKind() { return actionUnknown; }
+	virtual LinkActionKind getKind() POPPLER_CONST { return actionUnknown; }
 	GooString *getFileName() { return fileName; }
 private:
 	GooString *fileName;		// file name
@@ -98,7 +111,7 @@
 {
 public:
 
-	SplashOutFontFileID(Ref *rA) { r = *rA; }
+	SplashOutFontFileID(const Ref *rA) { r = *rA; }
 	~SplashOutFontFileID() {}
 	GBool matches(SplashFontFileID *id)
 	{
@@ -146,6 +159,7 @@
 public:
 	SlaOutputDev(ScribusDoc* doc, QList<PageItem*> *Elements, QStringList *importedColors, int flags);
 	virtual ~SlaOutputDev();
+
 	LinkAction* SC_getAction(AnnotWidget *ano);
 	LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
 	static GBool annotations_callback(Annot *annota, void *user_data);
@@ -261,7 +275,7 @@
 private:
 	void getPenState(GfxState *state);
 	QString getColor(GfxColorSpace *color_space, GfxColor *color, int *shade);
-	QString getAnnotationColor(AnnotColor *color);
+	QString getAnnotationColor(const AnnotColor *color);
 	QString convertPath(GfxPath *path);
 	int getBlendMode(GfxState *state);
 	void applyMask(PageItem *ite);




More information about the scribus-commit mailing list