summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxexport.cxx
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 /sw/source/filter/ww8/docxexport.cxx
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 'sw/source/filter/ww8/docxexport.cxx')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 2fdcadce6dd9..59b91603acc1 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -526,8 +526,10 @@ ErrCode DocxExport::ExportDocument_Impl()
// init sections
m_pSections.reset(new MSWordSections( *this ));
+ auto& rGraphicExportCache = oox::drawingml::GraphicExportCache::get();
+
// Make sure images are counted from one, even when exporting multiple documents.
- oox::drawingml::DrawingML::PushExportGraphics();
+ rGraphicExportCache.push();
WriteMainText();
@@ -555,7 +557,8 @@ ErrCode DocxExport::ExportDocument_Impl()
m_aLinkedTextboxesHelper.clear(); //final cleanup
m_pStyles.reset();
m_pSections.reset();
- oox::drawingml::DrawingML::PopExportGraphics();
+
+ rGraphicExportCache.pop();
return ERRCODE_NONE;
}