summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-19 21:03:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-20 09:02:25 +0200
commit96baf8c69330d50af7d31ab9838bcd0ec7c8c50b (patch)
tree29fd0fb8a791d3bd9aabf3524ec20ce562215eca /xmloff/source/style
parent1854f1ddf6ffaddff92d3209f15b68a53f91d2b1 (diff)
tdf#130479 FODG import: fix handling of <draw:fill-image> in styles
Regression from the image handling rework, the problem was that the old, URL-based code had explicit handling of mxBase64Stream, while the new, XGraphic-based code assumed that by the time we reach the end of of the bitmap style element, maAny already contains the graphic. Fix the problem by improving XMLBitmapStyleContext::EndElement(), so it loads the graphic from the base64 stream if we don't have a graphic already. Change-Id: I6d90f1470a5b797fb51789901081ccd7a6fd29e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94548 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/FillStyleContext.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx
index bc81cd92d5da..1bec46869b39 100644
--- a/xmloff/source/style/FillStyleContext.cxx
+++ b/xmloff/source/style/FillStyleContext.cxx
@@ -154,6 +154,16 @@ SvXMLImportContextRef XMLBitmapStyleContext::CreateChildContext( sal_uInt16 nPre
void XMLBitmapStyleContext::EndElement()
{
+ if (!maAny.has<uno::Reference<graphic::XGraphic>>() && mxBase64Stream.is())
+ {
+ // No graphic so far? Then see if it's inline.
+ uno::Reference<graphic::XGraphic> xGraphic = GetImport().loadGraphicFromBase64(mxBase64Stream);
+ if (xGraphic.is())
+ {
+ maAny <<= xGraphic;
+ }
+ }
+
if (maAny.has<uno::Reference<graphic::XGraphic>>())
{
uno::Reference<container::XNameContainer> xBitmapContainer(GetImport().GetBitmapHelper());