[Libreoffice-commits] core.git: 6 commits - include/oox oox/source sw/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sat Mar 8 05:36:36 PST 2014


 include/oox/export/utils.hxx                 |   12 ++++++------
 oox/source/export/chartexport.cxx            |    2 ++
 oox/source/export/drawingml.cxx              |    9 +++++----
 oox/source/helper/propertymap.cxx            |    1 -
 sw/source/filter/ww8/docxattributeoutput.cxx |   10 +++++-----
 5 files changed, 18 insertions(+), 16 deletions(-)

New commits:
commit 6b34a4cbcc7e8b9cd118b55c6ca77a1f61049f5f
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 14:22:11 2014 +0100

    fix OOXML validation error
    
    Change-Id: Ib87eadad99285e19d73f4de58690de501084293c

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 70445d1..980f4fb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4031,12 +4031,12 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
         m_pSerializer->singleElementNS(XML_w, XML_uiPriority,
                 FSNS(XML_w, XML_val), OUStringToOString(aUiPriority, RTL_TEXTENCODING_UTF8).getStr(),
                 FSEND);
-    if (bQFormat)
-        m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND);
     if (bSemiHidden)
         m_pSerializer->singleElementNS(XML_w, XML_semiHidden, FSEND);
     if (bUnhideWhenUsed)
         m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND);
+    if (bQFormat)
+        m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND);
     if (bLocked)
         m_pSerializer->singleElementNS(XML_w, XML_locked, FSEND);
     if (!aRsid.isEmpty())
commit 381613916d42a1e18e2824b5d41028dcfe19659a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 14:21:26 2014 +0100

    fix OOXML validaition error
    
    Change-Id: I26e063cd1971d980583e884ca2f4e0ba9d9391ad

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f51d892..70445d1 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4024,6 +4024,9 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
                 FSNS(XML_w, XML_val), OUStringToOString(aLink, RTL_TEXTENCODING_UTF8).getStr(),
                 FSEND);
 
+    if ( bAutoUpdate )
+        m_pSerializer->singleElementNS( XML_w, XML_autoRedefine, FSEND );
+
     if (!aUiPriority.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_uiPriority,
                 FSNS(XML_w, XML_val), OUStringToOString(aUiPriority, RTL_TEXTENCODING_UTF8).getStr(),
@@ -4040,9 +4043,6 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
         m_pSerializer->singleElementNS(XML_w, XML_rsid,
                 FSNS(XML_w, XML_val), OUStringToOString(aRsid, RTL_TEXTENCODING_UTF8).getStr(),
                 FSEND);
-
-    if ( bAutoUpdate )
-        m_pSerializer->singleElementNS( XML_w, XML_autoRedefine, FSEND );
 }
 
 void DocxAttributeOutput::EndStyle()
commit a2a40409e28e7db7d2341396401072a3f912d29a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 13:48:44 2014 +0100

    remove one more debug output
    
    Change-Id: Ib4b94d2a7e429721299fd07db4bd7a97c7773c0d

diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index a06afd9..5a153be 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -222,7 +222,6 @@ bool PropertyMap::empty() const
 
 void PropertyMap::assignUsed( const PropertyMap& rPropMap )
 {
-    SAL_WARN_IF(rPropMap.maProperties.size() > maProperties.size(), "oox", "too many properties");
     maProperties.insert(rPropMap.maProperties.begin(), rPropMap.maProperties.end());
 }
 
commit 79ed9ebb6ed64a10928ad3a10924708c312703a3
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 13:32:23 2014 +0100

    fix OOXML validation error, related fdo#36731
    
    Missing elements for gradient fill background export.
    
    Change-Id: Ib3ed3b5e353d3b02dffa5c118e14fd2187bd924a

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 9f8df56..b912bcf 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1218,7 +1218,9 @@ void ChartExport::exportGradientFill( Reference< XPropertySet > xPropSet )
             uno::Any rValue = xGradient->getByName( sFillGradientName );
             if( (rValue >>= aGradient) )
             {
+                mpFS->startElementNS( XML_a, XML_gradFill, FSEND );
                 WriteGradientFill( aGradient );
+                mpFS->endElementNS( XML_a, XML_gradFill );
             }
         }
         catch (const uno::Exception & rEx)
commit b1fbb1513a4d183e3194965c1a60feca56dc90bb
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 13:01:53 2014 +0100

    fix OOXML validation error, related fdo#42698
    
    Missing percentage sign in type. The values of XML_d and XML_sp seem
    insane.
    
    Change-Id: If6762ed70d3536c0eeea3ee687991dad60f5e71e

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index f825989..06ddfe3 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -48,6 +48,12 @@ static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
     return sal_Int64( nTwips ) * 635;
 }
 
+template <typename T>
+OString writePercentage(T number)
+{
+    return OString::number(number) + "%";
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index cf25f2a..5f869ee 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -620,17 +620,18 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet )
 
     if( bDashSet && aStyleLineStyle != drawing::LineStyle_DASH ) {
         // line style is a dash and it was not set by the shape style
+        // TODO: the XML_d and XML_sp values seem insane
         mpFS->startElementNS( XML_a, XML_custDash, FSEND );
         int i;
         for( i = 0; i < aLineDash.Dots; i ++ )
             mpFS->singleElementNS( XML_a, XML_ds,
-                                   XML_d, aLineDash.DotLen ? I64S( aLineDash.DotLen*1000 ) : "100000",
-                                   XML_sp, I64S( aLineDash.Distance*1000 ),
+                                   XML_d, aLineDash.DotLen ? writePercentage( aLineDash.DotLen*1000 ) : "100000%",
+                                   XML_sp, writePercentage( aLineDash.Distance*1000 ),
                                    FSEND );
         for( i = 0; i < aLineDash.Dashes; i ++ )
             mpFS->singleElementNS( XML_a, XML_ds,
-                                   XML_d, aLineDash.DashLen ? I64S( aLineDash.DashLen*1000 ) : "100000",
-                                   XML_sp, I64S( aLineDash.Distance*1000 ),
+                                   XML_d, aLineDash.DashLen ? writePercentage( aLineDash.DashLen*1000 ) : "100000%",
+                                   XML_sp, writePercentage( aLineDash.Distance*1000 ),
                                    FSEND );
         mpFS->endElementNS( XML_a, XML_custDash );
     }
commit 1ca73256f99fcc60330463eb7753c20df389e551
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 12:54:55 2014 +0100

    remove whitespaces
    
    Change-Id: I7937b154d0417876634711224ed5678eefa2654d

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index 186d50a..f825989 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -33,22 +33,16 @@
 #  endif
 #endif
 
-
-
 static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
 {
     return (sal_Int64)( (double)nPPT * 1587.5 );
 }
 
-
-
 static inline sal_Int64 MM100toEMU( sal_Int32 nMM100 )
 {
     return (sal_Int64)nMM100 * 360;
 }
 
-
-
 static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
 {
     return sal_Int64( nTwips ) * 635;


More information about the Libreoffice-commits mailing list