From 4ea605cb5c31fe4c7d3931a656782a652b4d96fc Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 10 Mar 2018 18:27:40 +0900 Subject: xmloff: embedded objects can still use GraphicObject URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tomaž Vajngerl --- xmloff/source/core/xmlexp.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'xmloff') 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 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() ) -- cgit