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);
                                }
                        }
                }


_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit

Reply via email to