View Issue Details

IDProjectCategoryView StatusLast Update
0009850ScribusGeneralpublic2014-09-03 11:55
Reporterjani@ubuntu.com Assigned Tomalex  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformARMOSlinux 
Product Version1.4.0svn 
Summary0009850: fails to build on arm, qreal != double
DescriptionThe code uses qreal and double interchangeably in a few places. On ARM qreal is defined as float so there are several build errors.
TagsNo tags attached.
Patch

Relationships

related to 0012655 closed [PATCH] FTBFS on arm[el|hf] 

Activities

jani@ubuntu.com

2011-03-17 15:07

reporter   ~0025834

Here is a patch. I bet things can be done cleaner, these are just casts at the place where the errors are.

jani@ubuntu.com

2011-03-17 15:10

reporter  

0001-qreal-double-fixes.patch (24,796 bytes)   
From 9119ac38936e7f9ddb15cd45531ddf76940a0283 Mon Sep 17 00:00:00 2001
From: Ubuntu System User <jani@panda.(none)>
Date: Thu, 17 Mar 2011 17:03:49 +0200
Subject: [PATCH] qreal/double fixes

---
 fonts/scfontmetrics.cpp                   |    4 ++--
 pageitem.cpp                              |   12 ++++++------
 pageitem_textframe.cpp                    |    6 +++---
 pdflib_core.cpp                           |    8 ++++----
 plugins/svgexplugin/svgexplugin.cpp       |   16 ++++++++--------
 plugins/tools/pathstroker/pathstroker.cpp |    2 +-
 propertiespalette.cpp                     |    4 ++--
 pslib.cpp                                 |   24 ++++++++++++------------
 scpageoutput.cpp                          |    8 ++++----
 scpainter.cpp                             |    8 ++++----
 scribusview.cpp                           |   16 ++++++++--------
 selection.cpp                             |    8 ++++----
 smlinestyle.cpp                           |    2 +-
 ui/modetoolbar.cpp                        |    2 +-
 14 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/fonts/scfontmetrics.cpp b/fonts/scfontmetrics.cpp
