r19468 by fschmid - IDML Importer: improved text import.

scribus-commit scribus-commit at lists.scribus.net
Sun Aug 31 09:13:21 UTC 2014


Author: fschmid
Date: Sun Aug 31 09:13:21 2014
New Revision: 19468

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19468
Log:
IDML Importer: improved text import.

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

Modified: trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19468&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 Aug 31 09:13:21 2014
@@ -2771,17 +2771,25 @@
 	QString fontStyle = ttx.charStyle().font().style();
 	for(QDomNode stc = ste.firstChild(); !stc.isNull(); stc = stc.nextSibling() )
 	{
-		int posC = item->itemText.length();
 		QDomElement stt = stc.toElement();
 		if (stt.tagName() == "CharacterStyleRange")
-			parseCharacterStyleRange(stt, item, fontBase, fontStyle, newStyle, posC);
+			parseCharacterStyleRange(stt, item, fontBase, fontStyle, newStyle, item->itemText.length());
 		else if (stt.tagName() == "XMLElement")
 		{
 			for(QDomNode stx = stt.firstChild(); !stx.isNull(); stx = stx.nextSibling() )
 			{
 				QDomElement stxe = stx.toElement();
 				if (stxe.tagName() == "CharacterStyleRange")
-					parseCharacterStyleRange(stt, item, fontBase, fontStyle, newStyle, posC);
+					parseCharacterStyleRange(stxe, item, fontBase, fontStyle, newStyle, item->itemText.length());
+				else if (stxe.tagName() == "XMLElement")
+				{
+					for(QDomNode stxx = stxe.firstChild(); !stxx.isNull(); stxx = stxx.nextSibling() )
+					{
+						QDomElement stxxe = stxx.toElement();
+						if (stxxe.tagName() == "CharacterStyleRange")
+							parseCharacterStyleRange(stxxe, item, fontBase, fontStyle, newStyle, item->itemText.length());
+					}
+				}
 			}
 		}
 	}
@@ -2995,10 +3003,10 @@
 		}
 		else if (s.tagName() == "XMLElement")
 		{
-			for(QDomNode stx = s.firstChild(); !stx.isNull(); stx = stx.nextSibling() )
-			{
+		//	for(QDomNode stx = s.firstChild(); !stx.isNull(); stx = stx.nextSibling() )
+		//	{
 				parseCharacterStyleRange(s, item, fontBase, fontStyle, newStyle, posC);
-			}
+		//	}
 		}
 	}
 	if (data.count() > 0)




More information about the scribus-commit mailing list