tdf#130793 Fix import/export of image URLs

Change-Id: I329af3b0d5a81d9f31def9c2ad861d0e83e3714c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89388
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
Samuel Mehrbrodt 2020-02-24 23:38:40 +01:00
parent 49eb4906de
commit 6d9cf22b22
2 changed files with 14 additions and 1 deletions

View file

@ -738,7 +738,9 @@ void ElementDescriptor::readImageOrGraphicAttr(OUString const & rAttrName)
}
}
}
else if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState("ImageURL"))
// tdf#130793 Above fails if the dialog is not part of a document. Export the ImageURL then.
if (sURL.isEmpty()
&& beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState("ImageURL"))
{
_xProps->getPropertyValue("ImageURL") >>= sURL;
}

View file

@ -880,6 +880,17 @@ bool ImportContext::importGraphicOrImageProperty(
return true;
}
}
else if (!sURL.isEmpty())
{
// tdf#130793 Above fails if the dialog is not part of a document.
// In this case we need to set the ImageURL.
Reference<beans::XPropertySet> xProps = getControlModel();
if (xProps.is())
{
xProps->setPropertyValue("ImageURL", makeAny(sURL));
return true;
}
}
}
return false;
}