xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 4 +++- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
New commits: commit a563d4279e383de3f84379b6393188bcbcb64a95 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Mon Feb 24 23:38:40 2020 +0100 Commit: Xisco FaulĂ <[email protected]> CommitDate: Wed Feb 26 11:56:49 2020 +0100 tdf#130793 Fix import/export of image URLs Change-Id: I329af3b0d5a81d9f31def9c2ad861d0e83e3714c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89439 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ <[email protected]> diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 1e192e3c387d..413facd87652 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -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; } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index ee6a32f031b8..e3cf908f0186 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -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; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
