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>
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index cf13219..a40d47e 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -137,7 +137,6 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper<
rtl::Reference<SvXMLAttributeList> mxAttrList; // a common attribute list
OUString msOrigFileName; // the original URL
OUString msEmbeddedObjectProtocol;
OUString msFilterName;
OUString msImgFilterName;
std::unique_ptr<SvXMLNamespaceMap> mpNamespaceMap; // the namepspace map
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index 7074b49..10fb40b 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -61,7 +61,7 @@ using namespace ::com::sun::star::lang;
#define XML_CONTAINERSTORAGE_NAME_60 "Pictures"
#define XML_CONTAINERSTORAGE_NAME "ObjectReplacements"
#define XML_EMBEDDEDOBJECT_URL_BASE "vnd.sun.star.EmbeddedObject:"
#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE "vnd.sun.star.GraphicObject:"
#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE "vnd.sun.star.GraphicObject:"
class OutputStorageWrapper_Impl : public ::cppu::WeakImplHelper<XOutputStream>
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index c0be7c8..f76e7b6 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() )