summaryrefslogtreecommitdiff
path: root/include/oox
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 /include/oox
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 'include/oox')
-rw-r--r--include/oox/export/drawingml.hxx8
-rw-r--r--include/oox/export/vmlexport.hxx6
2 files changed, 9 insertions, 5 deletions
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 2cd17e6defb0..cfcad30fa257 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -125,8 +125,10 @@ public:
virtual void WriteTextBox(css::uno::Reference<css::drawing::XShape> xShape) = 0;
/// Look up the RelId of a graphic based on its checksum.
virtual OUString FindRelId(BitmapChecksum nChecksum) = 0;
- /// Store the RelId of a graphic based on its checksum.
- virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId) = 0;
+ /// Look up the filename of a graphic based on its checksum.
+ virtual OUString FindFileName(BitmapChecksum nChecksum) = 0;
+ /// Store the RelId and filename of a graphic based on its checksum.
+ virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId, const OUString& rFileName) = 0;
/// Get textbox which belongs to the shape.
virtual css::uno::Reference<css::text::XTextFrame> GetUnoTextFrame(
css::uno::Reference<css::drawing::XShape> xShape) = 0;
@@ -192,7 +194,7 @@ public:
void SetBackgroundDark(bool bIsDark) { mbIsBackgroundDark = bIsDark; }
/// If bRelPathToMedia is true add "../" to image folder path while adding the image relationship
- OUString WriteImage( const Graphic &rGraphic , bool bRelPathToMedia = false);
+ OUString WriteImage( const Graphic &rGraphic , bool bRelPathToMedia = false, OUString* pFileName = nullptr );
void WriteColor( ::Color nColor, sal_Int32 nAlpha = MAX_PERCENT );
void WriteColor( const OUString& sColorSchemeName, const css::uno::Sequence< css::beans::PropertyValue >& aTransformations, sal_Int32 nAlpha = MAX_PERCENT );
diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
index dd5edc57c208..9a53a07652c8 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -67,8 +67,10 @@ public:
virtual void WriteVMLTextBox(css::uno::Reference<css::drawing::XShape> xShape) = 0;
/// Look up the RelId of a graphic based on its checksum.
virtual OUString FindRelId(BitmapChecksum nChecksum) = 0;
- /// Store the RelId of a graphic based on its checksum.
- virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId) = 0;
+ /// Look up the filename of a graphic based on its checksum.
+ virtual OUString FindFileName(BitmapChecksum nChecksum) = 0;
+ /// Store the RelId and filename of a graphic based on its checksum.
+ virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId, const OUString& rFileName) = 0;
protected:
VMLTextExport() {}
virtual ~VMLTextExport() {}