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

Michael Stahl mstahl at redhat.com
Tue Dec 15 13:49:30 PST 2015


 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx    |    4 ++--
 sw/source/filter/ww8/docxattributeoutput.cxx |    6 +++---
 sw/source/filter/ww8/docxattributeoutput.hxx |    2 ++
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit c56e0858b081b4dfe78745cf80c829f6c3c2e7b8
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Dec 15 22:45:41 2015 +0100

    sw: DOCX export: eliminate chart numbering non-determinism
    
    ... that was causing test failures on some but not all platforms.
    
    Change-Id: I0d04cd6e540ea2693a3ec8511d615a9b0fecf456

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index a4503a3..041e54b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -828,13 +828,13 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeXLSM, "fdo76098.docx")
     assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "ContentType", "application/vnd.ms-excel.sheet.macroEnabled.12");
 
     // check the rels too
-    xmlDocPtr pXmlDocRels = parseExport("word/charts/_rels/chart2.xml.rels");
+    xmlDocPtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels");
     assertXPath(pXmlDocRels,
         "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']",
         "Type",
         "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
     // check the content too
-    xmlDocPtr pXmlDocChart1 = parseExport("word/charts/chart2.xml");
+    xmlDocPtr pXmlDocChart1 = parseExport("word/charts/chart1.xml");
     assertXPath(pXmlDocChart1,
         "/c:chartSpace/c:externalData",
         "id",
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index d65d9db..2b9fded 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4488,10 +4488,9 @@ void DocxAttributeOutput::WritePostponedChart()
             FSEND );
 
         OString aRelId;
-        static sal_Int32 nChartCount = 0;
-        nChartCount++;
+        m_nChartCount++;
         uno::Reference< frame::XModel > xModel( xChartDoc, uno::UNO_QUERY );
-        aRelId = m_rExport.OutputChart( xModel, nChartCount, m_pSerializer );
+        aRelId = m_rExport.OutputChart( xModel, m_nChartCount, m_pSerializer );
 
         m_pSerializer->singleElementNS( XML_c, XML_chart,
             FSNS( XML_xmlns, XML_c ), "http://schemas.openxmlformats.org/drawingml/2006/chart",
@@ -8432,6 +8431,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
       m_startedHyperlink( false ),
       m_nHyperLinkCount(0),
       m_nFieldsInHyperlink( 0 ),
+      m_nChartCount(0),
       m_postponedChart( nullptr ),
       pendingPlaceholder( nullptr ),
       m_postitFieldsMaxId( 0 ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 73abf82..d046ffb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -862,6 +862,8 @@ private:
     std::unique_ptr< std::list<PostponedOLE> > m_pPostponedOLEs;
 
     std::vector<const SwOLENode*> m_aPostponedMaths;
+    /// count charts consistently for unit tests
+    unsigned int m_nChartCount;
     const SdrObject* m_postponedChart;
     Size m_postponedChartSize;
     std::vector<const SdrObject*> m_aPostponedFormControls;


More information about the Libreoffice-commits mailing list