r17259 by fschmid - IDML Importer: some fixes for PathTexts.

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 29 12:26:03 UTC 2012


Author: fschmid
Date: Sun Jan 29 12:26:03 2012
New Revision: 17259

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17259
Log:
IDML Importer: some fixes for PathTexts.

Modified:
    trunk/Scribus/scribus/fpointarray.cpp
    trunk/Scribus/scribus/fpointarray.h
    trunk/Scribus/scribus/plugins/import/idml/importidml.cpp

Modified: trunk/Scribus/scribus/fpointarray.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17259&path=/trunk/Scribus/scribus/fpointarray.cpp
==============================================================================
--- trunk/Scribus/scribus/fpointarray.cpp (original)
+++ trunk/Scribus/scribus/fpointarray.cpp Sun Jan 29 12:26:03 2012
@@ -74,6 +74,19 @@
 	return true;
 }
 
+void FPointArray::reverse()
+{
+	FPointArray tmp;
+	tmp << *this;
+	tmp.QVector<FPoint>::squeeze();
+	QVector<FPoint>::resize(0);
+	QVector<FPoint>::squeeze();
+	for (int a = 0; a < tmp.count()-1; a += 2)
+	{
+		QVector<FPoint>::prepend(tmp.point(a+1));
+		QVector<FPoint>::prepend(tmp.point(a));
+	}
+}
 
 bool FPointArray::setPoints( int nPoints, double firstx, double firsty, ... )
 {

Modified: trunk/Scribus/scribus/fpointarray.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17259&path=/trunk/Scribus/scribus/fpointarray.h
==============================================================================
--- trunk/Scribus/scribus/fpointarray.h (original)
+++ trunk/Scribus/scribus/fpointarray.h Sun Jan 29 12:26:03 2012
@@ -47,6 +47,7 @@
 	FPointArray(const FPointArray &a) : QVector<FPoint>(a), svgState(NULL) {};
 	uint size() const { return static_cast<uint>(QVector<FPoint>::count()); };
 	bool resize(uint newCount);
+	void reverse();
 	void setPoint(uint i, double x, double y) { Iterator p = begin(); p+=i; p->xp = x; p->yp = y; };
 	void setPoint(uint i, FPoint p) {	setPoint(i, p.xp, p.yp); };
 	bool setPoints( int nPoints, double firstx, double firsty, ... );

Modified: trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17259&path=/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidml.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidml.cpp Sun Jan 29 12:26:03 2012
@@ -2003,6 +2003,19 @@
 				m_Doc->AdjustItemSize(item);
 				item->setRotation(-rot, true);
 				item->moveBy(dx, dy, true);
+				if (isPathText)
+				{
+					if (isOpen)
+					{
+						if (scX < 0)
+							item->PoLine.reverse();
+					}
+					else
+					{
+						if (scX > 0)
+							item->PoLine.reverse();
+					}
+				}
 				item->OldB2 = item->width();
 				item->OldH2 = item->height();
 				item->updateClip();
@@ -2161,6 +2174,19 @@
 			item->setTextFlowMode(textFlow);
 			m_Doc->AdjustItemSize(item);
 			item->moveBy(dx, dy, true);
+			if (isPathText)
+			{
+				if (isOpen)
+				{
+					if (scX < 0)
+						item->PoLine.reverse();
+				}
+				else
+				{
+					if (scX > 0)
+						item->PoLine.reverse();
+				}
+			}
 			item->setRotation(-rot, true);
 			item->OldB2 = item->width();
 			item->OldH2 = item->height();




More information about the scribus-commit mailing list