diff options
39 files changed, 260 insertions, 277 deletions
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 24ecf29d4d22..8757f01df6a9 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -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) diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 50c6c213da43..94d74b0eefe3 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -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; } diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index b45b0fb23b5d..f9ca9cdcd40a 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -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); diff --git a/chart2/source/model/inc/XMLFilter.hxx b/chart2/source/model/inc/XMLFilter.hxx index 85c033c99a7e..6b97ca858d9e 100644 --- a/chart2/source/model/inc/XMLFilter.hxx +++ b/chart2/source/model/inc/XMLFilter.hxx @@ -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 diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 43b3c4d41d3f..eee5e8465031 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -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) diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index 34b14eb0b3e5..800a51a10ec2 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -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; diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index a40d47edf9e6..eeedd1bc09fa 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -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. diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 77b620a3f1df..5ac6e5c2091e 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -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() diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index da34ba0a74f7..2f544b327a6e 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -128,7 +128,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/document,\ DocumentRevisionListPersistence \ IndexedPropertyValues \ FilterConfigRefresh \ - GraphicObjectResolver \ + GraphicStorageHandler \ NamedPropertyValues \ OleEmbeddedServerRegistration \ OOXMLDocumentPropertiesImporter \ diff --git a/offapi/com/sun/star/document/GraphicObjectResolver.idl b/offapi/com/sun/star/document/GraphicObjectResolver.idl deleted file mode 100644 index f10ea2951416..000000000000 --- a/offapi/com/sun/star/document/GraphicObjectResolver.idl +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * 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> - - -module com { module sun { module star { module document { - - -/** - @since LibreOffice 4.1 - */ -service GraphicObjectResolver : XGraphicObjectResolver -{ - createWithStorage([in] com::sun::star::embed::XStorage Storage); -}; - - -}; }; }; }; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/document/GraphicStorageHandler.idl b/offapi/com/sun/star/document/GraphicStorageHandler.idl new file mode 100644 index 000000000000..a29f181f32bf --- /dev/null +++ b/offapi/com/sun/star/document/GraphicStorageHandler.idl @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + */ + +#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 { + +/** + Default implementation of XGraphicStorageHandler + + @since LibreOffice 6.1 + */ +service GraphicStorageHandler : XGraphicStorageHandler +{ + createWithStorage([in] com::sun::star::embed::XStorage Storage); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/document/XGraphicObjectResolver.idl b/offapi/com/sun/star/document/XGraphicObjectResolver.idl index d0678456301b..ea8f5ea270b7 100644 --- a/offapi/com/sun/star/document/XGraphicObjectResolver.idl +++ b/offapi/com/sun/star/document/XGraphicObjectResolver.idl @@ -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 ); }; 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 diff --git a/sc/inc/servuno.hxx b/sc/inc/servuno.hxx index a53b81f3e3e4..d3e55bcaf272 100644 --- a/sc/inc/servuno.hxx +++ b/sc/inc/servuno.hxx @@ -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 , diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 069eae8d9ac0..0ba9283aaff2 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -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; diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 8b958791c16c..37186b02be7c 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -48,7 +48,7 @@ #include <tokenuno.hxx> #include <PivotTableDataProvider.hxx> -// Support creation of GraphicObjectResolver and EmbeddedObjectResolver +// Support creation of GraphicStorageHandler and EmbeddedObjectResolver #include <svx/xmleohlp.hxx> #include <svx/xmlgrhlp.hxx> #include <sfx2/docfile.hxx> @@ -283,9 +283,9 @@ const ProvNamesId_Type aProvNamesId[] = { "com.sun.star.image.ImageMapCircleObject", Type::IMAP_CIRC }, { "com.sun.star.image.ImageMapPolygonObject", Type::IMAP_POLY }, - // Support creation of GraphicObjectResolver and EmbeddedObjectResolver - { "com.sun.star.document.ExportGraphicObjectResolver", Type::EXPORT_GOR }, - { "com.sun.star.document.ImportGraphicObjectResolver", Type::IMPORT_GOR }, + // Support creation of GraphicStorageHandler and EmbeddedObjectResolver + { "com.sun.star.document.ExportGraphicStorageHandler", Type::EXPORT_GRAPHIC_STORAGE_HANDLER }, + { "com.sun.star.document.ImportGraphicStorageHandler", Type::IMPORT_GRAPHIC_STORAGE_HANDLER }, { "com.sun.star.document.ExportEmbeddedObjectResolver", Type::EXPORT_EOR }, { "com.sun.star.document.ImportEmbeddedObjectResolver", Type::IMPORT_EOR }, @@ -500,11 +500,11 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( xRet.set(SvUnoImageMapPolygonObject_createInstance( ScShapeObj::GetSupportedMacroItems() )); break; - // Support creation of GraphicObjectResolver and EmbeddedObjectResolver - case Type::EXPORT_GOR: + // Support creation of GraphicStorageHandler and EmbeddedObjectResolver + case Type::EXPORT_GRAPHIC_STORAGE_HANDLER: xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Write ))); break; - case Type::IMPORT_GOR: + case Type::IMPORT_GRAPHIC_STORAGE_HANDLER: xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Read ))); break; case Type::EXPORT_EOR: diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 3ed608f6695a..f227c8dbd67e 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -48,7 +48,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> -#include <com/sun/star/document/XGraphicObjectResolver.hpp> +#include <com/sun/star/document/XGraphicStorageHandler.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/packages/WrongPasswordException.hpp> @@ -515,7 +515,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) } } - Reference< document::XGraphicObjectResolver > xGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper; Reference< document::XEmbeddedObjectResolver > xObjectResolver; rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper; @@ -567,7 +567,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) { xGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read ); - xGraphicResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); xObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *pDoc->GetPersist(), SvXMLEmbeddedObjectHelperMode::Read ); @@ -607,7 +607,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) Sequence<Any> aFilterArgs( 4 ); Any *pArgs = aFilterArgs.getArray(); *pArgs++ <<= xInfoSet; - *pArgs++ <<= xGraphicResolver; + *pArgs++ <<= xGraphicStorageHandler; *pArgs++ <<= xObjectResolver; *pArgs++ <<= mxStatusIndicator; @@ -660,7 +660,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) if( xGraphicHelper ) xGraphicHelper->dispose(); xGraphicHelper.clear(); - xGraphicResolver = nullptr; + xGraphicStorageHandler = nullptr; if( xObjectHelper.is() ) xObjectHelper->dispose(); xObjectHelper.clear(); @@ -879,7 +879,7 @@ bool SdXMLFilter::Export() { uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; - uno::Reference< document::XGraphicObjectResolver > xGrfResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; // create helper for graphic and ole export if we have a storage if( xStorage.is() ) @@ -888,7 +888,7 @@ bool SdXMLFilter::Export() xObjectResolver = xObjectHelper.get(); xGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Write ); - xGrfResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); } CreateStatusIndicator(); @@ -969,12 +969,15 @@ bool SdXMLFilter::Export() uno::Reference< io::XActiveDataSource > xDocSrc( xWriter, uno::UNO_QUERY ); xDocSrc->setOutputStream( xDocOut ); - uno::Sequence< uno::Any > aArgs( 2 + ( mxStatusIndicator.is() ? 1 : 0 ) + ( xGrfResolver.is() ? 1 : 0 ) + ( xObjectResolver.is() ? 1 : 0 ) ); + uno::Sequence< uno::Any > aArgs( 2 + ( mxStatusIndicator.is() ? 1 : 0 ) + ( xGraphicStorageHandler.is() ? 1 : 0 ) + ( xObjectResolver.is() ? 1 : 0 ) ); uno::Any* pArgs = aArgs.getArray(); *pArgs++ <<= xInfoSet; - if( xGrfResolver.is() ) *pArgs++ <<= xGrfResolver; - if( xObjectResolver.is() ) *pArgs++ <<= xObjectResolver; - if( mxStatusIndicator.is() ) *pArgs++ <<= mxStatusIndicator; + if (xGraphicStorageHandler.is()) + *pArgs++ <<= xGraphicStorageHandler; + if (xObjectResolver.is()) + *pArgs++ <<= xObjectResolver; + if (mxStatusIndicator.is()) + *pArgs++ <<= mxStatusIndicator; *pArgs <<= xWriter; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 9186385f182c..677687e703d0 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -75,7 +75,7 @@ #include <unotools/saveopt.hxx> #include <xmloff/autolayout.hxx> -// Support creation of GraphicObjectResolver and EmbeddedObjectResolver +// Support creation of GraphicStorageHandler and EmbeddedObjectResolver #include <svx/xmleohlp.hxx> #include <svx/xmlgrhlp.hxx> #include <DrawDocShell.hxx> @@ -940,13 +940,13 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( return svx::NamespaceMap_createInstance( aWhichIds, &mpDoc->GetItemPool() ); } - // Support creation of GraphicObjectResolver and EmbeddedObjectResolver - if( aServiceSpecifier == "com.sun.star.document.ExportGraphicObjectResolver" ) + // Support creation of GraphicStorageHandler and EmbeddedObjectResolver + if (aServiceSpecifier == "com.sun.star.document.ExportGraphicStorageHandler") { return static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Write )); } - if( aServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" ) + if (aServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler") { return static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Read )); } @@ -1135,9 +1135,9 @@ uno::Sequence< OUString > SAL_CALL SdXImpressDocument::getAvailableServiceNames( aSNS[i++] = sUNO_Service_ImageMapPolygonObject; aSNS[i++] = "com.sun.star.xml.NamespaceMap"; - // Support creation of GraphicObjectResolver and EmbeddedObjectResolver - aSNS[i++] = "com.sun.star.document.ExportGraphicObjectResolver"; - aSNS[i++] = "com.sun.star.document.ImportGraphicObjectResolver"; + // Support creation of GraphicStorageHandler and EmbeddedObjectResolver + aSNS[i++] = "com.sun.star.document.ExportGraphicStorageHandler"; + aSNS[i++] = "com.sun.star.document.ImportGraphicStorageHandler"; aSNS[i++] = "com.sun.star.document.ExportEmbeddedObjectResolver"; aSNS[i++] = "com.sun.star.document.ImportEmbeddedObjectResolver"; aSNS[i++] = "com.sun.star.drawing.TableShape"; diff --git a/svx/source/inc/xmlxtexp.hxx b/svx/source/inc/xmlxtexp.hxx index b48e26b17e8d..fe8cb0e98351 100644 --- a/svx/source/inc/xmlxtexp.hxx +++ b/svx/source/inc/xmlxtexp.hxx @@ -27,7 +27,7 @@ namespace com { namespace sun { namespace star { namespace uno { template<class X> class Reference; } namespace uno { class XInterface; } namespace container { class XNameContainer; } - namespace document { class XGraphicObjectResolver; } + namespace document { class XGraphicStorageHandler; } namespace xml { namespace sax { class XDocumentHandler; } } } } } @@ -39,7 +39,7 @@ public: const OUString& rFileName, const css::uno::Reference< css::xml::sax::XDocumentHandler > & xHandler, const css::uno::Reference< css::container::XNameContainer > & xTable, - css::uno::Reference< css::document::XGraphicObjectResolver > const & xGrfResolver); + css::uno::Reference<css::document::XGraphicStorageHandler> const & xGraphicStorageHandler); virtual ~SvxXMLXTableExportComponent() override; diff --git a/svx/source/inc/xmlxtimp.hxx b/svx/source/inc/xmlxtimp.hxx index ba4563efa21b..600b32f23adc 100644 --- a/svx/source/inc/xmlxtimp.hxx +++ b/svx/source/inc/xmlxtimp.hxx @@ -25,7 +25,7 @@ namespace com { namespace sun { namespace star { namespace uno { template<class X> class Reference; } namespace uno { class XInterface; } - namespace document { class XGraphicObjectResolver; } + namespace document { class XGraphicStorageHandler; } namespace container { class XNameContainer; } } } } @@ -36,7 +36,7 @@ public: SvxXMLXTableImport( const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::container::XNameContainer > & rTable, - css::uno::Reference< css::document::XGraphicObjectResolver > const & rGrfResolver); + css::uno::Reference<css::document::XGraphicStorageHandler> const & rxGraphicStorageHandler); virtual ~SvxXMLXTableImport() throw () override; diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 83f621ab6e8e..5de4c56b49c4 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -180,7 +180,7 @@ css::uno::Reference<css::uno::XInterface> create( return uno::Reference< uno::XInterface >( static_cast<drawing::XShape*>(SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI, nullptr, nullptr, referer )) ); } } - else if ( rServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" ) + else if (rServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler") { rtl::Reference<SvXMLGraphicHelper> pGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read ); uno::Reference< uno::XInterface> xRet( static_cast< ::cppu::OWeakObject* >( pGraphicHelper.get() ) ); diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index f13352549638..c3f61476440e 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -551,7 +551,6 @@ rtl::Reference<SvXMLEmbeddedObjectHelper> SvXMLEmbeddedObjectHelper::Create( return pThis; } -// XGraphicObjectResolver: alien objects! OUString SAL_CALL SvXMLEmbeddedObjectHelper::resolveEmbeddedObjectURL(const OUString& rURL) { MutexGuard aGuard( maMutex ); diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx index 5e542ac665f5..4c65a19491c8 100644 --- a/svx/source/xml/xmlexport.cxx +++ b/svx/source/xml/xmlexport.cxx @@ -53,7 +53,7 @@ bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputSt { bool bDocRet = xOut.is(); - Reference< document::XGraphicObjectResolver > xGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper; Reference< document::XEmbeddedObjectResolver > xObjectResolver; @@ -82,7 +82,7 @@ bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputSt } xGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Write ); - xGraphicResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY ); @@ -92,7 +92,7 @@ bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputSt uno::Sequence< uno::Any > aArgs( xObjectResolver.is() ? 3 : 2 ); aArgs[0] <<= xHandler; - aArgs[1] <<= xGraphicResolver; + aArgs[1] <<= xGraphicStorageHandler; if( xObjectResolver.is() ) aArgs[2] <<= xObjectResolver; @@ -125,7 +125,7 @@ bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputSt if( xGraphicHelper ) xGraphicHelper->dispose(); xGraphicHelper.clear(); - xGraphicResolver = nullptr; + xGraphicStorageHandler = nullptr; if( xObjectHelper.is() ) xObjectHelper->dispose(); @@ -150,7 +150,7 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr { bool bRet = true; - Reference< document::XGraphicObjectResolver > xGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper; Reference< document::XEmbeddedObjectResolver > xObjectResolver; @@ -175,7 +175,7 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr xGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read ); - xGraphicResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); ::comphelper::IEmbeddedHelper *pPersist = pModel->GetPersist(); if( pPersist ) @@ -197,7 +197,7 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr // prepare filter arguments Sequence<Any> aFilterArgs( 2 ); Any *pArgs = aFilterArgs.getArray(); - *pArgs++ <<= xGraphicResolver; + *pArgs++ <<= xGraphicStorageHandler; *pArgs++ <<= xObjectResolver; // get filter @@ -233,7 +233,7 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr if( xGraphicHelper ) xGraphicHelper->dispose(); xGraphicHelper.clear(); - xGraphicResolver = nullptr; + xGraphicStorageHandler = nullptr; if( xObjectHelper.is() ) xObjectHelper->dispose(); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 971402aea6b0..a0f01b8671ac 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -561,8 +561,7 @@ void splitUserDataFromURL(OUString const & rWholeURL, OUString & rJustURL, OUStr // XGraphicObjectResolver OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const OUString& /*rURL*/ ) { - osl::MutexGuard aGuard( maMutex ); - return OUString(); + throw uno::RuntimeException("XGraphicObjectResolver has been removed in LibreOffice 6.1"); } // XGraphicStorageHandler diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index 4db4101dc2c3..16598f7c37c7 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -139,7 +139,7 @@ SvxXMLXTableExportComponent::SvxXMLXTableExportComponent( const OUString& rFileName, const uno::Reference<xml::sax::XDocumentHandler> & rHandler, const uno::Reference<container::XNameContainer >& xTable, - uno::Reference<document::XGraphicObjectResolver > const & xGrfResolver ) + uno::Reference<document::XGraphicStorageHandler> const & xGraphicStorageHandler) : SvXMLExport(rContext, "", rFileName, rHandler, nullptr, FUNIT_100TH_MM, SvXMLExportFlags::NONE), mxTable( xTable ) { @@ -149,7 +149,7 @@ SvxXMLXTableExportComponent::SvxXMLXTableExportComponent( GetNamespaceMap_().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW ); GetNamespaceMap_().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); GetNamespaceMap_().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG ); - SetGraphicResolver( xGrfResolver ); + SetGraphicStorageHandler(xGraphicStorageHandler); } SvxXMLXTableExportComponent::~SvxXMLXTableExportComponent() @@ -218,7 +218,7 @@ bool SvxXMLXTableExportComponent::save( uno::Reference < io::XStream > xStream; uno::Reference < io::XOutputStream > xOut; uno::Reference<embed::XStorage > xSubStorage; - uno::Reference< XGraphicObjectResolver > xGrfResolver; + uno::Reference<XGraphicStorageHandler> xGraphicStorageHandler; uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY ); @@ -279,11 +279,11 @@ bool SvxXMLXTableExportComponent::save( uno::Reference<io::XActiveDataSource> xMetaSrc( xWriter, uno::UNO_QUERY ); xMetaSrc->setOutputStream( xOut ); if( xGraphicHelper.is() ) - xGrfResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); // Finally do the export const OUString aName; - rtl::Reference< SvxXMLXTableExportComponent > xExporter( new SvxXMLXTableExportComponent( xContext, aName, xHandler, xTable, xGrfResolver ) ); + rtl::Reference< SvxXMLXTableExportComponent > xExporter( new SvxXMLXTableExportComponent( xContext, aName, xHandler, xTable, xGraphicStorageHandler ) ); bRet = xExporter->exportTable(); if( xGraphicHelper ) diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index af5215c99582..f41eda3854d3 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -18,7 +18,7 @@ */ #include <tools/urlobj.hxx> -#include <com/sun/star/document/XGraphicObjectResolver.hpp> +#include <com/sun/star/document/XGraphicStorageHandler.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/io/XActiveDataControl.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> @@ -296,11 +296,11 @@ void SvxXMLTableImportContext::importBitmap( const uno::Reference< XAttributeLis SvxXMLXTableImport::SvxXMLXTableImport( const css::uno::Reference< css::uno::XComponentContext >& rContext, const uno::Reference< XNameContainer > & rTable, - uno::Reference< XGraphicObjectResolver > const & xGrfResolver ) + uno::Reference<XGraphicStorageHandler> const & xGraphicStorageHandler) : SvXMLImport(rContext, "", SvXMLImportFlags::NONE), mrTable( rTable ) { - SetGraphicResolver( xGrfResolver ); + SetGraphicStorageHandler(xGraphicStorageHandler); GetNamespaceMap().Add( "__ooo", GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO ); GetNamespaceMap().Add( "__office", GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE ); @@ -394,9 +394,9 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, *bOptLoadedFromStorage = true; } - uno::Reference< XGraphicObjectResolver > xGrfResolver; + uno::Reference<XGraphicStorageHandler> xGraphicStorageHandler; if (xGraphicHelper.is()) - xGrfResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); try { @@ -407,7 +407,7 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, { } - uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTableImport( xContext, xTable, xGrfResolver ) ); + uno::Reference<XDocumentHandler> xHandler(new SvxXMLXTableImport(xContext, xTable, xGraphicStorageHandler)); xParser->setDocumentHandler( xHandler ); xParser->parseStream( aParserInput ); diff --git a/svx/util/svxcore.component b/svx/util/svxcore.component index aa1cac6fcae4..d35228be117f 100644 --- a/svx/util/svxcore.component +++ b/svx/util/svxcore.component @@ -59,12 +59,12 @@ <implementation name="com.sun.star.comp.Svx.GraphicExportHelper" constructor="com_sun_star_comp_Svx_GraphicExportHelper_get_implementation"> <service name="com.sun.star.document.BinaryStreamResolver"/> - <service name="com.sun.star.document.GraphicObjectResolver"/> + <service name="com.sun.star.document.GraphicStorageHandler"/> </implementation> <implementation name="com.sun.star.comp.Svx.GraphicImportHelper" constructor="com_sun_star_comp_Svx_GraphicImportHelper_get_implementation"> <service name="com.sun.star.document.BinaryStreamResolver"/> - <service name="com.sun.star.document.GraphicObjectResolver"/> + <service name="com.sun.star.document.GraphicStorageHandler"/> </implementation> <implementation name="com.sun.star.comp.graphic.PrimitiveFactory2D" constructor="com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation"> diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index dfc4482de381..b04e2edc3117 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -484,7 +484,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper; uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper; @@ -501,7 +501,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con xGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read ); - xGraphicResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); SfxObjectShell *pPersist = rDoc.GetPersist(); if( pPersist ) { @@ -658,7 +658,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con // prepare filter arguments, WARNING: the order is important! Sequence<Any> aFilterArgs{ Any(xInfoSet), Any(xStatusIndicator), - Any(xGraphicResolver), + Any(xGraphicStorageHandler), Any(xObjectResolver), Any(aLateInitSettings) }; @@ -906,7 +906,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con if( xGraphicHelper ) xGraphicHelper->dispose(); xGraphicHelper.clear(); - xGraphicResolver = nullptr; + xGraphicStorageHandler = nullptr; if( xObjectHelper ) xObjectHelper->dispose(); xObjectHelper.clear(); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 0a462cafb9e2..4700a5ce86d1 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -81,7 +81,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS // Get data sink ... tools::SvRef<SotStorageStream> xDocStream; - uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper ; uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper; @@ -89,7 +89,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS OSL_ENSURE( xStg.is(), "Where is my storage?" ); xGraphicHelper = SvXMLGraphicHelper::Create( xStg, SvXMLGraphicHelperMode::Write ); - xGraphicResolver = xGraphicHelper.get(); + xGraphicStorageHandler = xGraphicHelper.get(); SfxObjectShell *pPersist = m_pDoc->GetPersist(); if( pPersist ) @@ -228,7 +228,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS if( xStatusIndicator.is() ) *pArgs++ <<= xStatusIndicator; - if( xGraphicResolver.is() ) + if( xGraphicStorageHandler.is() ) nArgs++; if( xObjectResolver.is() ) nArgs++; @@ -236,8 +236,8 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS Sequence < Any > aFilterArgs( nArgs ); pArgs = aFilterArgs.getArray(); *pArgs++ <<= xInfoSet; - if( xGraphicResolver.is() ) - *pArgs++ <<= xGraphicResolver; + if( xGraphicStorageHandler.is() ) + *pArgs++ <<= xGraphicStorageHandler; if( xObjectResolver.is() ) *pArgs++ <<= xObjectResolver; if( xStatusIndicator.is() ) @@ -392,7 +392,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS if( xGraphicHelper ) xGraphicHelper->dispose(); xGraphicHelper.clear(); - xGraphicResolver = nullptr; + xGraphicStorageHandler = nullptr; if( xObjectHelper ) xObjectHelper->dispose(); diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 01831bd6826f..8a7da0693df1 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -243,11 +243,11 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) // we don't need it here. // else: keep default pClass that we received - rtl::Reference<SvXMLGraphicHelper> xGraphicResolver; - if( !GetGraphicResolver().is() ) + rtl::Reference<SvXMLGraphicHelper> xGraphicStorageHandler; + if (!GetGraphicStorageHandler().is()) { - xGraphicResolver = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Write, GetImageFilterName() ); - SetGraphicResolver( xGraphicResolver.get() ); + xGraphicStorageHandler = SvXMLGraphicHelper::Create(SvXMLGraphicHelperMode::Write, GetImageFilterName()); + SetGraphicStorageHandler(xGraphicStorageHandler.get()); } rtl::Reference<SvXMLEmbeddedObjectHelper> xEmbeddedResolver; @@ -297,9 +297,9 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags ); } - if( xGraphicResolver ) - xGraphicResolver->dispose(); - xGraphicResolver.clear(); + if (xGraphicStorageHandler) + xGraphicStorageHandler->dispose(); + xGraphicStorageHandler.clear(); if( xEmbeddedResolver ) xEmbeddedResolver->dispose(); xEmbeddedResolver.clear(); diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 64c71c6fb46b..c7e33d926357 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -688,10 +688,10 @@ void SwXMLImport::startDocument() if ( pDrawModel ) pDrawModel->setLock(true); - if( !GetGraphicResolver().is() ) + if (!GetGraphicStorageHandler().is()) { - m_xGraphicResolver = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read ); - SetGraphicResolver( m_xGraphicResolver.get() ); + m_xGraphicStorageHandler = SvXMLGraphicHelper::Create(SvXMLGraphicHelperMode::Read); + SetGraphicStorageHandler(m_xGraphicStorageHandler.get()); } if( !GetEmbeddedResolver().is() ) @@ -717,9 +717,10 @@ void SwXMLImport::endDocument() // this method will modify the document directly -> lock SolarMutex SolarMutexGuard aGuard; - if( m_xGraphicResolver ) - m_xGraphicResolver->dispose(); - m_xGraphicResolver.clear(); + if (m_xGraphicStorageHandler) + m_xGraphicStorageHandler->dispose(); + m_xGraphicStorageHandler.clear(); + if( m_xEmbeddedResolver ) m_xEmbeddedResolver->dispose(); m_xEmbeddedResolver.clear(); diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index cd399ea4821f..f9e4f3f27569 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -68,10 +68,10 @@ class SwXMLImport: public SvXMLImport SvXMLTokenMap *m_pDocElemTokenMap; SvXMLTokenMap *m_pTableElemTokenMap; SvXMLTokenMap *m_pTableCellAttrTokenMap; - rtl::Reference<SvXMLGraphicHelper> - m_xGraphicResolver; - rtl::Reference<SvXMLEmbeddedObjectHelper> - m_xEmbeddedResolver; + + rtl::Reference<SvXMLGraphicHelper> m_xGraphicStorageHandler; + + rtl::Reference<SvXMLEmbeddedObjectHelper> m_xEmbeddedResolver; SvXMLItemMapEntriesRef m_xTableItemMap; SvXMLItemMapEntriesRef m_xTableColItemMap; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index f76e7b677710..835b9ea18f80 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -674,11 +674,10 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen if ( xTmpStatus.is() ) mxStatusIndicator = xTmpStatus; - // graphic resolver - uno::Reference<document::XGraphicObjectResolver> xTmpGraphic( - xValue, UNO_QUERY ); - if ( xTmpGraphic.is() ) - mxGraphicResolver = xTmpGraphic; + // graphic storage handler + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(xValue, UNO_QUERY); + if (xGraphicStorageHandler.is()) + mxGraphicStorageHandler = xGraphicStorageHandler; // object resolver uno::Reference<document::XEmbeddedObjectResolver> xTmpObjectResolver( @@ -1254,18 +1253,17 @@ ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) bool bOwnGraphicResolver = false; bool bOwnEmbeddedResolver = false; - if( !mxGraphicResolver.is() || !mxEmbeddedResolver.is() ) + if (!mxGraphicStorageHandler.is() || !mxEmbeddedResolver.is()) { Reference< XMultiServiceFactory > xFactory( mxModel, UNO_QUERY ); if( xFactory.is() ) { try { - if( !mxGraphicResolver.is() ) + if (!mxGraphicStorageHandler.is()) { - mxGraphicResolver.set( - xFactory->createInstance( "com.sun.star.document.ExportGraphicObjectResolver" ), UNO_QUERY); - bOwnGraphicResolver = mxGraphicResolver.is(); + mxGraphicStorageHandler.set(xFactory->createInstance( "com.sun.star.document.ExportGraphicStorageHandler"), UNO_QUERY); + bOwnGraphicResolver = mxGraphicStorageHandler.is(); } if( !mxEmbeddedResolver.is() ) @@ -1441,7 +1439,7 @@ ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) if( bOwnGraphicResolver ) { - Reference< XComponent > xComp( mxGraphicResolver, UNO_QUERY ); + uno::Reference<XComponent> xComp(mxGraphicStorageHandler, UNO_QUERY); xComp->dispose(); } @@ -1880,11 +1878,10 @@ OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference<graphic::XGraphic> cons } else { - uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); - if (mxGraphicResolver.is() && xGraphicStorageHandler.is()) + if (mxGraphicStorageHandler.is()) { if (!(getExportFlags() & SvXMLExportFlags::EMBEDDED)) - sURL = xGraphicStorageHandler->saveGraphicByName(rxGraphic, rOutMimeType, rRequestedName); + sURL = mxGraphicStorageHandler->saveGraphicByName(rxGraphic, rOutMimeType, rRequestedName); } } return sURL; @@ -1892,18 +1889,13 @@ OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference<graphic::XGraphic> cons bool SvXMLExport::GetGraphicMimeTypeFromStream(uno::Reference<graphic::XGraphic> const & rxGraphic, OUString & rOutMimeType) { - if (mxGraphicResolver.is()) + if (mxGraphicStorageHandler.is()) { - uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); - - if (xGraphicStorageHandler.is()) + Reference<XInputStream> xInputStream(mxGraphicStorageHandler->createInputStream(rxGraphic)); + if (xInputStream.is()) { - Reference<XInputStream> xInputStream(xGraphicStorageHandler->createInputStream(rxGraphic)); - if (xInputStream.is()) - { - rOutMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForImageStream(xInputStream); - return true; - } + rOutMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForImageStream(xInputStream); + return true; } } @@ -1913,18 +1905,13 @@ bool SvXMLExport::GetGraphicMimeTypeFromStream(uno::Reference<graphic::XGraphic> bool SvXMLExport::AddEmbeddedXGraphicAsBase64(uno::Reference<graphic::XGraphic> const & rxGraphic) { if ((getExportFlags() & SvXMLExportFlags::EMBEDDED) && - mxGraphicResolver.is()) + mxGraphicStorageHandler.is()) { - uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); - - if (xGraphicStorageHandler.is()) + Reference<XInputStream> xInputStream(mxGraphicStorageHandler->createInputStream(rxGraphic)); + if (xInputStream.is()) { - Reference<XInputStream> xInputStream(xGraphicStorageHandler->createInputStream(rxGraphic)); - if (xInputStream.is()) - { - XMLBase64Export aBase64Exp(*this); - return aBase64Exp.exportOfficeBinaryDataElement(xInputStream); - } + XMLBase64Export aBase64Exp(*this); + return aBase64Exp.exportOfficeBinaryDataElement(xInputStream); } } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 7a08b5656030..9b2b51060341 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -529,20 +529,20 @@ void SAL_CALL SvXMLImport::setNamespaceHandler( const uno::Reference< xml::sax:: void SAL_CALL SvXMLImport::startDocument() { SAL_INFO( "xmloff.core", "{ SvXMLImport::startDocument" ); - if( !mxGraphicResolver.is() || !mxEmbeddedResolver.is() ) + if (!mxGraphicStorageHandler.is() || !mxEmbeddedResolver.is()) { Reference< lang::XMultiServiceFactory > xFactory( mxModel, UNO_QUERY ); if( xFactory.is() ) { try { - if( !mxGraphicResolver.is() ) + if (!mxGraphicStorageHandler.is()) { // #99870# Import... instead of Export... - mxGraphicResolver.set( - xFactory->createInstance("com.sun.star.document.ImportGraphicObjectResolver"), + mxGraphicStorageHandler.set( + xFactory->createInstance("com.sun.star.document.ImportGraphicStorageHandler"), UNO_QUERY); - mpImpl->mbOwnGraphicResolver = mxGraphicResolver.is(); + mpImpl->mbOwnGraphicResolver = mxGraphicStorageHandler.is(); } if( !mxEmbeddedResolver.is() ) @@ -630,7 +630,7 @@ void SAL_CALL SvXMLImport::endDocument() if( mpImpl->mbOwnGraphicResolver ) { - Reference< lang::XComponent > xComp( mxGraphicResolver, UNO_QUERY ); + Reference<lang::XComponent> xComp(mxGraphicStorageHandler, UNO_QUERY); xComp->dispose(); } @@ -1037,10 +1037,9 @@ void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen if( xTmpStatusIndicator.is() ) mxStatusIndicator = xTmpStatusIndicator; - uno::Reference<document::XGraphicObjectResolver> xTmpGraphicResolver( - xValue, UNO_QUERY ); - if( xTmpGraphicResolver.is() ) - mxGraphicResolver = xTmpGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(xValue, UNO_QUERY); + if (xGraphicStorageHandler.is()) + mxGraphicStorageHandler = xGraphicStorageHandler; uno::Reference<document::XEmbeddedObjectResolver> xTmpObjectResolver( xValue, UNO_QUERY ); @@ -1361,13 +1360,12 @@ bool SvXMLImport::IsPackageURL( const OUString& rURL ) const uno::Reference<graphic::XGraphic> SvXMLImport::loadGraphicByURL(OUString const & rURL) { uno::Reference<graphic::XGraphic> xGraphic; - uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); - if (xGraphicStorageHandler.is()) + if (mxGraphicStorageHandler.is()) { if (IsPackageURL(rURL)) { - xGraphic = xGraphicStorageHandler->loadGraphic(rURL); + xGraphic = mxGraphicStorageHandler->loadGraphic(rURL); } else { @@ -1384,11 +1382,10 @@ uno::Reference<graphic::XGraphic> SvXMLImport::loadGraphicByURL(OUString const & uno::Reference<graphic::XGraphic> SvXMLImport::loadGraphicFromBase64(uno::Reference<io::XOutputStream> const & rxOutputStream) { uno::Reference<graphic::XGraphic> xGraphic; - uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); - if (xGraphicStorageHandler.is()) + if (mxGraphicStorageHandler.is()) { - xGraphic = xGraphicStorageHandler->loadGraphicFromOutputStream(rxOutputStream); + xGraphic = mxGraphicStorageHandler->loadGraphicFromOutputStream(rxOutputStream); } return xGraphic; @@ -1397,7 +1394,7 @@ uno::Reference<graphic::XGraphic> SvXMLImport::loadGraphicFromBase64(uno::Refere Reference< XOutputStream > SvXMLImport::GetStreamForGraphicObjectURLFromBase64() { Reference< XOutputStream > xOStm; - Reference< document::XBinaryStreamResolver > xStmResolver( mxGraphicResolver, UNO_QUERY ); + Reference< document::XBinaryStreamResolver > xStmResolver(mxGraphicStorageHandler, UNO_QUERY); if( xStmResolver.is() ) xOStm = xStmResolver->createOutputStream(); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 9c0e71610112..fec77d042c9c 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/table/CellRangeAddress.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> -#include <com/sun/star/document/XGraphicObjectResolver.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <o3tl/any.hxx> diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index b4174a5da6ac..ae6340cd9848 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -63,7 +63,7 @@ #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> #include <com/sun/star/document/XStorageBasedDocument.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/graphic/XGraphic.hpp> @@ -731,10 +731,8 @@ void ElementDescriptor::readImageOrGraphicAttr(OUString const & rAttrName) if ( xDocStorage.is() ) { Reference<XComponentContext> xContext = ::comphelper::getProcessComponentContext(); - uno::Reference<document::XGraphicObjectResolver> xGraphicResolver; - xGraphicResolver.set(document::GraphicObjectResolver::createWithStorage(xContext, xDocStorage->getDocumentStorage())); uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; - xGraphicStorageHandler.set(xGraphicResolver, uno::UNO_QUERY); + xGraphicStorageHandler.set(document::GraphicStorageHandler::createWithStorage(xContext, xDocStorage->getDocumentStorage())); if (xGraphicStorageHandler.is()) { sURL = xGraphicStorageHandler->saveGraphic(xGraphic); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 5b1996259a9c..d78e9a55579e 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> -#include <com/sun/star/document/XGraphicObjectResolver.hpp> #include <com/sun/star/xml/sax/SAXException.hpp> #include <sal/log.hxx> diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index c8c7442b20b8..b2c55a45ef35 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -53,7 +53,6 @@ #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> -#include <com/sun/star/document/XGraphicObjectResolver.hpp> #include <com/sun/star/document/XGraphicStorageHandler.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <com/sun/star/graphic/XGraphic.hpp> @@ -853,16 +852,14 @@ bool ImportContext::importGraphicOrImageProperty( uno::Reference<graphic::XGraphic> xGraphic; - uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; if ( xDocStorage.is() ) { uno::Sequence< Any > aArgs( 1 ); aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); - xGraphicResolver.set( + xGraphicStorageHandler.set( _pImport->getComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext( "com.sun.star.comp.Svx.GraphicImportHelper" , aArgs, _pImport->getComponentContext() ), UNO_QUERY ); - uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler; - xGraphicStorageHandler.set(xGraphicResolver, uno::UNO_QUERY); if (xGraphicStorageHandler.is()) { try |