r18805 by jghali - #12053: <nbspace> tag should accept font-size attribute
scribus-commit
scribus-commit at lists.scribus.net
Sun Feb 9 00:02:01 UTC 2014
Author: jghali
Date: Sun Feb 9 00:02:01 2014
New Revision: 18805
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18805
Log:
#12053: <nbspace> tag should accept font-size attribute
Modified:
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18805&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun Feb 9 00:02:01 2014
@@ -3764,13 +3764,41 @@
else if (tName == "breakframe")
newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::FRAMEBREAK);
else if (tName == "nbhyphen")
+ {
+ CharStyle newStyle;
newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::NBHYPHEN);
+ readCharacterStyleAttrs(doc, tAtt, newStyle);
+ newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, newStyle);
+ lastStyle->StyleStart = newItem->itemText.length()-1;
+ lastStyle->Style = newStyle;
+ }
else if (tName == "nbspace")
+ {
+ CharStyle newStyle;
newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::NBSPACE);
+ readCharacterStyleAttrs(doc, tAtt, newStyle);
+ newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, newStyle);
+ lastStyle->StyleStart = newItem->itemText.length()-1;
+ lastStyle->Style = newStyle;
+ }
else if (tName == "zwnbspace")
+ {
+ CharStyle newStyle;
newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::ZWNBSPACE);
+ readCharacterStyleAttrs(doc, tAtt, newStyle);
+ newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, newStyle);
+ lastStyle->StyleStart = newItem->itemText.length()-1;
+ lastStyle->Style = newStyle;
+ }
else if (tName == "zwspace")
+ {
+ CharStyle newStyle;
newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::ZWSPACE);
+ readCharacterStyleAttrs(doc, tAtt, newStyle);
+ newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, newStyle);
+ lastStyle->StyleStart = newItem->itemText.length()-1;
+ lastStyle->Style = newStyle;
+ }
else if (tName == "var")
{
CharStyle newStyle;
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18805&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sun Feb 9 00:02:01 2014
@@ -1573,10 +1573,7 @@
if (k - lastPos > 0)
{
docu.writeEmptyElement("ITEXT");
- /*if (item->asPathText()) // seems to cause problems when loading pathtext elements
- putCStylePT(docu, lastStyle);
- else*/
- putCStyle(docu, lastStyle);
+ putCStyle(docu, lastStyle);
docu.writeAttribute("CH", textWithSoftHyphens(item->itemText, lastPos, k));
}
lastStyle = style1;
@@ -1587,10 +1584,7 @@
{
// each obj in its own ITEXT for now
docu.writeEmptyElement("ITEXT");
- /*if (item->asPathText()) // seems to cause problems when loading pathtext elements
- putCStylePT(docu, lastStyle);
- else*/
- putCStyle(docu, lastStyle);
+ putCStyle(docu, lastStyle);
tmpnum.setNum(ch.unicode());
docu.writeAttribute("Unicode", tmpnum);
docu.writeAttribute("COBJ", item->itemText.object(k)->inlineCharID);
@@ -1619,13 +1613,25 @@
else if (ch == SpecialChars::FRAMEBREAK)
docu.writeEmptyElement("breakframe");
else if (ch == SpecialChars::NBHYPHEN)
+ {
docu.writeEmptyElement("nbhyphen");
+ putCStyle(docu, lastStyle);
+ }
else if (ch == SpecialChars::NBSPACE)
+ {
docu.writeEmptyElement("nbspace");
+ putCStyle(docu, lastStyle);
+ }
else if (ch == SpecialChars::ZWNBSPACE)
+ {
docu.writeEmptyElement("zwnbspace");
+ putCStyle(docu, lastStyle);
+ }
else if (ch == SpecialChars::ZWSPACE)
+ {
docu.writeEmptyElement("zwspace");
+ putCStyle(docu, lastStyle);
+ }
else if (ch == SpecialChars::PAGENUMBER)
{
docu.writeEmptyElement("var");
More information about the scribus-commit
mailing list