summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-04-10 12:15:19 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-04-24 23:50:05 +0200
commit0ee38e7e061f764b5e21487da090620ed93bb260 (patch)
tree14c45da93984fa22cf14feb7c11a2850fe18daab /sc
parentc3f7720ff13c34b9cf2c90d9c9b6dcc3d8f4c7a5 (diff)
oox: combine graphic cache into GraphicExportCache class
We cache graphics to not export the same graphic multiple times if this can be avoided. The cache was integrated into DrawingML but we need access to it in different places, so this change extracts it into its own class. Change-Id: I71e3b67906f2948ca00c2ef7ca857bf80ab6a737 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150258 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xestream.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 75f03dfde94d..8d31023e4a57 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1026,7 +1026,10 @@ bool XclExpXmlStream::exportDocument()
// Instead, write via XOutputStream instance.
tools::SvRef<SotStorage> rStorage = static_cast<SotStorage*>(nullptr);
drawingml::DrawingML::ResetMlCounters();
- drawingml::DrawingML::PushExportGraphics();
+
+ auto& rGraphicExportCache = drawingml::GraphicExportCache::get();
+
+ rGraphicExportCache.push();
XclExpRootData aData(
EXC_BIFF8, *pShell->GetMedium (), rStorage, rDoc,
@@ -1145,7 +1148,7 @@ bool XclExpXmlStream::exportDocument()
xStatusIndicator->end();
mpRoot = nullptr;
- drawingml::DrawingML::PopExportGraphics();
+ rGraphicExportCache.pop();
return true;
}