From d0efd878dc41e3913a2d91ff4b5c335c1d71a85c Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Wed, 23 Sep 2020 23:28:30 +0200 Subject: fix Graphic duplication in import and add GraphicMapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When importing writerfilter, we change to oox when importing images. This transition doesn't store any previous contexts and all instances are reset. The problem occurs when we have identical images because the transition erases all caches we have to determine if an image has already been imported or not, which causes that we import the same image multiple times which create unnecessary copies. This introduces the XGraphicMapper, which can be used to store the XGraphic for a key and can be transferred between writerfilter to oox. With this we can remember which images were already imported and don't create unnecessary internal copies which decreases memory. This also includes a test which checks that the import and export doesn't produce unnecessary copies of identical images. The test checks that for OOXML, ODF and MS Binary formats. Change-Id: I33dc19218c565937fab77e132b3a996c51358b6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103283 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/Library_vcl.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'vcl/Library_vcl.mk') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index ac63bb3606b7..ee68260fbd50 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -330,6 +330,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/graphic/grfattr \ vcl/source/graphic/Manager \ vcl/source/graphic/UnoGraphic \ + vcl/source/graphic/UnoGraphicMapper \ vcl/source/graphic/UnoGraphicDescriptor \ vcl/source/graphic/UnoGraphicObject \ vcl/source/graphic/UnoGraphicProvider \ -- cgit