summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxattributeoutput.hxx
diff options
context:
space:
mode:
authorDaniel Arato (NISZ) <arato.daniel@nisz.hu>2021-03-09 14:11:11 +0100
committerLászló Németh <nemeth@numbertext.org>2021-03-26 13:07:57 +0100
commit797fef38612fb2fd62d1f6591619b9361e526bca (patch)
treec4dcbc713091d8a9596b4d60d3c9228bd6b1281a /sw/source/filter/ww8/docxattributeoutput.hxx
parent2f2475bb5da7f9fcc30ed35f8946932d69b11294 (diff)
tdf#118535 DOCX export: save header image once
Writer used to dump the same image file as many times as it was featured in different headers or footers in the document, bloating the .docx file size. This is countered by making all "relationships" in the header*.xml.rels files point to the same image. Change-Id: I44d72630289c721d58d8f7e208517df2f1fe621c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112656 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.hxx')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 423396196153..565741bd0afe 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -960,14 +960,14 @@ private:
// store hardcoded value which was set during import.
sal_Int32 m_nParaBeforeSpacing,m_nParaAfterSpacing;
- OString getExistingGraphicRelId(BitmapChecksum aChecksum);
- void cacheGraphicRelId(BitmapChecksum nChecksum, OString const & rRelId);
+ std::pair<OString, OUString> getExistingGraphicRelId(BitmapChecksum aChecksum);
+ void cacheGraphicRelId(BitmapChecksum nChecksum, OString const & rRelId, OUString const & rFileName);
/// RelId <-> Graphic* cache, so that in case of alternate content, the same graphic only gets written once.
- std::stack< std::map<BitmapChecksum, OString> > m_aRelIdCache;
+ std::stack< std::map<BitmapChecksum, std::pair<OString, OUString>> > m_aRelIdCache;
/// RelId <-> BitmapChecksum cache, similar to m_aRelIdCache, but used for non-Writer graphics, handled in oox.
- std::stack< std::map<BitmapChecksum, OUString> > m_aSdrRelIdCache;
+ std::stack< std::map<BitmapChecksum, std::pair<OUString, OUString>> > m_aSdrRelIdCache;
/// members to control the existence of grabbagged SDT properties in the paragraph
sal_Int32 m_nParagraphSdtPrToken;
@@ -1026,7 +1026,8 @@ public:
/// DMLTextExport
virtual void WriteTextBox(css::uno::Reference<css::drawing::XShape> xShape) override;
virtual OUString FindRelId(BitmapChecksum nChecksum) override;
- virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId) override;
+ virtual OUString FindFileName(BitmapChecksum nChecksum) override;
+ virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId, const OUString& rFileName) override;
virtual css::uno::Reference<css::text::XTextFrame> GetUnoTextFrame(
css::uno::Reference<css::drawing::XShape> xShape) override;
virtual oox::drawingml::DrawingML& GetDrawingML() override;