r16165 by fschmid - Fixes for correct object positioning for the .sml importer.

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 27 00:29:08 CET 2010


Author: fschmid
Date: Sun Dec 26 23:29:08 2010
New Revision: 16165

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16165
Log:
Fixes for correct object positioning for the .sml importer.

Modified:
    trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
    trunk/Scribus/scribus/plugins/import/sml/importsml.h

Modified: trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16165&path=/trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/sml/importsml.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/sml/importsml.cpp Sun Dec 26 23:29:08 2010
@@ -403,6 +403,7 @@
 	ite->setLineJoin(LineJoin);
 	ite->setLineEnd(LineEnd);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
+	ite->PoLine.translate(m_Doc->currentPage()->xOffset(), m_Doc->currentPage()->yOffset());
 	m_Doc->AdjustItemSize(ite);
 	ite->OldB2 = ite->width();
 	ite->OldH2 = ite->height();
@@ -436,6 +437,8 @@
 				processFillNode(pg);
 			else if (pg.tagName() == "KivioPoint")
 				processPointNode(pg);
+			else if (pg.tagName() == "Line")
+				processLineNode(pg);
 			node = node.nextSibling();
 		}
 	}
@@ -529,6 +532,21 @@
 		CurrColorFill = processColor(elem);
 }
 
+void SmlPlug::processLineNode(QDomElement &elem)
+{
+	double x = ScCLocale::toDoubleC(elem.attribute("x1"));
+	double y = ScCLocale::toDoubleC(elem.attribute("y1"));
+	double x1 = ScCLocale::toDoubleC(elem.attribute("x2"));
+	double y1 = ScCLocale::toDoubleC(elem.attribute("y2"));
+	if (!first)
+		Coords.setMarker();
+	Coords.addPoint(x, y);
+	Coords.addPoint(x, y);
+	Coords.addPoint(x1, y1);
+	Coords.addPoint(x1, y1);
+	first = false;
+}
+
 void SmlPlug::processPointNode(QDomElement &elem)
 {
 	double x = ScCLocale::toDoubleC(elem.attribute("x"));

Modified: trunk/Scribus/scribus/plugins/import/sml/importsml.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16165&path=/trunk/Scribus/scribus/plugins/import/sml/importsml.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/sml/importsml.h (original)
+++ trunk/Scribus/scribus/plugins/import/sml/importsml.h Sun Dec 26 23:29:08 2010
@@ -63,6 +63,7 @@
 	QString processColor(QDomElement &elem);
 	void processStrokeNode(QDomElement &elem);
 	void processFillNode(QDomElement &elem);
+	void processLineNode(QDomElement &elem);
 	void processPointNode(QDomElement &elem);
 	
 	QList<PageItem*> Elements;




More information about the scribus-commit mailing list