r20061 by craig - Get rid of redundant getCombinedTransform vs getTransform and save a function call in lots of places

scribus-commit scribus-commit at lists.scribus.net
Thu May 7 20:42:21 UTC 2015


Author: craig
Date: Thu May  7 20:42:20 2015
New Revision: 20061

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20061
Log:
Get rid of redundant getCombinedTransform vs getTransform and save a function call in lots of places

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20061&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Thu May  7 20:42:20 2015
@@ -366,7 +366,7 @@
 			double x, y, w, h;
 			if (currItem->isGroupChild())
 			{
-				QTransform t = currItem->getCombinedTransform();
+				QTransform t = currItem->getTransform();
 				double sx, sy;
 				getScaleFromMatrix(t, sx, sy);
 				psx->setTransform(t, true);

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20061&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Thu May  7 20:42:20 2015
@@ -8906,13 +8906,6 @@
 
 QTransform PageItem::getTransform() const
 {
-//	QTransform result;
-//	getTransform(result);
-	return getCombinedTransform();
-}
-
-QTransform PageItem::getCombinedTransform() const
-{
 	QTransform result;
 	if (isGroupChild())
 	{
@@ -9859,7 +9852,7 @@
 	int w = qRound(ceil(BoundingW + Oldm_lineWidth + 10) * viewScale);
 	int h = qRound(ceil(BoundingH + Oldm_lineWidth + 10) * viewScale);
 	QRect ret = QRect(0, 0, w - x, h - y);
-	QTransform t = getCombinedTransform();
+	QTransform t = getTransform();
 	ret = t.mapRect(ret);
 	ret.translate(qRound(-m_Doc->minCanvasCoordinate.x() * viewScale), qRound(-m_Doc->minCanvasCoordinate.y() * viewScale));
 	return ret;

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20061&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Thu May  7 20:42:20 2015
@@ -374,7 +374,6 @@
 	QTransform getGroupTransform() const;
 	void getTransform(QTransform& mat) const;
 	QTransform getTransform() const;
-	QTransform getCombinedTransform() const;
 
 
 	/// invalidates current layout information

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20061&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu May  7 20:42:20 2015
@@ -174,7 +174,7 @@
 		if (doLayout)
 			it->layout();
 		double x, y, w, h;
-		QTransform t = it->getCombinedTransform();
+		QTransform t = it->getTransform();
 		w = it->visualWidth();
 		h = it->visualHeight();
 		x = -it->visualLineWidth() / 2.0;
@@ -6012,7 +6012,7 @@
 		double y = currentPage()->yOffset() - docPrefsData.docSetupPrefs.bleeds.top();
 		double w = currentPage()->width() + docPrefsData.docSetupPrefs.bleeds.left() + docPrefsData.docSetupPrefs.bleeds.right();
 		double h1 = currentPage()->height() + docPrefsData.docSetupPrefs.bleeds.bottom() + docPrefsData.docSetupPrefs.bleeds.top();
-		QTransform t = currItem->getCombinedTransform();
+		QTransform t = currItem->getTransform();
 		double w2 = currItem->visualWidth();
 		double h2 = currItem->visualHeight();
 		double x2 = -currItem->visualLineWidth() / 2.0;
@@ -6033,7 +6033,7 @@
 			double y = Pages->at(a)->yOffset() - pageBleeds.top();
 			double w = Pages->at(a)->width() + pageBleeds.left() + pageBleeds.right();
 			double h1 = Pages->at(a)->height() + pageBleeds.bottom() + pageBleeds.top();
-			QTransform t = currItem->getCombinedTransform();
+			QTransform t = currItem->getTransform();
 			double w2 = currItem->visualWidth();
 			double h2 = currItem->visualHeight();
 			double x2 = -currItem->visualLineWidth() / 2.0;
@@ -6108,7 +6108,7 @@
 			double y1 = page->yOffset() - pageBleeds.top();
 			double w1 = page->width()   + pageBleeds.left() + pageBleeds.right();
 			double h1 = page->height()  + pageBleeds.bottom() + pageBleeds.top();
-			QTransform t = currItem->getCombinedTransform();
+			QTransform t = currItem->getTransform();
 			double w2 = currItem->visualWidth();
 			double h2 = currItem->visualHeight();
 			double x2 = -currItem->visualLineWidth() / 2.0;




More information about the scribus-commit mailing list