index 8706361..391ef54 100644
--- a/fonts/scfontmetrics.cpp
+++ b/fonts/scfontmetrics.cpp
@@ -281,7 +281,7 @@ QPixmap FontSample(const ScFace& fnt, int s, QString ts, QColor back, bool force
 			{
 				gly.translate(static_cast<qreal>(pen_x) / 6400.0, a);
 				gp = getMaxClipF(&gly);
-				ymax = qMax(ymax, gp.y());
+				ymax = qMax(double(ymax), gp.y());
 				p->setupPolygon(&gly);
 				p->fillPath();
 			}
@@ -302,7 +302,7 @@ QPixmap FontSample(const ScFace& fnt, int s, QString ts, QColor back, bool force
 			{
 				gly.translate(static_cast<qreal>(pen_x) / 6400.0, a);
 				gp = getMaxClipF(&gly);
-				ymax = qMax(ymax, gp.y());
+				ymax = qMax(double(ymax), gp.y());
 				p->setupPolygon(&gly);
 				p->fillPath();
 			}
diff --git a/pageitem.cpp b/pageitem.cpp
index ddc498b..35c61eb 100644
--- a/pageitem.cpp
+++ b/pageitem.cpp
@@ -1977,12 +1977,12 @@ void PageItem::drawGlyphs(ScPainter *p, const CharStyle& style, GlyphLayout& gly
 				if (style.underlineWidth() != -1)
 					lw = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
 				else
-					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			else
 			{
 				st = style.font().underlinePos(style.fontSize() / 10.0);
-				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			if (style.baselineOffset() != 0)
 				st += (style.fontSize() / 10.0) * glyphs.scaleV * (style.baselineOffset() / 1000.0);
@@ -2095,12 +2095,12 @@ void PageItem::drawGlyphs(ScPainter *p, const CharStyle& style, GlyphLayout& gly
 				if (style.strikethruWidth() != -1)
 					lw = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
 				else
-					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			else
 			{
 				st = style.font().strikeoutPos(style.fontSize() / 10.0);
-				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			if (style.baselineOffset() != 0)
 				st += (style.fontSize() / 10.0) * glyphs.scaleV * (style.baselineOffset() / 1000.0);
@@ -4692,7 +4692,7 @@ void PageItem::getBoundingRect(double *x1, double *y1, double *x2, double *y2) c
 		FPoint maxAr = getMaxClipF(&arrow);
 		totalRect = totalRect.united(QRectF(QPointF(minAr.x(), minAr.y()), QPointF(maxAr.x(), maxAr.y())));
 	}
-	totalRect.getCoords(x1, y1, x2, y2);
+	totalRect.getCoords((qreal*)x1, (qreal*)y1, (qreal*)x2, (qreal*)y2);
 }
 
 void PageItem::getVisualBoundingRect(double * x1, double * y1, double * x2, double * y2) const
@@ -4847,7 +4847,7 @@ void PageItem::getVisualBoundingRect(double * x1, double * y1, double * x2, doub
 		FPoint maxAr = getMaxClipF(&arrow);
 		totalRect = totalRect.united(QRectF(QPointF(minAr.x(), minAr.y()), QPointF(maxAr.x(), maxAr.y())));
 	}
-	totalRect.getCoords(x1, y1, x2, y2);
+	totalRect.getCoords((qreal*)x1, (qreal*)y1, (qreal*)x2, (qreal*)y2);
 }
 
 double PageItem::visualXPos() const
diff --git a/pageitem_textframe.cpp b/pageitem_textframe.cpp
index dc50d74..ffb8a5c 100644
--- a/pageitem_textframe.cpp
+++ b/pageitem_textframe.cpp
@@ -522,7 +522,7 @@ struct LineControl {
 		double maxX = colRight - morespace;
 		if (legacy) maxX -= (lineCorr + insets.Right);
 
-		double StartX = floor(qMax(line.x, qMin(colRight,breakXPos) - 1));
+		double StartX = floor(qMax((double)line.x, qMin(colRight,breakXPos) - 1));
 		int xPos  = static_cast<int>(ceil(maxX + insets.Right));
 		int yDesc = static_cast<int>(yPos+line.descent);
 		int yAsc  = static_cast<int>(ceil(yPos-line.ascent));
@@ -687,8 +687,8 @@ struct LineControl {
 				desc = cStyle.font().realCharDescent(ch, cStyle.fontSize() / 10.0);
 			}
 			//	qDebug() << QString("checking char 'x%2' with ascender %1 > %3").arg(asce).arg(ch.unicode()).arg(result);
-			line.ascent  = qMax(line.ascent, asce);
-			line.descent = qMax(line.descent, desc);
+			line.ascent  = qMax((double)line.ascent, asce);
+			line.descent = qMax((double)line.descent, desc);
 		}
 	}
 	
diff --git a/pdflib_core.cpp b/pdflib_core.cpp
index f46b05c..a4b3372 100644
--- a/pdflib_core.cpp
+++ b/pdflib_core.cpp
@@ -4433,12 +4433,12 @@ bool PDFLibCore::setTextCh(PageItem *ite, uint PNr, double x,  double y, uint d,
 				if (style.underlineWidth() != -1)
 					Uwid = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
 				else
-					Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+					Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), (qreal)1.0);
 			}
 			else
 			{
 				Upos = style.font().underlinePos(style.fontSize() / 10.0);
-				Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+				Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), (qreal)1.0);
 			}
 			if (style.baselineOffset() != 0)
 				Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
@@ -4713,12 +4713,12 @@ bool PDFLibCore::setTextCh(PageItem *ite, uint PNr, double x,  double y, uint d,
 				if (style.strikethruWidth() != -1)
 					Uwid = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
 				else
-					Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+					Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), (qreal)1.0);
 			}
 			else
 			{
 				Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
-				Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+				Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), (qreal)1.0);
 			}
 			if (style.baselineOffset() != 0)
 				Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
