include/oox/export/drawingml.hxx    |    1 +
 sc/source/filter/excel/xeescher.cxx |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b27b250f70f4651d387ef0646a9668950371e779
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Mar 8 09:07:24 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Mar 8 09:04:54 2023 +0000

    sc: fix ever-increasing chart IDs when exporting to XLSX
    
    Similar to what PPTX already did.
    
    Change-Id: I17d8ccf3fb7111e1cbf9dc019d1032ed7ed530fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148460
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 5dc243e8536c..59c9ace37113 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -365,6 +365,7 @@ public:
 
     static sal_Int32 getNewDrawingUniqueId() { return ++mnDrawingMLCount; }
     static sal_Int32 getNewVMLUniqueId() { return ++mnVmlCount; }
+    static sal_Int32 getNewChartUniqueId() { return ++mnChartCount; }
 
     // A Helper to decide the script type for given text in order to call 
WriteRunProperties.
     static sal_Int16 GetScriptType(const OUString& rStr);
diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 4e9491cc94c3..44e1225cf17c 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1604,8 +1604,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
         ChartExport aChartExport(XML_xdr, pDrawing, GetChartDoc(), &rStrm, 
drawingml::DOCUMENT_XLSX);
         auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
         aChartExport.SetURLTranslator(pURLTransformer);
-        static sal_Int32 nChartCount = 0;
-        nChartCount++;
+        sal_Int32 nChartCount = 
oox::drawingml::DrawingML::getNewChartUniqueId();
         sal_Int32 nID = rStrm.GetUniqueId();
         aChartExport.WriteChartObj( mxShape, nID, nChartCount );
         // TODO: get the correcto chart number

Reply via email to