r18346 by fschmid - Fixed Bug #11600: IDML import : tabs not imported in style definitions
scribus-commit
scribus-commit at lists.scribus.net
Sat Jun 29 09:08:09 UTC 2013
Author: fschmid
Date: Sat Jun 29 09:08:08 2013
New Revision: 18346
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18346
Log:
Fixed Bug #11600: IDML import : tabs not imported in style definitions
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=18346&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 Sat Jun 29 09:08:08 2013
@@ -1130,6 +1130,56 @@
newStyle.setLineSpacing(lead);
}
}
+ }
+ else if (i.tagName() == "TabList")
+ {
+ QList<ParagraphStyle::TabRecord> tbs;
+ newStyle.resetTabValues();
+ for(QDomNode tabl = i.firstChild(); !tabl.isNull(); tabl = tabl.nextSibling() )
+ {
+ QDomElement ta = tabl.toElement();
+ if (ta.tagName() == "ListItem")
+ {
+ ParagraphStyle::TabRecord tb;
+ for(QDomNode tal = ta.firstChild(); !tal.isNull(); tal = tal.nextSibling() )
+ {
+ QDomElement tab = tal.toElement();
+ QString tabVal = tab.text();
+ if (tab.tagName() == "Alignment")
+ {
+ tb.tabType = 0;
+ if (tabVal == "LeftAlign")
+ tb.tabType = 0;
+ else if (tabVal == "CenterAlign")
+ tb.tabType = 4;
+ else if (tabVal == "RightAlign")
+ tb.tabType = 1;
+ else if (tabVal == "Spreadsheet")
+ tb.tabType = 3;
+ }
+ else if (tab.tagName() == "Position")
+ {
+ tb.tabPosition = tabVal.toDouble();
+ }
+ else if (tab.tagName() == "Leader")
+ {
+ tb.tabFillChar = tabVal.isEmpty() ? QChar() : tabVal[0];
+ }
+ else if (tab.tagName() == "AlignmentCharacter")
+ {
+ if (tb.tabType == 3)
+ {
+ if (tabVal.startsWith(","))
+ tb.tabType = 4;
+ }
+ }
+ }
+ tbs.append(tb);
+
+ }
+ }
+ if (tbs.count() > 0)
+ newStyle.setTabValues(tbs);
}
}
}
More information about the scribus-commit
mailing list