summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-03-08 08:04:09 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-03-08 08:06:59 +0000
commit269585d6b461b565fe75f77b6dbf219749edc5ab (patch)
tree4b495ccc449b20edbe3845ad6952a91f0d6db80d /oox
parentd704f57a3dc87302ba75ae0c2904ad46e734d027 (diff)
oox, sd: fix ever-increasing chart IDs when exporting to PPTX
Bring the static counter under the control of DrawingML::ResetMlCounters(), so the first chart is always chart1.xml, even if the same process already exported a chart previously. XLSX is a separate codepath, this fix doesn't help with that yet. Change-Id: Idf6e576ba94e254ae9782ef86e85542efd80127f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148457 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx2
-rw-r--r--oox/source/export/shapes.cxx3
2 files changed, 3 insertions, 2 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 26858cac40cf..5f2e1a7b4558 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -243,6 +243,7 @@ std::stack<sal_Int32> DrawingML::mnWdpImageCounter;
std::stack<std::map<OUString, OUString>> DrawingML::maWdpCache;
sal_Int32 DrawingML::mnDrawingMLCount = 0;
sal_Int32 DrawingML::mnVmlCount = 0;
+sal_Int32 DrawingML::mnChartCount = 0;
std::stack<std::unordered_map<BitmapChecksum, OUString>> DrawingML::maExportGraphics;
sal_Int16 DrawingML::GetScriptType(const OUString& rStr)
@@ -273,6 +274,7 @@ void DrawingML::ResetMlCounters()
{
mnDrawingMLCount = 0;
mnVmlCount = 0;
+ mnChartCount = 0;
}
void DrawingML::PushExportGraphics()
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 676d3f75c201..6993a7c9c304 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2520,8 +2520,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
// TODO: With Chart extracted this cannot really happen since
// no Chart could've been added at all
ChartExport aChartExport( mnXmlNamespace, GetFS(), xChartDoc, GetFB(), GetDocumentType() );
- static sal_Int32 nChartCount = 0;
- aChartExport.WriteChartObj( xShape, GetNewShapeID( xShape ), ++nChartCount );
+ aChartExport.WriteChartObj( xShape, GetNewShapeID( xShape ), ++mnChartCount );
#endif
return *this;
}