diff --git a/plugins/svgexplugin/svgexplugin.cpp b/plugins/svgexplugin/svgexplugin.cpp
index 2fe4118..aa4df4d 100644
--- a/plugins/svgexplugin/svgexplugin.cpp
+++ b/plugins/svgexplugin/svgexplugin.cpp
@@ -723,12 +723,12 @@ QDomElement SVGExPlug::processTextItem(PageItem *Item, QString trans, QString fi
 						if (charStyle.underlineWidth() != -1)
 							lw = (charStyle.underlineWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 						else
-							lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+							lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 					}
 					else
 					{
 						Upos = charStyle.font().underlinePos(charStyle.fontSize() / 10.0);
-						lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+						lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 					}
 					if (charStyle.baselineOffset() != 0)
 						Upos += (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -780,12 +780,12 @@ QDomElement SVGExPlug::processTextItem(PageItem *Item, QString trans, QString fi
 						if (charStyle.strikethruWidth() != -1)
 							lw = (charStyle.strikethruWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 						else
-							lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+							lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 					}
 					else
 					{
 						Upos = charStyle.font().strikeoutPos(charStyle.fontSize() / 10.0);
-						lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+						lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 					}
 					if (charStyle.baselineOffset() != 0)
 						Upos += (charStyle.fontSize() / 10.0) * hl->glyph.scaleV * (charStyle.baselineOffset() / 1000.0);
@@ -970,12 +970,12 @@ QDomElement SVGExPlug::processPathTextItem(PageItem *Item, QString trans, QStrin
 					if (charStyle.underlineWidth() != -1)
 						Uwid = (charStyle.underlineWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 					else
-						Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+						Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 				}
 				else
 				{
 					Upos = charStyle.font().underlinePos(charStyle.fontSize() / 10.0);
-					Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+					Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 				}
 				if (charStyle.baselineOffset() != 0)
 					Upos += (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -1046,12 +1046,12 @@ QDomElement SVGExPlug::processPathTextItem(PageItem *Item, QString trans, QStrin
 					if (charStyle.strikethruWidth() != -1)
 						Uwid = (charStyle.strikethruWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 					else
-						Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+						Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 				}
 				else
 				{
 					Upos = charStyle.font().strikeoutPos(charStyle.fontSize() / 10.0);
-					Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+					Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), qreal(1.0));
 				}
 				if (charStyle.baselineOffset() != 0)
 					Upos += (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
diff --git a/plugins/tools/pathstroker/pathstroker.cpp b/plugins/tools/pathstroker/pathstroker.cpp
index 67eb0e8..416e5af 100644
--- a/plugins/tools/pathstroker/pathstroker.cpp
+++ b/plugins/tools/pathstroker/pathstroker.cpp
@@ -115,7 +115,7 @@ bool PathStrokerPlugin::run(ScribusDoc* doc, QString)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 0)
 	{
-		QVector<double> m_array;
+		QVector<qreal> m_array;
 		PageItem *currItem = currDoc->m_Selection->itemAt(0);
 		FPointArray path = currItem->PoLine;
 		QPainterPath pp;
diff --git a/propertiespalette.cpp b/propertiespalette.cpp
index 9a4b9b0..1805b14 100644
--- a/propertiespalette.cpp
+++ b/propertiespalette.cpp
@@ -107,7 +107,7 @@ void LineFormatItemDelegate::redraw(const QVariant& data) const
 		const ScColor& col = item.m_doc->PageColors[item.m_Line[its].Color];
 		tmpf = ScColorEngine::getDisplayColor(col, item.m_doc, item.m_Line[its].Shade);
 		QPen pen;
-		QVector<double> m_array;
+		QVector<qreal> m_array;
 		if (item.m_Line[its].Dash == 1)
 			pen.setStyle(Qt::SolidLine);
 		else
@@ -4652,7 +4652,7 @@ void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
 			doc->setRedrawBounding(CurItem);
 			break;
 		default:
-			CurItem->SetFrameShape(c, vals);
+			CurItem->SetFrameShape(c, (double*)vals);
 			doc->setRedrawBounding(CurItem);
 			CurItem->FrameType = f+2;
 			break;
diff --git a/pslib.cpp b/pslib.cpp
index f4314a0..4673879 100644
--- a/pslib.cpp
+++ b/pslib.cpp
@@ -2840,12 +2840,12 @@ bool PSLib::ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool se
 									if (style.underlineWidth() != -1)
 										Uwid = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
 									else
-										Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+										Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 								}
 								else
 								{
 									Upos = style.font().underlinePos(style.fontSize() / 10.0);
-									Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+									Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 								}
 								if (style.baselineOffset() != 0)
 									Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
@@ -2911,12 +2911,12 @@ bool PSLib::ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool se
 									if (style.strikethruWidth() != -1)
 										Uwid = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
 									else
-										Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+										Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 								}
 								else
 								{
 									Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
-									Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+									Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 								}
 								if (style.baselineOffset() != 0)
 									Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
@@ -2988,12 +2988,12 @@ bool PSLib::ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool se
 							if (style.underlineWidth() != -1)
 								Uwid = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
 							else
-								Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+								Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 						}
 						else
 						{
 							Upos = style.font().underlinePos(style.fontSize() / 10.0);
-							Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+							Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 						}
 						if (style.baselineOffset() != 0)
 							Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
@@ -3065,12 +3065,12 @@ bool PSLib::ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool se
 							if (style.strikethruWidth() != -1)
 								Uwid = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
 							else
-								Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+								Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 						}
 						else
 						{
 							Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
-							Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+							Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 						}
 						if (style.baselineOffset() != 0)
 							Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
@@ -3792,12 +3792,12 @@ void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool g
 				if (cstyle.underlineWidth() != -1)
 					lw = (cstyle.underlineWidth() / 1000.0) * (cstyle.fontSize() / 10.0);
 				else
-					lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1.0);
+					lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), qreal(1.0));
 			}
 			else
 			{
 				Upos = cstyle.font().underlinePos(cstyle.fontSize() / 10.0);
-				lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1.0);
+				lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), qreal(1.0));
 			}
 			if (cstyle.baselineOffset() != 0)
 				Upos += (cstyle.fontSize() / 10.0) * glyphs.scaleV * (cstyle.baselineOffset() / 1000.0);
