r18576 by fschmid - Viva-Importer: Correct formatting of page numbers etc..

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 26 07:36:48 UTC 2013


Author: fschmid
Date: Sat Oct 26 07:36:47 2013
New Revision: 18576

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18576
Log:
Viva-Importer: Correct formatting of page numbers etc..

Modified:
    trunk/Scribus/scribus/plugins/import/viva/importviva.cpp

Modified: trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18576&path=/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/viva/importviva.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/viva/importviva.cpp Sat Oct 26 07:36:47 2013
@@ -1634,21 +1634,39 @@
 											for(QDomNode stcesp = stcet.firstChild(); !stcesp.isNull(); stcesp = stcesp.nextSibling() )
 											{
 												QDomElement stcespt = stcesp.toElement();
+												int count = stcespt.text().length();
 												if (stcespt.tagName() == "vt:plain-text")
 													itemText.insertChars(posC, stcespt.text());
 												else if (stcespt.tagName() == "vt:lf")
+												{
+													count = 1;
 													itemText.insertChars(posC, SpecialChars::LINEBREAK);
+												}
 												else if (stcespt.tagName() == "vt:soft-hyphen")
+												{
+													count = 1;
 													itemText.insertChars(posC, SpecialChars::SHYPHEN);
+												}
 												else if (stcespt.tagName() == "vt:space")
 												{
 													if (stcespt.attribute("vt:br") == "false")
+													{
+														count = 1;
 														itemText.insertChars(posC, SpecialChars::NBSPACE);
+													}
 												}
 												else if (stcespt.tagName() == "vt:variable")
 												{
 													if (stcespt.attribute("vt:type") == "Viva Technology/Page Number")
+													{
+														count = 1;
 														itemText.insertChars(posC, SpecialChars::PAGENUMBER);
+													}
+													else if (stcespt.attribute("vt:type") == "Viva Technology/Number of Pages")
+													{
+														count = 1;
+														itemText.insertChars(posC, SpecialChars::PAGECOUNT);
+													}
 												/*	else if (stcespt.attribute("vt:type") == "Viva Technology/TextEngine/Date")
 													{
 														QDomNode anc = stcespt.firstChild();
@@ -1666,7 +1684,7 @@
 															else
 																decomdata = data;
 														}
-													}*/
+													} */
 												}
 												else if (stcespt.tagName() == "vt:anchoring-object")
 												{
@@ -1688,11 +1706,18 @@
 															}
 														}
 													}
+													count = 1;
 												}
 												else if (stcespt.tagName() == "vt:tab")
+												{
+													count = 1;
 													itemText.insertChars(posC, SpecialChars::TAB);
-												itemText.applyStyle(posC, tmpStyle);
-												itemText.applyCharStyle(posC, stcespt.text().length(), tmpCStyle);
+												}
+												if (count != 0)
+												{
+													itemText.applyStyle(posC, tmpStyle);
+													itemText.applyCharStyle(posC, count, tmpCStyle);
+												}
 												posC = itemText.length();
 											}
 										}




More information about the scribus-commit mailing list