Kaydet (Commit) 45f20a89 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

[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/53279Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
Tested-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst e87ea03a
......@@ -30,7 +30,7 @@
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#include <com/sun/star/resource/StringResourceWithStorage.hpp>
#include <com/sun/star/resource/StringResourceWithLocation.hpp>
#include <com/sun/star/document/GraphicObjectResolver.hpp>
#include <com/sun/star/document/GraphicStorageHandler.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <dlgcont.hxx>
#include <comphelper/fileformat.h>
......@@ -242,10 +242,8 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
if (!vxGraphicList.empty())
{
// Export the images to the storage
Reference<document::XGraphicObjectResolver> xGraphicResolver;
xGraphicResolver.set(document::GraphicObjectResolver::createWithStorage(mxContext, xStorage));
Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
xGraphicStorageHandler.set(xGraphicResolver, uno::UNO_QUERY);
xGraphicStorageHandler.set(document::GraphicStorageHandler::createWithStorage(mxContext, xStorage));
if (xGraphicStorageHandler.is())
{
for (uno::Reference<graphic::XGraphic> const & rxGraphic : vxGraphicList)
......
......@@ -101,15 +101,15 @@ enum eServiceType
SERVICE_NAME_MARKER_TABLE,
SERVICE_NAME_NAMESPACE_MAP,
SERVICE_NAME_EXPORT_GRAPHIC_RESOLVER,
SERVICE_NAME_IMPORT_GRAPHIC_RESOLVER
SERVICE_NAME_EXPORT_GRAPHIC_STORAGE_RESOLVER,
SERVICE_NAME_IMPORT_GRAPHIC_STORAGE_RESOLVER
};
typedef std::map< OUString, enum eServiceType > tServiceNameMap;
tServiceNameMap & lcl_getStaticServiceNameMap()
{
static tServiceNameMap aServiceNameMap{
static tServiceNameMap aServiceNameMap {
{"com.sun.star.chart.AreaDiagram", SERVICE_NAME_AREA_DIAGRAM},
{"com.sun.star.chart.BarDiagram", SERVICE_NAME_BAR_DIAGRAM},
{"com.sun.star.chart.DonutDiagram", SERVICE_NAME_DONUT_DIAGRAM},
......@@ -130,8 +130,9 @@ tServiceNameMap & lcl_getStaticServiceNameMap()
{"com.sun.star.drawing.MarkerTable", SERVICE_NAME_MARKER_TABLE},
{"com.sun.star.xml.NamespaceMap", SERVICE_NAME_NAMESPACE_MAP},
{"com.sun.star.document.ExportGraphicObjectResolver", SERVICE_NAME_EXPORT_GRAPHIC_RESOLVER},
{"com.sun.star.document.ImportGraphicObjectResolver", SERVICE_NAME_IMPORT_GRAPHIC_RESOLVER}};
{"com.sun.star.document.ExportGraphicStoreageHandler", SERVICE_NAME_EXPORT_GRAPHIC_STORAGE_RESOLVER},
{"com.sun.star.document.ImportGraphicStoreageHandler", SERVICE_NAME_IMPORT_GRAPHIC_STORAGE_RESOLVER}
};
return aServiceNameMap;
}
......@@ -1192,9 +1193,9 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
case SERVICE_NAME_NAMESPACE_MAP:
break;
case SERVICE_NAME_EXPORT_GRAPHIC_RESOLVER:
case SERVICE_NAME_EXPORT_GRAPHIC_STORAGE_RESOLVER:
break;
case SERVICE_NAME_IMPORT_GRAPHIC_RESOLVER:
case SERVICE_NAME_IMPORT_GRAPHIC_STORAGE_RESOLVER:
break;
}
......
......@@ -45,7 +45,8 @@
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/document/GraphicObjectResolver.hpp>
#include <com/sun/star/document/GraphicStorageHandler.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <tools/diagnose_ex.h>
......@@ -298,15 +299,15 @@ ErrCode XMLFilter::impl_Import(
if( ! xStorage.is())
return ERRCODE_SFX_GENERAL;
Reference< document::XGraphicObjectResolver > xGraphicObjectResolver;
uno::Reference< lang::XMultiServiceFactory > xServiceFactory( xFactory, uno::UNO_QUERY);
if( xServiceFactory.is())
uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
uno::Reference<lang::XMultiServiceFactory> xServiceFactory(xFactory, uno::UNO_QUERY);
if (xServiceFactory.is())
{
uno::Sequence< uno::Any > aArgs(1);
uno::Sequence<uno::Any> aArgs(1);
aArgs[0] <<= xStorage;
xGraphicObjectResolver.set(
xGraphicStorageHandler.set(
xServiceFactory->createInstanceWithArguments(
"com.sun.star.comp.Svx.GraphicImportHelper", aArgs ), uno::UNO_QUERY );
"com.sun.star.comp.Svx.GraphicImportHelper", aArgs), uno::UNO_QUERY);
}
// create XPropertySet with extra informatio for the filter
......@@ -362,7 +363,7 @@ ErrCode XMLFilter::impl_Import(
nWarning = impl_ImportStream(
sXML_metaStreamName,
"com.sun.star.comp.Chart.XMLOasisMetaImporter",
xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );
xStorage, xSaxParser, xFactory, xGraphicStorageHandler, xImportInfo );
// import styles
ErrCode nTmpErr = impl_ImportStream(
......@@ -370,7 +371,7 @@ ErrCode XMLFilter::impl_Import(
bOasis
? OUString("com.sun.star.comp.Chart.XMLOasisStylesImporter")
: OUString("com.sun.star.comp.Chart.XMLStylesImporter"),
xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );
xStorage, xSaxParser, xFactory, xGraphicStorageHandler, xImportInfo );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nTmpErr;
// import content
......@@ -379,7 +380,7 @@ ErrCode XMLFilter::impl_Import(
bOasis
? OUString("com.sun.star.comp.Chart.XMLOasisContentImporter")
: OUString("com.sun.star.comp.Chart.XMLContentImporter"),
xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );
xStorage, xSaxParser, xFactory, xGraphicStorageHandler, xImportInfo );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nContentWarning;
// import of "content.xml" didn't work - try old "Content.xml" stream
......@@ -388,7 +389,7 @@ ErrCode XMLFilter::impl_Import(
nWarning = impl_ImportStream(
"Content.xml", // old content stream name
"com.sun.star.office.sax.importer.Chart",
xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );
xStorage, xSaxParser, xFactory, xGraphicStorageHandler, xImportInfo );
}
}
catch (const uno::Exception&)
......@@ -408,7 +409,7 @@ ErrCode XMLFilter::impl_ImportStream(
const Reference< embed::XStorage > & xStorage,
const Reference< xml::sax::XParser > & xParser,
const Reference< lang::XMultiComponentFactory > & xFactory,
const Reference< document::XGraphicObjectResolver > & xGraphicObjectResolver,
const Reference< document::XGraphicStorageHandler > & xGraphicStorageHandler,
uno::Reference< beans::XPropertySet > const & xImportInfo )
{
ErrCode nWarning = ERRCODE_SFX_GENERAL;
......@@ -438,7 +439,7 @@ ErrCode XMLFilter::impl_ImportStream(
if( aParserInput.aInputStream.is())
{
sal_Int32 nArgs = 0;
if( xGraphicObjectResolver.is())
if( xGraphicStorageHandler.is())
nArgs++;
if( xImportInfo.is())
nArgs++;
......@@ -446,8 +447,8 @@ ErrCode XMLFilter::impl_ImportStream(
uno::Sequence< uno::Any > aFilterCompArgs( nArgs );
nArgs = 0;
if( xGraphicObjectResolver.is())
aFilterCompArgs[nArgs++] <<= xGraphicObjectResolver;
if( xGraphicStorageHandler.is())
aFilterCompArgs[nArgs++] <<= xGraphicStorageHandler;
if( xImportInfo.is())
aFilterCompArgs[ nArgs++ ] <<= xImportInfo;
......@@ -576,8 +577,8 @@ ErrCode XMLFilter::impl_Export(
}
}
Reference< document::XGraphicObjectResolver > xGraphicObjectResolver = document::GraphicObjectResolver::createWithStorage(
m_xContext, xStorage );
Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
xGraphicStorageHandler.set(document::GraphicStorageHandler::createWithStorage(m_xContext, xStorage));
// property map for export info set
comphelper::PropertyMapEntry const aExportInfoMap[] =
......@@ -600,7 +601,7 @@ ErrCode XMLFilter::impl_Export(
xInfoSet->setPropertyValue( "ExportTableNumberList", uno::Any( true ));
sal_Int32 nArgs = 2;
if( xGraphicObjectResolver.is())
if( xGraphicStorageHandler.is())
nArgs++;
uno::Sequence< uno::Any > aFilterProperties( nArgs );
......@@ -608,8 +609,8 @@ ErrCode XMLFilter::impl_Export(
nArgs = 0;
aFilterProperties[ nArgs++ ] <<= xInfoSet;
aFilterProperties[ nArgs++ ] <<= xDocHandler;
if( xGraphicObjectResolver.is())
aFilterProperties[ nArgs++ ] <<= xGraphicObjectResolver;
if( xGraphicStorageHandler.is())
aFilterProperties[ nArgs++ ] <<= xGraphicStorageHandler;
}
// export meta information
......@@ -637,8 +638,8 @@ ErrCode XMLFilter::impl_Export(
xStorage, xSaxWriter, xServiceFactory, aFilterProperties );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nContentWarning;
Reference< lang::XComponent > xComp( xGraphicObjectResolver, uno::UNO_QUERY );
if( xComp.is())
Reference< lang::XComponent > xComp(xGraphicStorageHandler, uno::UNO_QUERY);
if (xComp.is())
xComp->dispose();
uno::Reference<embed::XTransactedObject> xTransact( xStorage ,uno::UNO_QUERY);
......
......@@ -44,7 +44,7 @@ namespace xml { namespace sax
}}
namespace document
{
class XGraphicObjectResolver;
class XGraphicStorageHandler;
}
}}}
......@@ -105,7 +105,7 @@ private:
const css::uno::Reference< css::embed::XStorage > & xStorage,
const css::uno::Reference< css::xml::sax::XParser > & xParser,
const css::uno::Reference< css::lang::XMultiComponentFactory > & xFactory,
const css::uno::Reference< css::document::XGraphicObjectResolver > & xGraphicObjectResolver,
const css::uno::Reference<css::document::XGraphicStorageHandler> & xGraphicStorageHandler,
css::uno::Reference< css::beans::XPropertySet > const & xPropSet );
/// @return a warning code, or 0 for successful operation
......
......@@ -32,7 +32,8 @@
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/GraphicObjectResolver.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <com/sun/star/document/GraphicStorageHandler.hpp>
#include <com/sun/star/embed/EntryInitModes.hpp>
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
......@@ -60,8 +61,6 @@
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/DialogProvider.hpp>
#include <com/sun/star/document/XGraphicObjectResolver.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <comphelper/documentconstants.hxx>
#include <comphelper/enumhelper.hxx>
......@@ -383,10 +382,8 @@ void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibrar
if (!vxGraphicList.empty())
{
// Export the images to the storage
uno::Reference<document::XGraphicObjectResolver> xGraphicResolver;
xGraphicResolver.set(GraphicObjectResolver::createWithStorage(rxContext, xTmpPic));
uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
xGraphicStorageHandler.set(xGraphicResolver, uno::UNO_QUERY);
xGraphicStorageHandler.set(GraphicStorageHandler::createWithStorage(rxContext, xTmpPic));
if (xGraphicStorageHandler.is())
{
for (uno::Reference<graphic::XGraphic> const & rxGraphic : vxGraphicList)
......
......@@ -22,7 +22,7 @@
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XGraphicObjectResolver.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
#include <com/sun/star/frame/Desktop.hpp>
......@@ -460,13 +460,13 @@ void XMLFilterTestDialog::doExport( const Reference< XComponent >& xComp )
Reference< XMultiServiceFactory > xDocFac( xComp, UNO_QUERY );
Reference< XEmbeddedObjectResolver > xObjectResolver;
Reference< XGraphicObjectResolver > xGrfResolver;
Reference<XGraphicStorageHandler> xGraphicStorageHandler;
if( xDocFac.is() )
{
try
{
xGrfResolver.set( xDocFac->createInstance("com.sun.star.document.ExportGraphicObjectResolver"), UNO_QUERY );
xGraphicStorageHandler.set(xDocFac->createInstance("com.sun.star.document.ExportGraphicStorageHandler"), UNO_QUERY);
xObjectResolver.set( xDocFac->createInstance("com.sun.star.document.ExportEmbeddedObjectResolver"), UNO_QUERY );
}
catch( const Exception& )
......@@ -474,10 +474,13 @@ void XMLFilterTestDialog::doExport( const Reference< XComponent >& xComp )
}
}
Sequence< Any > aArgs( 1 + ( xGrfResolver.is() ? 1 : 0 ) + ( xObjectResolver.is() ? 1 : 0 ) );
Sequence< Any > aArgs( 1 + ( xGraphicStorageHandler.is() ? 1 : 0 ) + ( xObjectResolver.is() ? 1 : 0 ) );
Any* pArgs = aArgs.getArray();
if( xGrfResolver.is() ) *pArgs++ <<= xGrfResolver;
if( xObjectResolver.is() ) *pArgs++ <<= xObjectResolver;
if (xGraphicStorageHandler.is())
*pArgs++ <<= xGraphicStorageHandler;
if (xObjectResolver.is())
*pArgs++ <<= xObjectResolver;
// *pArgs++ <<= xInfoSet;
*pArgs <<= xHandler;
......
......@@ -46,7 +46,7 @@
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XGraphicObjectResolver.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
......@@ -128,7 +128,7 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper<
css::uno::Reference< css::xml::sax::XDocumentHandler > mxHandler; // the handlers
css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > mxExtHandler;
css::uno::Reference< css::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
css::uno::Reference< css::document::XGraphicObjectResolver > mxGraphicResolver;
css::uno::Reference< css::document::XGraphicStorageHandler > mxGraphicStorageHandler;
css::uno::Reference< css::document::XEmbeddedObjectResolver > mxEmbeddedResolver;
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator;
css::uno::Reference< css::beans::XPropertySet > mxExportInfo;
......@@ -256,8 +256,11 @@ protected:
const css::uno::Reference< css::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
inline void SetEmbeddedResolver( css::uno::Reference< css::document::XEmbeddedObjectResolver > const & _xEmbeddedResolver );
const css::uno::Reference< css::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; }
void SetGraphicResolver( css::uno::Reference< css::document::XGraphicObjectResolver > const & _xGraphicResolver );
const css::uno::Reference<css::document::XGraphicStorageHandler> & GetGraphicStorageHandler() const
{
return mxGraphicStorageHandler;
}
void SetGraphicStorageHandler(css::uno::Reference<css::document::XGraphicStorageHandler> const & rxGraphicStorageHandler);
void SetDocHandler( const css::uno::Reference< css::xml::sax::XDocumentHandler > &rHandler );
......@@ -625,10 +628,10 @@ inline void SvXMLExport::SetEmbeddedResolver(
mxEmbeddedResolver = _xEmbeddedResolver;
}
inline void SvXMLExport::SetGraphicResolver(
css::uno::Reference< css::document::XGraphicObjectResolver > const & _xGraphicResolver )
inline void SvXMLExport::SetGraphicStorageHandler(
css::uno::Reference<css::document::XGraphicStorageHandler> const & rxGraphicStorageHandler)
{
mxGraphicResolver = _xGraphicResolver;
mxGraphicStorageHandler = rxGraphicStorageHandler;
}
// Helper class to export an element.
......
......@@ -42,7 +42,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XGraphicObjectResolver.hpp>
#include <com/sun/star/document/XGraphicStorageHandler.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
......@@ -177,7 +177,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper<
css::uno::Reference< css::xml::sax::XLocator > mxLocator;
css::uno::Reference< css::frame::XModel > mxModel;
css::uno::Reference< css::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
css::uno::Reference< css::document::XGraphicObjectResolver > mxGraphicResolver;
css::uno::Reference< css::document::XGraphicStorageHandler > mxGraphicStorageHandler;
css::uno::Reference< css::document::XEmbeddedObjectResolver > mxEmbeddedResolver;
css::uno::Reference< css::beans::XPropertySet > mxImportInfo;
......@@ -271,9 +271,11 @@ protected:
const css::uno::Reference< css::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
inline void SetEmbeddedResolver( css::uno::Reference< css::document::XEmbeddedObjectResolver > const & _xEmbeddedResolver );
const css::uno::Reference< css::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; }
void SetGraphicResolver( css::uno::Reference< css::document::XGraphicObjectResolver > const & _xGraphicResolver );
const css::uno::Reference<css::document::XGraphicStorageHandler> & GetGraphicStorageHandler() const
{
return mxGraphicStorageHandler;
}
void SetGraphicStorageHandler(css::uno::Reference<css::document::XGraphicStorageHandler> const & rxGraphicStorageHandler);
void CreateNumberFormatsSupplier_();
void CreateDataStylesImport_();
......@@ -617,10 +619,10 @@ inline void SvXMLImport::SetEmbeddedResolver(
mxEmbeddedResolver = _xEmbeddedResolver;
}
inline void SvXMLImport::SetGraphicResolver(
css::uno::Reference< css::document::XGraphicObjectResolver > const & _xGraphicResolver )
inline void SvXMLImport::SetGraphicStorageHandler(
css::uno::Reference<css::document::XGraphicStorageHandler> const & rxGraphicStorageHandler)
{
mxGraphicResolver = _xGraphicResolver;
mxGraphicStorageHandler = rxGraphicStorageHandler;
}
inline css::uno::Reference< css::util::XNumberFormatsSupplier > & SvXMLImport::GetNumberFormatsSupplier()
......
......@@ -128,7 +128,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/document,\
DocumentRevisionListPersistence \
IndexedPropertyValues \
FilterConfigRefresh \
GraphicObjectResolver \
GraphicStorageHandler \
NamedPropertyValues \
OleEmbeddedServerRegistration \
OOXMLDocumentPropertiesImporter \
......
......@@ -6,30 +6,22 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __com_sun_star_document_GraphicObjectResolver_idl__
#define __com_sun_star_document_GraphicObjectResolver_idl__
#include <com/sun/star/document/XGraphicObjectResolver.idl>
#include <com/sun/star/embed/XStorage.idl>
#ifndef __com_sun_star_document_GraphicStorageHandler_idl__
#define __com_sun_star_document_GraphicStorageHandler_idl__
#include <com/sun/star/document/GraphicStorageHandler.idl>
#include <com/sun/star/embed/XStorage.idl>
module com { module sun { module star { module document {
/**
@since LibreOffice 4.1
Default implementation of XGraphicStorageHandler
@since LibreOffice 6.1
*/
service GraphicObjectResolver : XGraphicObjectResolver
service GraphicStorageHandler : XGraphicStorageHandler
{
createWithStorage([in] com::sun::star::embed::XStorage Storage);
};
......
......@@ -26,11 +26,17 @@ module com { module sun { module star { module document {
/** this interface converts graphic object URLs from one URL space to another.
@deprecated since LibreOffice 6.1
Use GraphicStorageHandler or GraphicProvider to load an XGraphic instead
as converting to internal GraphicObject URL is not possible anymore.
*/
published interface XGraphicObjectResolver: com::sun::star::uno::XInterface
{
/** converts the given URL from the source URL namespace to the destination
URL space of this instance.
@deprecated since LibreOffice 6.1 - throws an RuntimeException if called
*/
string resolveGraphicObjectURL( [in] string aURL );
};
......
......@@ -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",
......
......@@ -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
......
......@@ -43,8 +43,8 @@ public:
DOCSPRSETT , DOCCONF ,
IMAP_RECT , IMAP_CIRC , IMAP_POLY ,
// Support creation of GraphicObjectResolver and EmbeddedObjectResolver
EXPORT_GOR , IMPORT_GOR , EXPORT_EOR , IMPORT_EOR ,
// Support creation of GraphicStorageHandler and EmbeddedObjectResolver
EXPORT_GRAPHIC_STORAGE_HANDLER , IMPORT_GRAPHIC_STORAGE_HANDLER , EXPORT_EOR , IMPORT_EOR ,
VALBIND , LISTCELLBIND , LISTSOURCE ,
......
......@@ -435,7 +435,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
}
rtl::Reference<SvXMLGraphicHelper> xGraphicHelper;
uno::Reference< document::XGraphicObjectResolver > xGrfContainer;
uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper;
......@@ -443,7 +443,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
if( xStorage.is() )
{
xGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read );
xGrfContainer = xGraphicHelper.get();
xGraphicStorageHandler = xGraphicHelper.get();
xObjectHelper = SvXMLEmbeddedObjectHelper::Create(xStorage, mrDocShell, SvXMLEmbeddedObjectHelperMode::Read);
xObjectResolver = xObjectHelper.get();
......@@ -451,7 +451,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
uno::Sequence<uno::Any> aStylesArgs(4);
uno::Any* pStylesArgs = aStylesArgs.getArray();
pStylesArgs[0] <<= xInfoSet;
pStylesArgs[1] <<= xGrfContainer;
pStylesArgs[1] <<= xGraphicStorageHandler;
pStylesArgs[2] <<= xStatusIndicator;
pStylesArgs[3] <<= xObjectResolver;
......@@ -500,7 +500,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
uno::Sequence<uno::Any> aDocArgs(4);
uno::Any* pDocArgs = aDocArgs.getArray();
pDocArgs[0] <<= xInfoSet;
pDocArgs[1] <<= xGrfContainer;
pDocArgs[1] <<= xGraphicStorageHandler;
pDocArgs[2] <<= xStatusIndicator;
pDocArgs[3] <<= xObjectResolver;
......@@ -866,13 +866,13 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper;
uno::Reference< document::XGraphicObjectResolver > xGrfContainer;
uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
rtl::Reference<SvXMLGraphicHelper> xGraphicHelper;
if( xStorage.is() )
{
xGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Write );
xGrfContainer = xGraphicHelper.get();
xGraphicStorageHandler = xGraphicHelper.get();
}
if( pObjSh )
......@@ -887,7 +887,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
uno::Sequence<uno::Any> aStylesArgs(5);
uno::Any* pStylesArgs = aStylesArgs.getArray();
pStylesArgs[0] <<= xInfoSet;
pStylesArgs[1] <<= xGrfContainer;
pStylesArgs[1] <<= xGraphicStorageHandler;
pStylesArgs[2] <<= xStatusIndicator;
pStylesArgs[3] <<= xWriter;
pStylesArgs[4] <<= xObjectResolver;
......@@ -911,7 +911,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
uno::Sequence<uno::Any> aDocArgs(5);
uno::Any* pDocArgs = aDocArgs.getArray();
pDocArgs[0] <<= xInfoSet;
pDocArgs[1] <<= xGrfContainer;
pDocArgs[1] <<= xGraphicStorageHandler;
pDocArgs[2] <<= xStatusIndicator;
pDocArgs[3] <<= xWriter;
pDocArgs[4] <<= xObjectResolver;
......
......@@ -48,7 +48,7 @@
#include <tokenuno.hxx>
#include <PivotTableDataProvider.hxx>
// Support creation of GraphicObjectResolver and EmbeddedObjectResolver
// Support creation of GraphicStorageHandler and EmbeddedObjectResolver