[Libreoffice-commits] core.git: 4 commits - sw/qa sw/source

Jan Holesovsky kendy at collabora.com
Wed Oct 9 06:42:15 PDT 2013


 sw/qa/extras/ooxmlexport/ooxmlexport.cxx     |    5 ++++
 sw/source/filter/ww8/docxattributeoutput.cxx |   33 +++++++++++++--------------
 2 files changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 33e97347ac5b1a3206ddcc2c8313c7e88461bb0b
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 9 13:17:49 2013 +0200

    DOCX export: Write contextualSpacing only if it takes place.
    
    Change-Id: Ibc5783aeea8bcdc05c14054fa10c43a0c98c2159

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5cd7b31b..45bb751 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5512,8 +5512,6 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace )
                 OString::number( rULSpace.GetLower() ) );
         if (rULSpace.GetContext())
             m_pSerializer->singleElementNS( XML_w, XML_contextualSpacing, FSEND );
-        else
-            m_pSerializer->singleElementNS( XML_w, XML_contextualSpacing, FSNS( XML_w, XML_val ), "false", FSEND );
     }
 }
 
commit 0f646b9098511c2dd7e635d35a80056a9a47d37f
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 9 09:43:19 2013 +0200

    DOCX export: Enhance the style inheritance unit test for docDefaults.
    
    Change-Id: I839cbd6b3499f77867f993ece9f764db8f1c18c3

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index bf7af2e..0f8486d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1403,9 +1403,14 @@ void Test::testStyleInheritance()
     // w:ind was copied from the parent (Normal) style without a good reason.
     assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:pPr/w:ind", 0);
 
+    // We output exactly 2 properties in rPrDefault, nothing else was
+    // introduced as an additional default
+    assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 2);
     // Check that we output real content of rPrDefault
     assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "ascii", "Times New Roman");
     assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:lang", "bidi", "ar-SA");
