[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/filters
From:       Lassi Taneli Nieminen <lassniem () gmail ! com>
Date:       2010-11-15 9:30:05
Message-ID: 20101115093006.01E4AAC8A0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1197258 by lassin:

Minor style & performance improvement to ooxml.


 M  +15 -9     kword/docx/DocxXmlDocumentReader.cpp  
 M  +23 -49    libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h  
 U             libmsooxml/MsooXmlVmlReaderImpl.h  


--- trunk/koffice/filters/kword/docx/DocxXmlDocumentReader.cpp #1197257:1197258
@@ -1420,8 +1420,8 @@
 //! instrText handler
 /*
  Parent elements:
- - r ( §17.3.2.25)
- - r ( §22.1.2.87)
+ - [done] r ( §17.3.2.25)
+ - [done] r ( §22.1.2.87)
 */
 //! @todo support all attributes etc.
 KoFilter::ConversionStatus DocxXmlDocumentReader::read_instrText()
@@ -2791,10 +2791,12 @@
     READ_ATTR(val)
     // Does ODF support high/low/medium kashida ?
     val = val.toLower();
-    if ((val == "both") || (val == "distribute"))
+    if ((val == "both") || (val == "distribute")) {
         m_currentParagraphStyle.addProperty("fo:text-align", "justify");
-    else if ((val == "start") || (val == "left") || (val == "right") || (val == \
"center")) +    }
+    else if ((val == "start") || (val == "left") || (val == "right") || (val == \
"center")) {  m_currentParagraphStyle.addProperty("fo:text-align", val);
+    }
     readNext();
     READ_EPILOGUE
 }
@@ -3559,7 +3561,7 @@
     createBorderStyle(sz, color, val, RightBorder);
     TRY_READ_ATTR(space)
     if (!space.isEmpty()) {
-        int sp;
+        int sp = 0;
         m_textBorderPaddings.insertMulti(QString::number(sp) + "pt", TopBorder);
         m_textBorderPaddings.insertMulti(QString::number(sp) + "pt", LeftBorder);
         m_textBorderPaddings.insertMulti(QString::number(sp) + "pt", RightBorder);
@@ -3622,8 +3624,9 @@
 KoFilter::ConversionStatus DocxXmlDocumentReader::read_caps()
 {
     READ_PROLOGUE
-    if (READ_BOOLEAN_VAL)
+    if (READ_BOOLEAN_VAL) {
         m_currentTextStyleProperties->setFontCapitalization(QFont::AllUppercase);
+    }
     readNext();
     READ_EPILOGUE
 }
@@ -3651,8 +3654,9 @@
 KoFilter::ConversionStatus DocxXmlDocumentReader::read_smallCaps()
 {
     READ_PROLOGUE
-    if (READ_BOOLEAN_VAL)
+    if (READ_BOOLEAN_VAL) {
         m_currentTextStyleProperties->setFontCapitalization(QFont::SmallCaps);
+    }
     readNext();
     READ_EPILOGUE
 }
@@ -3778,10 +3782,12 @@
     const QXmlStreamAttributes attrs(attributes());
     TRY_READ_ATTR(val)
     val = val.toLower();
-    if (val == "superscript")
+    if (val == "superscript") {
         m_currentTextStyleProperties->setVerticalAlignment(QTextCharFormat::AlignSuperScript);
                
-    else if (val == "subscript")
+    }
+    else if (val == "subscript") {
         m_currentTextStyleProperties->setVerticalAlignment(QTextCharFormat::AlignSubScript);
 +    }
     readNext();
     READ_EPILOGUE
 }
--- trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h \
#1197257:1197258 @@ -1353,7 +1353,7 @@
  - [done] br (Text Line Break)  §21.1.2.2.1
  - endParaRPr (End Paragraph Run Properties)  §21.1.2.2.3
  - [done] fld (Text Field)  §21.1.2.2.4
- - pPr (Text Paragraph Properties)  §21.1.2.2.7
+ - [done] pPr (Text Paragraph Properties)  §21.1.2.2.7
  - [done] r (Text Run)  §21.1.2.3.8
 */
 //! @todo support all elements
@@ -2037,19 +2037,17 @@
     Effects on an object are not included in this bounding box.
 
  Parent elements:
-    - xfrm ( §21.3.2.28)
-    - xfrm ( §20.1.7.5)
+    - [done] xfrm ( §21.3.2.28)
+    - [done] xfrm ( §20.1.7.5)
     - [done] xfrm ( §20.1.7.6)
-    - xfrm ( §20.5.2.36)
-    - xfrm ( §19.3.1.53)
+    - [done] xfrm ( §20.5.2.36)
+    - [done] xfrm ( §19.3.1.53)
 
  No child elements.
 
  Attributes:
     - [done] x (X-Axis Coordinate)
