diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-02-24 23:38:40 +0100 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2020-02-26 11:57:07 +0100 |
commit | bb1d0511ff4f6a3f1c5019472eb04550e0745557 (patch) | |
tree | 6995b5c1266f00e1674e26e20a82168a98b19ad3 /xmlscript | |
parent | c38e37606d71cfbefa9d9c9eb92b7a8b28f6ebea (diff) |
tdf#130793 Fix import/export of image URLs
Change-Id: I329af3b0d5a81d9f31def9c2ad861d0e83e3714c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89440
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 4 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index eca2feb26fa0..e3141cf60b57 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -742,7 +742,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; } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 50b86b5f601e..c52c23f05210 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -882,6 +882,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; } |