summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-03-10 18:27:40 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-03-10 17:51:00 +0100
commit4ea605cb5c31fe4c7d3931a656782a652b4d96fc (patch)
treef21778616f355b449fbc8b5c404c7f5892d8b285 /xmloff
parent80918a529bed72a06779fc59d9379be97cb8aca3 (diff)
xmloff: embedded objects can still use GraphicObject URL
The embedded graphic object don't seem to use the uniqueID of a graphic object, but seem to have the same URL prefix. Let's leave this in for now. Change-Id: I48d9ad2c3b1eca745911f03221988c46c0fdb8d2 Reviewed-on: https://gerrit.libreoffice.org/51041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlexp.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index c0be7c830a09..f76e7b677710 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -118,6 +118,9 @@ sal_Char const sXML_1_2[] = "1.2";
#define XML_USEPRETTYPRINTING "UsePrettyPrinting"
+#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE "vnd.sun.star.GraphicObject:"
+#define XML_EMBEDDEDOBJECT_URL_BASE "vnd.sun.star.EmbeddedObject:"
+
namespace {
struct XMLServiceMapEntry_Impl
@@ -396,8 +399,6 @@ void SvXMLExport::InitCtor_()
GetXMLToken(XML_NP_CSS3TEXT), GetXMLToken(XML_N_CSS3TEXT), XML_NAMESPACE_CSS3TEXT );
}
- msEmbeddedObjectProtocol = "vnd.sun.star.EmbeddedObject:";
-
if (mxModel.is() && !mxEventListener.is())
{
mxEventListener.set( new SvXMLExportEventListener(this));
@@ -1933,8 +1934,9 @@ bool SvXMLExport::AddEmbeddedXGraphicAsBase64(uno::Reference<graphic::XGraphic>
OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL )
{
OUString sRet;
- if (rEmbeddedObjectURL.startsWith(msEmbeddedObjectProtocol) &&
- mxEmbeddedResolver.is())
+ bool bSupportedURL = rEmbeddedObjectURL.startsWith(XML_EMBEDDEDOBJECT_URL_BASE) ||
+ rEmbeddedObjectURL.startsWith(XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE);
+ if (bSupportedURL && mxEmbeddedResolver.is())
{
sRet = mxEmbeddedResolver->resolveEmbeddedObjectURL(rEmbeddedObjectURL);
}
@@ -1947,8 +1949,9 @@ OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL )
bool SvXMLExport::AddEmbeddedObjectAsBase64( const OUString& rEmbeddedObjectURL )
{
bool bRet = false;
- if (rEmbeddedObjectURL.startsWith(msEmbeddedObjectProtocol) &&
- mxEmbeddedResolver.is())
+ bool bSupportedURL = rEmbeddedObjectURL.startsWith(XML_EMBEDDEDOBJECT_URL_BASE) ||
+ rEmbeddedObjectURL.startsWith(XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE);
+ if (bSupportedURL && mxEmbeddedResolver.is())
{
Reference < XNameAccess > xNA( mxEmbeddedResolver, UNO_QUERY );
if( xNA.is() )