+    // pPrDefault is empty
+    assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/*", 0);
 
     // Check latent styles
     uno::Sequence<beans::PropertyValue> aGrabBag = getProperty< uno::Sequence<beans::PropertyValue> >(mxComponent, "InteropGrabBag");
commit d4ee91e37b7aebbf85044d7dfd22896dd44071a4
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 9 09:35:24 2013 +0200

    DOCX export: Output the paragraph properties in docDefaults too.
    
    Change-Id: Ie5fc89d24cfff021e362811f3d2eed8608107767

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6aba872..5cd7b31b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -52,6 +52,7 @@
 #include <editeng/cmapitem.hxx>
 #include <editeng/udlnitem.hxx>
 #include <editeng/langitem.hxx>
+#include <editeng/lspcitem.hxx>
 #include <editeng/escapementitem.hxx>
 #include <editeng/fhgtitem.hxx>
 #include <editeng/colritem.hxx>
@@ -2582,40 +2583,40 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt)
             break;
 
         case RES_PARATR_LINESPACING:
-            //FIXME ParaLineSpacing( static_cast< const SvxLineSpacingItem& >( rHt ) );
+            bMustWrite = static_cast< const SvxLineSpacingItem& >(rHt).GetInterLineSpaceRule() != SVX_INTER_LINE_SPACE_OFF;
             break;
         case RES_PARATR_ADJUST:
-            //FIXME ParaAdjust( static_cast< const SvxAdjustItem& >( rHt ) );
+            bMustWrite = static_cast< const SvxAdjustItem& >(rHt).GetAdjust() != SVX_ADJUST_LEFT;
             break;
         case RES_PARATR_SPLIT:
-            //FIXME ParaSplit( static_cast< const SvxFmtSplitItem& >( rHt ) );
+            bMustWrite = !static_cast< const SvxFmtSplitItem& >(rHt).GetValue();
             break;
         case RES_PARATR_WIDOWS:
-            //FIXME ParaWidows( static_cast< const SvxWidowsItem& >( rHt ) );
+            bMustWrite = static_cast< const SvxWidowsItem& >(rHt).GetValue();
             break;
         case RES_PARATR_TABSTOP:
-            //FIXME ParaTabStop( static_cast< const SvxTabStopItem& >( rHt ) );
+            bMustWrite = static_cast< const SvxTabStopItem& >(rHt).Count() != 0;
             break;
         case RES_PARATR_HYPHENZONE:
-            //FIXME ParaHyphenZone( static_cast< const SvxHyphenZoneItem& >( rHt ) );
+            bMustWrite = static_cast< const SvxHyphenZoneItem& >(rHt).IsHyphen();
             break;
         case RES_PARATR_NUMRULE:
-            //FIXME ParaNumRule( static_cast< const SwNumRuleItem& >( rHt ) );
+            bMustWrite = !static_cast< const SwNumRuleItem& >(rHt).GetValue().isEmpty();
             break;
         case RES_PARATR_SCRIPTSPACE:
-            //FIXME ParaScriptSpace( static_cast< const SfxBoolItem& >( rHt ) );
+            bMustWrite = !static_cast< const SfxBoolItem& >(rHt).GetValue();
             break;
         case RES_PARATR_HANGINGPUNCTUATION:
-            //FIXME ParaHangingPunctuation( static_cast< const SfxBoolItem& >( rHt ) );
+            bMustWrite = !static_cast< const SfxBoolItem& >(rHt).GetValue();
             break;
         case RES_PARATR_FORBIDDEN_RULES:
-            //FIXME ParaForbiddenRules( static_cast< const SfxBoolItem& >( rHt ) );
+            bMustWrite = !static_cast< const SfxBoolItem& >(rHt).GetValue();
             break;
         case RES_PARATR_VERTALIGN:
-            //FIXME ParaVerticalAlign( static_cast< const SvxParaVertAlignItem& >( rHt ) );
+            bMustWrite = static_cast< const SvxParaVertAlignItem& >(rHt).GetValue() != SvxParaVertAlignItem::AUTOMATIC;
             break;
         case RES_PARATR_SNAPTOGRID:
-            //FIXME ParaSnapToGrid( static_cast< const SvxParaGridItem& >( rHt ) );
+            bMustWrite = !static_cast< const SvxParaGridItem& >(rHt).GetValue();
             break;
 
         default:
@@ -2647,14 +2648,12 @@ void DocxAttributeOutput::DocDefaults( )
     // Output the default paragraph properties
     m_pSerializer->startElementNS(XML_w, XML_pPrDefault, FSEND);
 
-    /* TODO Paragraph properties still need work.
     StartStyleProperties(true, 0);
 
     for (int i = int(RES_PARATR_BEGIN); i < int(RES_PARATR_END); ++i)
         OutputDefaultItem(m_rExport.pDoc->GetDefault(i));
 
     EndStyleProperties(true);
-    */
 
     m_pSerializer->endElementNS(XML_w, XML_pPrDefault);
 
commit b7e0d49dcd757fde9a634246a6b3ce46d6f75e79
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 9 07:56:22 2013 +0200

    Improve readability.
    
    Change-Id: I7527acd4b99b3b2a911532adb85b2a082c6569b7

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 369d167..6aba872 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5149,10 +5149,12 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
     {
         case SVX_ADJUST_LEFT:
             if ( bEcma )
+            {
                 if ( bRtl )
                     pAdjustString = "right";
                 else
                     pAdjustString = "left";
+            }
             else if ( bRtl )
                 pAdjustString = "end";
             else
@@ -5160,10 +5162,12 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
             break;
         case SVX_ADJUST_RIGHT:
             if ( bEcma )
+            {
                 if ( bRtl )
                     pAdjustString = "left";
                 else
                     pAdjustString = "right";
+            }
             else if ( bRtl )
                 pAdjustString = "start";
             else


More information about the Libreoffice-commits mailing list