diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-03-08 09:07:24 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-03-08 09:04:54 +0000 |
commit | b27b250f70f4651d387ef0646a9668950371e779 (patch) | |
tree | e7bb7cbf65923e6428fd6062185c9df89aeea3d2 | |
parent | df28c5ac2d4883706556772462933f70151fa379 (diff) |
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 <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | include/oox/export/drawingml.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 3 |
2 files changed, 2 insertions, 2 deletions
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 |