summaryrefslogtreecommitdiff
path: root/vcl/vcl.common.component
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-09-23 23:28:30 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-09-25 12:01:07 +0200
commitd0efd878dc41e3913a2d91ff4b5c335c1d71a85c (patch)
tree11eec3a4e334cec5f8739e99f3bd991a1ea2f80d /vcl/vcl.common.component
parent40c731726b583cdb3a8884e90f17637f35aa3ef8 (diff)
fix Graphic duplication in import and add GraphicMapper
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 <quikee@gmail.com>
Diffstat (limited to 'vcl/vcl.common.component')
-rw-r--r--vcl/vcl.common.component4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/vcl.common.component b/vcl/vcl.common.component
index a884f6bd8c2e..2665a136afcc 100644
--- a/vcl/vcl.common.component
+++ b/vcl/vcl.common.component
@@ -27,6 +27,10 @@
constructor="com_sun_star_graphic_GraphicObject_get_implementation">
<service name="com.sun.star.graphic.GraphicObject"/>
</implementation>
+ <implementation name="com.sun.star.comp.graphic.GraphicMapper"
+ constructor="com_sun_star_comp_graphic_GraphicMapper_get_implementation">
+ <service name="com.sun.star.graphic.GraphicMapper"/>
+ </implementation>
<implementation name="com.sun.star.datatransfer.MimeCntTypeFactory"
constructor="dtrans_CMimeContentTypeFactory_get_implementation">
<service name="com.sun.star.datatransfer.MimeContentTypeFactory"/>