@@ -3925,12 +3925,12 @@ void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool g
 				if (cstyle.strikethruWidth() != -1)
 					lw = (cstyle.strikethruWidth() / 1000.0) * (cstyle.fontSize() / 10.0);
 				else
-					lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1.0);
+					lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), qreal(1.0));
 			}
 			else
 			{
 				Upos = cstyle.font().strikeoutPos(cstyle.fontSize() / 10.0);
-				lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1.0);
+				lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), qreal(1.0));
 			}
 			if (cstyle.baselineOffset() != 0)
 				Upos += (cstyle.fontSize() / 10.0) * glyphs.scaleV * (cstyle.baselineOffset() / 1000.0);
diff --git a/scpageoutput.cpp b/scpageoutput.cpp
index cad41b8..e245da1 100644
--- a/scpageoutput.cpp
+++ b/scpageoutput.cpp
@@ -551,12 +551,12 @@ void ScPageOutput::drawGlyphs(PageItem* item, ScPainterExBase *painter, const Ch
 				if (style.underlineWidth() != -1)
 					lw = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
 				else
-					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			else
 			{
 				st = style.font().underlinePos(style.fontSize() / 10.0);
-				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			if (style.baselineOffset() != 0)
 				st += (style.fontSize() / 10.0) * glyphs.scaleV * (style.baselineOffset() / 1000.0);
@@ -638,12 +638,12 @@ void ScPageOutput::drawGlyphs(PageItem* item, ScPainterExBase *painter, const Ch
 				if (style.strikethruWidth() != -1)
 					lw = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
 				else
-					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+					lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			else
 			{
 				st = style.font().strikeoutPos(style.fontSize() / 10.0);
-				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+				lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), qreal(1.0));
 			}
 			if (style.baselineOffset() != 0)
 				st += (style.fontSize() / 10.0) * glyphs.scaleV * (style.baselineOffset() / 1000.0);
diff --git a/scpainter.cpp b/scpainter.cpp
index 5b81a09..77498da 100644
--- a/scpainter.cpp
+++ b/scpainter.cpp
@@ -941,7 +941,7 @@ void ScPainter::drawVPath( int mode )
 			cairo_set_fill_rule (m_cr, CAIRO_FILL_RULE_WINDING);
 		if (fillMode == 1)
 		{
-			double r, g, b;
+			qreal r, g, b;
 			m_fill.getRgbF(&r, &g, &b);
 			cairo_set_source_rgba( m_cr, r, g, b, fill_trans );
 //			if (fill_trans != 1.0)
@@ -979,7 +979,7 @@ void ScPainter::drawVPath( int mode )
 				vneu = 255 - ((255 - v) * shad / 100);
 				qStopColor.setHsv(h, sneu, vneu);
 				double a = colorStops[offset]->opacity;
-				double r, g, b;
+				qreal r, g, b;
 				qStopColor.getRgbF(&r, &g, &b);
 				cairo_pattern_add_color_stop_rgba (pat, rampPoint, r, g, b, a);
 				lastPoint = rampPoint;
@@ -1024,7 +1024,7 @@ void ScPainter::drawVPath( int mode )
 			cairo_set_dash( m_cr, m_array.data(), m_array.count(), m_offset);
 		else
 			cairo_set_dash( m_cr, NULL, 0, 0 );
-		double r, g, b;
+		qreal r, g, b;
 		m_stroke.getRgbF(&r, &g, &b);
 		cairo_set_source_rgba( m_cr, r, g, b, stroke_trans );
 //		if (stroke_trans != 1.0)
@@ -1348,7 +1348,7 @@ void ScPainter::drawText(QRectF area, QString text)
 	double y;
 	double ww = 0;
 	double hh = 0;
-	double r, g, b;
+	qreal r, g, b;
 	cairo_select_font_face(m_cr, m_font.family().toLatin1(), CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
 	cairo_set_font_size(m_cr, m_font.pointSizeF());
 	cairo_font_extents (m_cr, &extentsF);
diff --git a/scribusview.cpp b/scribusview.cpp
index 78946c7..86ca4be 100644
--- a/scribusview.cpp
+++ b/scribusview.cpp
@@ -4116,12 +4116,12 @@ void ScribusView::TextToPath()
 							if (charStyle.underlineWidth() != -1)
 								Uwid = (charStyle.underlineWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 							else
-								Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+								Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 						}
 						else
 						{
 							Upos = charStyle.font().underlinePos(charStyle.fontSize() / 10.0);
-							Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+							Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 						}
 						if (charStyle.baselineOffset() != 0)
 							Upos += (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -4259,12 +4259,12 @@ void ScribusView::TextToPath()
 							if (charStyle.strikethruWidth() != -1)
 								Uwid = (charStyle.strikethruWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 							else
-								Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+								Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 						}
 						else
 						{
 							Upos = charStyle.font().strikeoutPos(charStyle.fontSize() / 10.0);
-							Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+							Uwid = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 						}
 						if (charStyle.baselineOffset() != 0)
 							Upos += (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -4350,12 +4350,12 @@ void ScribusView::TextToPath()
 								if (charStyle.underlineWidth() != -1)
 									lw = (charStyle.underlineWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 								else
-									lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+									lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 							}
 							else
 							{
 								st = charStyle.font().underlinePos(charStyle.fontSize() / 10.0);
-								lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+								lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 							}
 							if (charStyle.baselineOffset() != 0)
 								st += (charStyle.fontSize() / 10.0) * hl->glyph.scaleV * (charStyle.baselineOffset() / 1000.0);
@@ -4537,12 +4537,12 @@ void ScribusView::TextToPath()
 								if (charStyle.strikethruWidth() != -1)
 									lw = (charStyle.strikethruWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
 								else
-									lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+									lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 							}
 							else
 							{
 								st = charStyle.font().strikeoutPos(charStyle.fontSize() / 10.0);
-								lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1.0);
+								lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), (qreal)1.0);
 							}
 							if (charStyle.baselineOffset() != 0)
 								st += (charStyle.fontSize() / 10.0) * hl->glyph.scaleV * (charStyle.baselineOffset() / 1000.0);
diff --git a/selection.cpp b/selection.cpp
index 28f0ec2..0946d4b 100644
--- a/selection.cpp
+++ b/selection.cpp
@@ -447,10 +447,10 @@ void Selection::setGroupRect()
 			QRectF itRect(currItem->getVisualBoundingRect());
 // 			for (uint pc = 0; pc < 4; ++pc)
 			{
-				vminx = qMin(vminx, itRect.x());
-				vminy = qMin(vminy, itRect.y());
-				vmaxx = qMax(vmaxx, itRect.right());
-				vmaxy = qMax(vmaxy, itRect.bottom());
+				vminx = qMin(vminx, (double)itRect.x());
+				vminy = qMin(vminy, (double)itRect.y());
+				vmaxx = qMax(vmaxx, (double)itRect.right());
+				vmaxy = qMax(vmaxy, (double)itRect.bottom());
 			}
 		}
 		else
diff --git a/smlinestyle.cpp b/smlinestyle.cpp
index c9be02f..d5e29c6 100644
--- a/smlinestyle.cpp
+++ b/smlinestyle.cpp
@@ -729,7 +729,7 @@ void SMLineStyle::updatePreview()
 	for (int it = (*tmpLine).size()-1; it > -1; it--)
 	{
 		QPen pen;
-		QVector<double> m_array;
+		QVector<qreal> m_array;
 		if ((*tmpLine)[it].Dash == 1)
 			pen.setStyle(Qt::SolidLine);
 		else
diff --git a/ui/modetoolbar.cpp b/ui/modetoolbar.cpp
index 55acb28..d4f612a 100644
--- a/ui/modetoolbar.cpp
+++ b/ui/modetoolbar.cpp
@@ -101,7 +101,7 @@ void ModeToolBar::SelShape(int s, int c, qreal *vals)
 //	insertShapeButtonMenu->hide();
 	SubMode = s;
 	ValCount = c;
-	ShapeVals = vals;
+	ShapeVals = (double*)vals;
 	m_ScMW->scrActions["toolsInsertShape"]->setChecked(false);
 	m_ScMW->scrActions["toolsInsertShape"]->setChecked(true);
 }
-- 
1.7.4.1

0001-qreal-double-fixes.patch (24,796 bytes)   

malex

2011-04-15 15:56

administrator   ~0026093

Will test and upload into Debian

Shaforostoff

2011-07-19 15:07

reporter   ~0026610

any progress so far?

malex

2012-02-10 03:37

administrator   ~0027680

Now that 1.4.0 has been released I am pushing this into mainline. Revision 17287 has been committed into the Version14x branch.

malex

2012-02-11 17:21

administrator   ~0027685

Fails to build on armel armhf again with this patch:

                 from /build/buildd-scribus_1.4.0.dfsg+r17287-1-armhf-biDriZ/scribus-1.4.0.dfsg+r17287/scribus/page.h:32,
                 from /build/buildd-scribus_1.4.0.dfsg+r17287-1-armhf-biDriZ/scribus-1.4.0.dfsg+r17287/scribus/pageitem_polyline.cpp:26:
/usr/include/qt4/QtCore/qstring.h:187:17: note: the mangling of 'va_list' has changed in GCC 4.4
[ 60%] Building CXX object scribus/CMakeFiles/scribus.dir/pageitem_textframe.cpp.o
/build/buildd-scribus_1.4.0.dfsg+r17287-1-armhf-biDriZ/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-armhf-biDriZ/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-armhf-biDriZ/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
make[3]: Leaving directory `/build/buildd-scribus_1.4.0.dfsg+r17287-1-armhf-biDriZ/scribus-1.4.0.dfsg+r17287/debian/build'
make[2]: *** [scribus/CMakeFiles/scribus.dir/all] Error 2
make[2]: Leaving directory `/build/buildd-scribus_1.4.0.dfsg+r17287-1-armhf-biDriZ/scribus-1.4.0.dfsg+r17287/debian/build'
make[1]: *** [all] Error 2
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

malex

2012-02-14 22:57

administrator   ~0027699

A couple more fixes were applied. We're at revision 17300 now. However, according to jghali, even if the code builds it is not usable on armel at ALL. We have to keep that in mind. If at some point armel becomes a usable desktop/tablet architecture where people might want to actually run Scribus we'll have to completely remove Scribus from Debian/Ubuntu or do the major rewrites jghali mentioned. This patch is a sham.

malex

2012-02-15 22:54

administrator   ~0027701

1.4.0.dfsg+r17300 has been built in debian on all arches. A dummy scribus-ng package has been uploaded for a transition.

Issue History

Date Modified Username Field Change
2011-03-17 15:02 jani@ubuntu.com New Issue
2011-03-17 15:07 jani@ubuntu.com Note Added: 0025834
2011-03-17 15:10 jani@ubuntu.com File Added: 0001-qreal-double-fixes.patch
2011-04-15 15:56 malex Note Added: 0026093
2011-07-19 15:07 Shaforostoff Note Added: 0026610
2012-02-10 03:37 malex Note Added: 0027680
2012-02-10 21:06 malex Assigned To => malex
2012-02-10 21:06 malex Status new => assigned
2012-02-11 17:21 malex Note Added: 0027685
2012-02-14 22:57 malex Note Added: 0027699
2012-02-15 22:54 malex Note Added: 0027701
2012-02-15 22:54 malex Status assigned => resolved
2012-02-15 22:54 malex Resolution open => fixed
2012-02-15 22:54 malex Status resolved => closed
2014-09-03 11:55 ale Relationship added related to 0012655