-    - [done] y (Y-Axis Coordinate)
-*/
-//! @todo support all elements
+    - [done] y (Y-Axis Coordinate) */ //! @todo support all elements
 #undef CURRENT_EL
 #define CURRENT_EL off
 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_off()
@@ -2073,11 +2071,7 @@
         }
     }
 
-    while (true) {
         readNext();
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
-
     READ_EPILOGUE
 }
 
@@ -2095,12 +2089,7 @@
     READ_ATTR_WITHOUT_NS(y)
     STRING_TO_INT(y, m_svgChY, "chOff@y")
 
-
-    while (true) {
         readNext();
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
-
     READ_EPILOGUE
 }
 
@@ -2108,20 +2097,19 @@
 //! DrawingML ECMA-376, 20.1.7.3, p. 3185.
 /*! This element specifies the size of the bounding box enclosing the referenced \
object.  Parent elements:
- - xfrm ( §21.3.2.28)
- - xfrm ( §20.1.7.5)
+ - [done] xfrm ( §21.3.2.28)
+ - [done] xfrm ( §20.1.7.5)
  - [done] xfrm ( §20.1.7.6)
- - xfrm ( §20.5.2.36)
- - xfrm ( §19.3.1.53)
+ - [done] xfrm ( §20.5.2.36)
+ - [done] xfrm ( §19.3.1.53)
 
  No child elements.
 
  Attributes:
- - cx (Extent Length) Specifies the length of the extents rectangle in EMUs. This \
rectangle shall dictate + - [done] cx (Extent Length) Specifies the length of the \
                extents rectangle in EMUs. This rectangle shall dictate
       the size of the object as displayed (the result of any scaling to the original \
                object).
- - cy (Extent Width) Specifies the width of the extents rectangle in EMUs.
+ - [done] cy (Extent Width) Specifies the width of the extents rectangle in EMUs.
 */
-//! @todo support all child elements
 #undef CURRENT_EL
 #define CURRENT_EL ext
 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_ext()
@@ -2146,11 +2134,7 @@
         }
     }
 
-    while (true) {
         readNext();
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
-
     READ_EPILOGUE
 }
 
@@ -2168,10 +2152,7 @@
     READ_ATTR_WITHOUT_NS(cy)
     STRING_TO_INT(cy, m_svgChHeight, "chExt@cy")
 
-    while (true) {
         readNext();
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
 
     READ_EPILOGUE
 }
@@ -2415,11 +2396,11 @@
  is tiled across the bounding box to fill the entire area.
 
  Parent elements:
- - blipFill ( §21.3.2.2)
- - blipFill ( §20.1.8.14)
- - blipFill ( §20.2.2.1)
- - blipFill ( §20.5.2.2)
- - blipFill ( §19.3.1.4)
+ - [done] blipFill ( §21.3.2.2)
+ - [done] blipFill ( §20.1.8.14)
+ - [done] blipFill ( §20.2.2.1)
+ - [done] blipFill ( §20.5.2.2)
+ - [done] blipFill ( §19.3.1.4)
 
  No child elements.
 */
@@ -2438,10 +2419,7 @@
 //! @todo tx
 //! @todo ty
 
-    while (!atEnd()) {
         readNext();
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
     READ_EPILOGUE
 }
 
@@ -2479,11 +2457,8 @@
 //MSOOXML_EXPORT qreal ST_Percentage_withMsooxmlFix_to_double(const QString& val, \
bool& ok);  
     //m_fillImageRenderingStyle = QLatin1String("stretch");
-    while (!atEnd()) {
+
         readNext();
-        kDebug() << *this;
-        BREAK_IF_END_OF(CURRENT_EL);
-    }
     READ_EPILOGUE
 }
 
@@ -2500,10 +2475,10 @@
 
  Parent elements:
  - [done] anchor ( §20.4.2.3)
- - graphicFrame ( §21.3.2.12)
- - graphicFrame ( §20.1.2.2.18)
- - graphicFrame ( §20.5.2.16)
- - graphicFrame ( §19.3.1.21)
+ - [done] graphicFrame ( §21.3.2.12)
+ - [done] graphicFrame ( §20.1.2.2.18)
+ - [done] graphicFrame ( §20.5.2.16)
+ - [done] graphicFrame ( §19.3.1.21)
  - [done] inline ( §20.4.2.8)
 
  Child elements:
@@ -4375,7 +4350,6 @@
     }
 
     readNext();
-
     READ_EPILOGUE
 }
 
@@ -5067,7 +5041,7 @@
 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_spAutoFit()
 {
     READ_PROLOGUE
-    skipCurrentElement();
+    readNext();
     READ_EPILOGUE
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic