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

List:       kde-commits
Subject:    branches/work/koffice-essen/filters/libmsooxml
From:       Sebastian Sauer <mail () dipe ! org>
Date:       2010-11-18 16:06:20
Message-ID: 20101118160620.6EC26AC8A0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1198475 by sebsauer:

use correct defaults for margin-left, margin-right and text-indent as defined in the OOXML specs

 M  +18 -24    MsooXmlCommonReaderDrawingMLImpl.h  


--- branches/work/koffice-essen/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h #1198474:1198475
@@ -1922,18 +1922,15 @@
 
     bool ok = false;
 
-    if (!marL.isEmpty()) {
-        const qreal marginal = qreal(EMU_TO_POINT(marL.toDouble(&ok)));
-        m_currentParagraphStyle.addPropertyPt("fo:margin-left", marginal);
-    }
-    if (!marR.isEmpty()) {
-        const qreal marginal = qreal(EMU_TO_POINT(marR.toDouble(&ok)));
-        m_currentParagraphStyle.addPropertyPt("fo:margin-right", marginal);
-    }
-    if (!indent.isEmpty()) {
-        const qreal firstInd = qreal(EMU_TO_POINT(indent.toDouble(&ok)));
-        m_currentParagraphStyle.addPropertyPt("fo:text-indent", firstInd);
-    }
+    const qreal marginLeft = qreal(EMU_TO_POINT(marL.isEmpty() ? 347663.0 : marL.toDouble(&ok)));
+    m_currentParagraphStyle.addPropertyPt("fo:margin-left", marginLeft);
+
+    const qreal marginRight = qreal(EMU_TO_POINT(marR.isEmpty() ? 0.0 : marR.toDouble(&ok)));
+    m_currentParagraphStyle.addPropertyPt("fo:margin-right", marginRight);
+
+    const qreal textIndent = qreal(EMU_TO_POINT(indent.isEmpty() ? -342900.0 : indent.toDouble(&ok)));
+    m_currentParagraphStyle.addPropertyPt("fo:text-indent", textIndent);
+
     if (!defTabSz.isEmpty()) {
         const qreal tabSize = qreal(EMU_TO_POINT(defTabSz.toDouble(&ok)));
         m_currentParagraphStyle.addPropertyPt("style:tab-stop-distance", tabSize);
@@ -3993,18 +3990,15 @@
 
     m_currentParagraphStyle = KoGenStyle(KoGenStyle::ParagraphAutoStyle, "text");
 
-    if (!marR.isEmpty()) {
-        const qreal marginal = qreal(EMU_TO_POINT(marR.toDouble(&ok)));
-        m_currentParagraphStyle.addPropertyPt("fo:margin-right", marginal);
-    }
-    if (!marL.isEmpty()) {
-        const qreal marginal = qreal(EMU_TO_POINT(marL.toDouble(&ok)));
-        m_currentParagraphStyle.addPropertyPt("fo:margin-left", marginal);
-    }
-    if (!indent.isEmpty()) {
-        const qreal firstInd = qreal(EMU_TO_POINT(indent.toDouble(&ok)));
-        m_currentParagraphStyle.addPropertyPt("fo:text-indent", firstInd);
-    }
+    const qreal marginLeft = qreal(EMU_TO_POINT(marL.isEmpty() ? 347663.0 : marL.toDouble(&ok)));
+    m_currentParagraphStyle.addPropertyPt("fo:margin-left", marginLeft);
+
+    const qreal marginRight = qreal(EMU_TO_POINT(marR.isEmpty() ? 0.0 : marR.toDouble(&ok)));
+    m_currentParagraphStyle.addPropertyPt("fo:margin-right", marginRight);
+
+    const qreal textIndent = qreal(EMU_TO_POINT(indent.isEmpty() ? -342900.0 : indent.toDouble(&ok)));
+    m_currentParagraphStyle.addPropertyPt("fo:text-indent", textIndent);
+    
     if (!defTabSz.isEmpty()) {
         const qreal tabSize = qreal(EMU_TO_POINT(defTabSz.toDouble(&ok)));
         m_currentParagraphStyle.addPropertyPt("style:tab-stop-distance", tabSize);
[prev in list] [next in list] [prev in thread] [next in thread] 

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