r14446 by fschmid - Xara Importer: implemented reading of guide lines.

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 22 13:20:24 CET 2009


Revision: 14446
Author: fschmid
Date: 2009-12-22T00:25:07.679712Z
Commit message: Xara Importer: implemented reading of guide lines.

Changeset: 
M  /trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
M  /trunk/Scribus/scribus/plugins/import/xar/importxar.h

Diffs:
Index: scribus/plugins/import/xar/importxar.cpp
===================================================================
--- scribus/plugins/import/xar/importxar.cpp	(revision 14445)
+++ scribus/plugins/import/xar/importxar.cpp	(revision 14446)
@@ -554,6 +554,8 @@
 		defineBitmap(ts, dataLen, tag);
 	else if (tag == 104)
 		createGroupItem();
+	else if (tag == 112)
+		createGuideLine(ts);
 	else if (tag == 114)
 	{
 		closed = handlePathRel(ts, dataLen);
@@ -740,13 +742,29 @@
 	{
 /*		if (m_gc.count() > 3)
 		{
-			if ((tag > 1999) && (tag < 3000))
+		//	if ((tag > 1999) && (tag < 3000))
 				qDebug() << QString("Unhandled OpCode: %1 Data Len %2").arg(tag).arg(dataLen, 8, 16, QLatin1Char('0'));
 		} */
 		ts.skipRawData(dataLen);
 	}
 }
 
+void XarPlug::createGuideLine(QDataStream &ts)
+{
+	quint8 flags;
+	qint32 position;
+	ts >> flags;
+	ts >> position;
+	double gpos = position / 1000.0;
+	if (importerFlags & LoadSavePlugin::lfCreateDoc)
+	{
+		if (flags == 1)
+			m_Doc->currentPage()->guides.addHorizontal(docHeight - gpos, GuideManagerCore::Standard);
+		else
+			m_Doc->currentPage()->guides.addVertical(gpos, GuideManagerCore::Standard);
+	}
+}
+
 void XarPlug::handleTextFontSize(QDataStream &ts)
 {
 	quint32 size;
@@ -2540,7 +2558,6 @@
 	ts >> rotate;
 	ts >> offsetX >> offsetY;
 	ts >> scale;
-	qDebug() << "Using Brush" << brushRef[handle]  << "Rot" << rotate << "Offsets X" << offsetX << "Y" << offsetY << "Sc" << scale;
 	ScPattern pat = m_Doc->docPatterns[brushRef[handle]];
 	XarStyle *gc = m_gc.top();
 	gc->strokePattern = brushRef[handle];
Index: scribus/plugins/import/xar/importxar.h
===================================================================
--- scribus/plugins/import/xar/importxar.h	(revision 14445)
+++ scribus/plugins/import/xar/importxar.h	(revision 14446)
@@ -215,6 +215,7 @@
 	bool convert(QString fn);
 	void parseXar(QDataStream &ts);
 	void handleTags(quint32 tag, quint32 dataLen, QDataStream &ts);
+	void createGuideLine(QDataStream &ts);
 	void handleTextFontSize(QDataStream &ts);
 	void defineTextFontFace(QDataStream &ts, quint32 dataLen);
 	void handleTextFont(QDataStream &ts);




More information about the scribus-commit mailing list