Package: Scribus
Severity: Serious
Tags: Patch
Your package FTBFS on armel and armhf with the following error.
[ 60%] Building CXX object
scribus/CMakeFiles/scribus.dir/pageitem_textframe.cpp.o
/build/buildd-scribus_1.4.0.dfsg+r17287-1-armel-qlKYbT/scribus-1.4.0.dfsg+r17287/scribus/pageitem_textframe.cpp:
In member function 'double LineControl::endOfLine(const QRegion&, double, int,
int)':
/build/buildd-scribus_1.4.0.dfsg+r17287-1-armel-qlKYbT/scribus-1.4.0.dfsg+r17287/scribus/pageitem_textframe.cpp:557:70:
error: no matching function for call to 'qMax(qreal&, const double&)'
/build/buildd-scribus_1.4.0.dfsg+r17287-1-armel-qlKYbT/scribus-1.4.0.dfsg+r17287/scribus/pageitem_textframe.cpp:557:70:
note: candidate is:
/usr/include/qt4/QtCore/qglobal.h:1116:17: note: template<class T> const T& qMax(const
T&, const T&)
make[3]: *** [scribus/CMakeFiles/scribus.dir/pageitem_textframe.cpp.o] Error 1
qreal on most architectures is defined as double but on arm architetures it is
defined as float¹. It is OK to make assignments between qreal and double since
it is ok to make assignments between float and double. But in more complex
situations involving pointers, templates and/or overloading indiscriminate
mixing of qreal and double can cause problems.
In the case of your package there were a couple of such problems, the template
related issue that showed up in the build log and a pointer related issue.
Both were trival to fix.
Patch is attatched.
¹Note this is a QT upstream descision not a debian descision.
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);
}