summaryrefslogtreecommitdiff
path: root/xmlscript/source
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-02-24 23:38:40 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-02-26 06:40:23 +0100
commit6d9cf22b2239611a6612a7855f8a701ed723cbd4 (patch)
tree775c2f3fed83fe404355db2e213565c39333ac10 /xmlscript/source
parent49eb4906de8f499ae14b789e90df9ba654895af5 (diff)
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>
Diffstat (limited to 'xmlscript/source')
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx4
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx11
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 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 791976b55c5e..5aa953cd6562 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;
}