package: qpdfview
severity: important
version: 0.3~beta2-1
tags: patch

Your package failed to build on armel and armhf
sources/documentview.cpp: In member function ‘void 
DocumentView::preparePages()’:
sources/documentview.cpp:2121:40: error: no matching function for call to 
‘qMax(qreal&, double)’
sources/documentview.cpp:2121:40: note: candidate is:
/usr/include/qt4/QtCore/qglobal.h:1116:17: note: template<class T> const T& qMax(const 
T&, const T&)
sources/documentview.cpp:2122:40: error: no matching function for call to 
‘qMin(qreal&, double)’
sources/documentview.cpp:2122:40: note: candidate is:
/usr/include/qt4/QtCore/qglobal.h:1114:17: note: template<class T> const T& qMin(const 
T&, const T&)
make[1]: *** [documentview.o] Error 1

On most architectures qreal is defined as double but on arm architectures
it is defined as float. Assignments between qreal and double are ok because
assignments between float and double are ok but there can be issues with
pointers, templates and overloaded functions if proper distinctions are not
made. In this particular case the issue is a template.

The fix is a simple case of adding some typecasts a similar issue in main.cpp is fixed in the same way.

patch is attached.

Description: Fix qreal VS double
  Fix two qreal vs double issues that were preventing build on armel/armhf
  One invlolving a template the other involving pointers.
Author: Peter Michael Green <plugw...@p10link.net>
Bug-Debian: http://bugs.debian.org/?????

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- scribus-1.4.0.dfsg+r17287.orig/scribus/pageitem_textframe.cpp
+++ scribus-1.4.0.dfsg+r17287/scribus/pageitem_textframe.cpp
@@ -554,7 +554,7 @@ struct LineControl {
 		double maxX = colRight - morespace;
 		if (legacy) maxX -= lineCorr;
 
-		double StartX = floor(qMax(line.x, qMin(maxX,breakXPos-maxShrink-1))-1);
+		double StartX = floor(qMax((double)line.x, qMin(maxX,breakXPos-maxShrink-1))-1);
 		int xPos  = static_cast<int>(ceil(maxX));
 
 		QPoint  pt12 (xPos, yAsc);
--- scribus-1.4.0.dfsg+r17287.orig/scribus/scribusview.cpp
+++ scribus-1.4.0.dfsg+r17287/scribus/scribusview.cpp
@@ -1711,7 +1711,7 @@ bool ScribusView::slotSetCurs(int x, int
 			FPoint point(pf.x() - currItem->xPos(), pf.y() - currItem->yPos());
 			if (transform.isInvertible() && currItem->itemText.length() > 0)
 			{
-				double tx = 0, ty = 0;
+				qreal tx = 0, ty = 0;
 				transform.inverted().map(pf.x(), pf.y(), &tx, &ty);
 				point.setXY(tx, ty);
 			}

Reply via email to