fdo#46808, Adapt document::GraphicObjectResolver UNO service to new style
The services already existed, it just did not have an IDL file Change-Id: I245f78c165dbfde11a981efd7033c5c282f4e8ad
This commit is contained in:
parent
4b37df18a1
commit
49cf14a3ca
@ -28,9 +28,9 @@
|
||||
#include <com/sun/star/io/XActiveDataSource.hpp>
|
||||
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
||||
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
|
||||
#include "com/sun/star/resource/XStringResourceWithStorage.hpp"
|
||||
#include "com/sun/star/resource/XStringResourceWithLocation.hpp"
|
||||
#include "com/sun/star/document/XGraphicObjectResolver.hpp"
|
||||
#include <com/sun/star/resource/XStringResourceWithStorage.hpp>
|
||||
#include <com/sun/star/resource/XStringResourceWithLocation.hpp>
|
||||
#include <com/sun/star/document/GraphicObjectResolver.hpp>
|
||||
#include "dlgcont.hxx"
|
||||
#include "sbmodule.hxx"
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
@ -238,17 +238,15 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
|
||||
Reference< io::XInputStream > xInput( xISP->createInputStream() );
|
||||
Reference< XNameContainer > xDialogModel( mxMSF->createInstance
|
||||
( OUString( "com.sun.star.awt.UnoControlDialogModel" ) ) , UNO_QUERY );
|
||||
Reference< XComponentContext > xContext(
|
||||
comphelper::getComponentContext( mxMSF ) );
|
||||
Reference< XComponentContext > xContext( comphelper::getComponentContext( mxMSF ) );
|
||||
::xmlscript::importDialogModel( xInput, xDialogModel, xContext, mxOwnerDocument );
|
||||
std::vector< OUString > vEmbeddedImageURLs;
|
||||
GraphicObject::InspectForGraphicObjectImageURL( Reference< XInterface >( xDialogModel, UNO_QUERY ), vEmbeddedImageURLs );
|
||||
if ( !vEmbeddedImageURLs.empty() )
|
||||
{
|
||||
// Export the images to the storage
|
||||
Sequence< Any > aArgs( 1 );
|
||||
aArgs[ 0 ] <<= xStorage;
|
||||
Reference< document::XGraphicObjectResolver > xGraphicResolver( mxMSF->createInstanceWithArguments( OUString("com.sun.star.comp.Svx.GraphicExportHelper" ), aArgs ), UNO_QUERY );
|
||||
Reference< document::XGraphicObjectResolver > xGraphicResolver =
|
||||
document::GraphicObjectResolver::createWithStorage( xContext, xStorage );
|
||||
std::vector< OUString >::iterator it = vEmbeddedImageURLs.begin();
|
||||
std::vector< OUString >::iterator it_end = vEmbeddedImageURLs.end();
|
||||
if ( xGraphicResolver.is() )
|
||||
|
@ -50,7 +50,7 @@
|
||||
#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/XGraphicObjectResolver.hpp>
|
||||
#include <com/sun/star/document/GraphicObjectResolver.hpp>
|
||||
#include <com/sun/star/container/XNameAccess.hpp>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
@ -619,11 +619,8 @@ sal_Int32 XMLFilter::impl_Export(
|
||||
}
|
||||
}
|
||||
|
||||
uno::Sequence< uno::Any > aGraphicResolverArgs(1);
|
||||
aGraphicResolverArgs[0] <<= xStorage;
|
||||
Reference< document::XGraphicObjectResolver > xGraphicObjectResolver(
|
||||
xServiceFactory->createInstanceWithArguments(
|
||||
C2U("com.sun.star.comp.Svx.GraphicExportHelper"), aGraphicResolverArgs ), uno::UNO_QUERY );
|
||||
Reference< document::XGraphicObjectResolver > xGraphicObjectResolver = document::GraphicObjectResolver::createWithStorage(
|
||||
m_xContext, xStorage );
|
||||
|
||||
// property map for export info set
|
||||
comphelper::PropertyMapEntry aExportInfoMap[] =
|
||||
|
@ -34,6 +34,7 @@
|
||||
#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/embed/EntryInitModes.hpp>
|
||||
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
||||
#include <com/sun/star/embed/XTransactedObject.hpp>
|
||||
@ -435,10 +436,7 @@ void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibrar
|
||||
if ( !vEmbedImgUrls.empty() )
|
||||
{
|
||||
// Export the images to the storage
|
||||
Sequence< Any > aArgs( 1 );
|
||||
aArgs[ 0 ] <<= xTmpPic;
|
||||
Reference< XGraphicObjectResolver > xGraphicResolver(
|
||||
aContext.createComponentWithArguments( "com.sun.star.comp.Svx.GraphicExportHelper", aArgs ), UNO_QUERY );
|
||||
Reference< XGraphicObjectResolver > xGraphicResolver = GraphicObjectResolver::createWithStorage(aContext.getUNOContext(), xTmpPic);
|
||||
std::vector< OUString >::iterator it = vEmbedImgUrls.begin();
|
||||
std::vector< OUString >::iterator it_end = vEmbedImgUrls.end();
|
||||
if ( xGraphicResolver.is() )
|
||||
|
@ -95,6 +95,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/deployment
|
||||
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/document,\
|
||||
DocumentProperties \
|
||||
DocumentRevisionListPersistence \
|
||||
GraphicObjectResolver \
|
||||
OleEmbeddedServerRegistration \
|
||||
OOXMLDocumentPropertiesImporter \
|
||||
))
|
||||
|
42
offapi/com/sun/star/document/GraphicObjectResolver.idl
Normal file
42
offapi/com/sun/star/document/GraphicObjectResolver.idl
Normal file
@ -0,0 +1,42 @@
|
||||
/* -*- 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: */
|
@ -55,7 +55,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/XGraphicObjectResolver.hpp>
|
||||
#include <com/sun/star/document/GraphicObjectResolver.hpp>
|
||||
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
#include <comphelper/processfactory.hxx>
|
||||
@ -700,14 +700,10 @@ void ElementDescriptor::readImageURLAttr( OUString const & rPropName, OUString c
|
||||
Reference< document::XStorageBasedDocument > xDocStorage( _xDocument, UNO_QUERY );
|
||||
if ( xDocStorage.is() )
|
||||
{
|
||||
uno::Sequence< Any > aArgs( 1 );
|
||||
aArgs[ 0 ] <<= xDocStorage->getDocumentStorage();
|
||||
|
||||
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
|
||||
uno::Reference< document::XGraphicObjectResolver > xGraphicResolver;
|
||||
aContext.createComponentWithArguments( "com.sun.star.comp.Svx.GraphicExportHelper" , aArgs, xGraphicResolver );
|
||||
if ( xGraphicResolver.is() )
|
||||
sURL = xGraphicResolver->resolveGraphicObjectURL( sURL );
|
||||
Reference<XComponentContext> xContext = ::comphelper::getProcessComponentContext();
|
||||
uno::Reference< document::XGraphicObjectResolver > xGraphicResolver =
|
||||
document::GraphicObjectResolver::createWithStorage( xContext, xDocStorage->getDocumentStorage() );
|
||||
sURL = xGraphicResolver->resolveGraphicObjectURL( sURL );
|
||||
}
|
||||
}
|
||||
if ( !sURL.isEmpty() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user