diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-04-23 12:43:54 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-04-26 18:19:32 +0200 |
commit | 45f20a893a457a40604207382611afd2f8e4b635 (patch) | |
tree | 0604a60593c9b9037c8a8e8e3cd3573070dc394b /reportdesign | |
parent | e87ea03a0d595ed478f281a723a6889228babeb2 (diff) |
[API CHANGE] deprecate XGraphicObjectResolver
XGraphicObjectResolver was used to get the GraphicObject URL from
an storage (package) URL. This isn't possible anymore in LO 6.1
since creating GraphicObject from uniqueID was removed for its
lifecycle issues. XGraphicObjectResolver is now deprecated and
when the "resolveGraphicObjectURL" is called, it throws a
RuntimeExeption.
In places where XGraphicObjectResolver was used, we now use the
XGraphicStorageHandler as the alternative. Both share a common
implementation so previously we could cast one to the other at
any time. Now only XGraphicStorageHandler is used.
GraphicObjectResolver was removed and replaced by the alternative
GraphicStorageHandler for instance creation - where needed.
Change-Id: I5d3f759c6f95b7dbe2d93688d99c8aa4899ffa84
Reviewed-on: https://gerrit.libreoffice.org/53279
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 14 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 25 |
2 files changed, 20 insertions, 19 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 0df0186fee5b..f738292b7e24 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1340,14 +1340,14 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS aDelegatorArguments[nArgsLen++] <<= xInfoSet; uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; - uno::Reference< document::XGraphicObjectResolver > xGrfResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper = SvXMLGraphicHelper::Create(_xStorageToSaveTo,SvXMLGraphicHelperMode::Write); - xGrfResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); xGraphicHelper.clear(); xObjectResolver = SvXMLEmbeddedObjectHelper::Create( _xStorageToSaveTo,*this, SvXMLEmbeddedObjectHelperMode::Write ).get(); aDelegatorArguments.realloc(nArgsLen+2); - aDelegatorArguments[nArgsLen++] <<= xGrfResolver; + aDelegatorArguments[nArgsLen++] <<= xGraphicStorageHandler; aDelegatorArguments[nArgsLen++] <<= xObjectResolver; uno::Reference<XComponent> xCom(static_cast<OWeakObject*>(this),uno::UNO_QUERY); @@ -2133,13 +2133,13 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, SvXMLEmbeddedObjectHelperMode::Read ).get()); else if ( aServiceSpecifier == "com.sun.star.document.ExportEmbeddedObjectResolver" ) return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, SvXMLEmbeddedObjectHelperMode::Write ).get()); - else if ( aServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" ) + else if (aServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler") { rtl::Reference<SvXMLGraphicHelper> xGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,SvXMLGraphicHelperMode::Write); uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(xGraphicHelper.get())); return xRet; } - else if ( aServiceSpecifier == "com.sun.star.document.ExportGraphicObjectResolver" ) + else if (aServiceSpecifier == "com.sun.star.document.ExportGraphicStorageHandler") { rtl::Reference<SvXMLGraphicHelper> xGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,SvXMLGraphicHelperMode::Write); uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(xGraphicHelper.get())); @@ -2178,8 +2178,8 @@ uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableServiceNames() "com.sun.star.drawing.Defaults", "com.sun.star.document.ImportEmbeddedObjectResolver", "com.sun.star.document.ExportEmbeddedObjectResolver", - "com.sun.star.document.ImportGraphicObjectResolver", - "com.sun.star.document.ExportGraphicObjectResolver", + "com.sun.star.document.ImportGraphicStorageHandler", + "com.sun.star.document.ExportGraphicStorageHandler", "com.sun.star.chart2.data.DataProvider", "com.sun.star.xml.NamespaceMap", "com.sun.star.document.Settings", diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index f713f6062572..2e2bc8f07ed2 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> #include <com/sun/star/util/MeasureUnit.hpp> #include <com/sun/star/xml/sax/Parser.hpp> +#include <com/sun/star/document/GraphicStorageHandler.hpp> #include "xmlfilter.hxx" #include "xmlGroup.hxx" #include "xmlReport.hxx" @@ -180,7 +181,7 @@ ErrCode ReadThroughComponent( const sal_Char* pStreamName, const sal_Char* pCompatibilityStreamName, const uno::Reference<XComponentContext> & rxContext, - const Reference< document::XGraphicObjectResolver > & _xGraphicObjectResolver, + const Reference<document::XGraphicStorageHandler> & rxGraphicStorageHandler, const Reference<document::XEmbeddedObjectResolver>& _xEmbeddedObjectResolver, const OUString& _sFilterName ,const uno::Reference<beans::XPropertySet>& _xProp) @@ -224,7 +225,7 @@ ErrCode ReadThroughComponent( } sal_Int32 nArgs = 0; - if( _xGraphicObjectResolver.is()) + if (rxGraphicStorageHandler.is()) nArgs++; if( _xEmbeddedObjectResolver.is()) nArgs++; @@ -234,8 +235,8 @@ ErrCode ReadThroughComponent( uno::Sequence< uno::Any > aFilterCompArgs( nArgs ); nArgs = 0; - if( _xGraphicObjectResolver.is()) - aFilterCompArgs[nArgs++] <<= _xGraphicObjectResolver; + if (rxGraphicStorageHandler.is()) + aFilterCompArgs[nArgs++] <<= rxGraphicStorageHandler; if( _xEmbeddedObjectResolver.is()) aFilterCompArgs[ nArgs++ ] <<= _xEmbeddedObjectResolver; if ( _xProp.is() ) @@ -457,15 +458,15 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) } #endif - Reference< document::XGraphicObjectResolver > xGraphicObjectResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; uno::Reference<document::XEmbeddedObjectResolver> xEmbeddedObjectResolver; uno::Reference< uno::XComponentContext > xContext = GetComponentContext(); - uno::Sequence< uno::Any > aArgs(1); + uno::Sequence<uno::Any> aArgs(1); aArgs[0] <<= xStorage; - xGraphicObjectResolver.set( + xGraphicStorageHandler.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.comp.Svx.GraphicImportHelper", aArgs, xContext), - uno::UNO_QUERY ); + uno::UNO_QUERY); uno::Reference< lang::XMultiServiceFactory > xReportServiceFactory( m_xReportDefinition, uno::UNO_QUERY); aArgs[0] <<= beans::NamedValue("Storage",uno::makeAny(xStorage)); @@ -498,7 +499,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ,"meta.xml" ,"Meta.xml" ,GetComponentContext() - ,xGraphicObjectResolver + ,xGraphicStorageHandler ,xEmbeddedObjectResolver ,SERVICE_METAIMPORTER ,xProp @@ -522,7 +523,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ,"settings.xml" ,"Settings.xml" ,GetComponentContext() - ,xGraphicObjectResolver + ,xGraphicStorageHandler ,xEmbeddedObjectResolver ,SERVICE_SETTINGSIMPORTER ,xProp @@ -536,7 +537,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ,"styles.xml" ,"Styles.xml" ,GetComponentContext() - ,xGraphicObjectResolver + ,xGraphicStorageHandler ,xEmbeddedObjectResolver ,SERVICE_STYLESIMPORTER ,xProp); @@ -550,7 +551,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ,"content.xml" ,"Content.xml" ,GetComponentContext() - ,xGraphicObjectResolver + ,xGraphicStorageHandler ,xEmbeddedObjectResolver ,SERVICE_CONTENTIMPORTER ,xProp |