Kaydet (Commit) 251f1b0b authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Adapt embed::*EmbeddedObjectCreator UNO services to new style

The services already existed, it just did not have an IDL file.
Adapts
  com.sun.star.embed.OOoEmbeddedObjectFactory
  com.sun.star.embed.OLEEmbeddedObjectFactory
  com.sun.star.embed.EmbeddedObjectCreator

Change-Id: I8ba01c7fd956a46c87d02dc7d61bdd5fcdf21ab8
üst 64fc0ccd
......@@ -19,7 +19,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/embed/XLinkageSupport.hpp>
......@@ -360,8 +360,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con
// object was not added until now - should happen only by calling this method from "inside"
//TODO/LATER: it would be good to detect an error when an object should be created already, but isn't (not an "inside" call)
uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
OUString("com.sun.star.embed.EmbeddedObjectCreator") ), uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( xCopy.is() ? 2 : 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
aObjDescr[0].Value <<= pImpl->m_xModel.get();
......@@ -402,8 +401,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde
uno::Reference < embed::XEmbeddedObject > xObj;
try
{
uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( rArgs.getLength() + 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
......@@ -620,8 +618,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Reference < embed::XEmbeddedObject > xObj;
try
{
uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
aObjDescr[0].Value <<= pImpl->m_xModel.get();
......@@ -655,8 +652,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Reference < embed::XEmbeddedObject > xObj;
try
{
uno::Reference < embed::XLinkCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create(::comphelper::getProcessComponentContext());
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
aObjDescr[0].Value <<= pImpl->m_xModel.get();
......@@ -740,10 +736,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
throw uno::RuntimeException();
// create new linked object from the URL the link is based on
uno::Reference < embed::XLinkCreator > xCreator(
::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator") ) ),
uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbeddedObjectCreator > xCreator =
embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aMediaDescr( 1 );
aMediaDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
......@@ -769,10 +763,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
uno::Reference< beans::XPropertySet > xOrigProps( xObj->getComponent(), uno::UNO_QUERY_THROW );
// use object class ID to create a new one and tranfer all the properties
uno::Reference < embed::XEmbedObjectCreator > xCreator(
::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator") ) ),
uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbeddedObjectCreator > xCreator =
embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) );
......
......@@ -20,20 +20,13 @@
#ifndef __XFACTORY_HXX_
#define __XFACTORY_HXX_
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XLinkFactory.hpp>
#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase5.hxx>
#include <comphelper/mimeconfighelper.hxx>
class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper5<
::com::sun::star::embed::XEmbedObjectCreator,
::com::sun::star::embed::XEmbedObjectFactory,
::com::sun::star::embed::XLinkCreator,
::com::sun::star::embed::XLinkFactory,
class OOoEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
......
......@@ -20,6 +20,8 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/EntryInitModes.hpp>
#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
#include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
#include <com/sun/star/embed/OLEEmbeddedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkFactory.hpp>
#include <com/sun/star/document/XTypeDetection.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
......@@ -28,6 +30,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <rtl/logfile.hxx>
#include <comphelper/processfactory.hxx>
#include <xcreator.hxx>
......@@ -258,12 +261,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
if ( !aFilterName.isEmpty() )
{
// the object can be loaded by one of the office application
uno::Reference< embed::XEmbedObjectCreator > xOOoEmbCreator(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoEmbeddedObjectFactory" ) )),
uno::UNO_QUERY );
if ( !xOOoEmbCreator.is() )
throw uno::RuntimeException(); // TODO:
uno::Reference< embed::XEmbeddedObjectCreator > xOOoEmbCreator =
embed::OOoEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
xResult = xOOoEmbCreator->createInstanceInitFromMediaDescriptor( xStorage,
sEntName,
......@@ -281,12 +280,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
// Or for example the typename can be used to detect object type if typedetection
// was also extended.
uno::Reference< embed::XEmbedObjectCreator > xOleEmbCreator(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )),
uno::UNO_QUERY );
if ( !xOleEmbCreator.is() )
throw uno::RuntimeException(); // TODO:
uno::Reference< embed::XEmbeddedObjectCreator > xOleEmbCreator =
embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
xResult = xOleEmbCreator->createInstanceInitFromMediaDescriptor( xStorage, sEntName, aTempMedDescr, lObjArgs );
}
......@@ -371,12 +366,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
if ( !aFilterName.isEmpty() )
{
// the object can be loaded by one of the office application
uno::Reference< embed::XLinkCreator > xOOoLinkCreator(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoEmbeddedObjectFactory" ) )),
uno::UNO_QUERY );
if ( !xOOoLinkCreator.is() )
throw uno::RuntimeException(); // TODO:
uno::Reference< embed::XEmbeddedObjectCreator > xOOoLinkCreator =
embed::OOoEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
xResult = xOOoLinkCreator->createInstanceLink( xStorage,
sEntName,
......@@ -406,12 +397,8 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
static_cast< ::cppu::OWeakObject* >(this) ),
4 );
uno::Reference< embed::XLinkCreator > xLinkCreator(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )),
uno::UNO_QUERY );
if ( !xLinkCreator.is() )
throw uno::RuntimeException(); // TODO:
uno::Reference< embed::XEmbeddedObjectCreator > xLinkCreator =
embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory));
xResult = xLinkCreator->createInstanceLink( xStorage, sEntName, aTempMedDescr, lObjArgs );
}
......
......@@ -20,21 +20,15 @@
#ifndef __XCREATOR_HXX_
#define __XCREATOR_HXX_
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XLinkFactory.hpp>
#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase2.hxx>
#include <comphelper/mimeconfighelper.hxx>
class UNOEmbeddedObjectCreator : public ::cppu::WeakImplHelper5<
::com::sun::star::embed::XEmbedObjectCreator,
::com::sun::star::embed::XEmbedObjectFactory,
::com::sun::star::embed::XLinkCreator,
::com::sun::star::embed::XLinkFactory,
class UNOEmbeddedObjectCreator : public ::cppu::WeakImplHelper2<
::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
......
......@@ -17,9 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/EntryInitModes.hpp>
#include <com/sun/star/embed/OLEEmbeddedObjectFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
......@@ -182,12 +183,7 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
{
if (io.dwFlags & IOF_SELECTCREATENEW)
{
uno::Reference< embed::XEmbedObjectCreator > xEmbCreator(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.EmbeddedObjectCreator" ) )),
uno::UNO_QUERY );
if ( !xEmbCreator.is() )
throw uno::RuntimeException();
uno::Reference< embed::XEmbeddedObjectCreator > xEmbCreator = embed::EmbeddedObjectCreator::create( comphelper::getComponentContext(m_xFactory) );
uno::Sequence< sal_Int8 > aClassID = MimeConfigurationHelper::GetSequenceClassID( io.clsid.Data1,
io.clsid.Data2,
......@@ -221,19 +217,13 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
aMediaDescr[0].Value <<= aFileURL;
// TODO: use config helper for type detection
uno::Reference< embed::XEmbedObjectCreator > xEmbCreator;
uno::Reference< embed::XEmbeddedObjectCreator > xEmbCreator;
::comphelper::MimeConfigurationHelper aHelper( m_xFactory );
if ( aHelper.AddFilterNameCheckOwnFile( aMediaDescr ) )
xEmbCreator = uno::Reference< embed::XEmbedObjectCreator >(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.EmbeddedObjectCreator" ) )),
uno::UNO_QUERY );
xEmbCreator = embed::EmbeddedObjectCreator::create( comphelper::getComponentContext(m_xFactory) );
else
xEmbCreator = uno::Reference< embed::XEmbedObjectCreator >(
m_xFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )),
uno::UNO_QUERY );
xEmbCreator = embed::OLEEmbeddedObjectFactory::create( comphelper::getComponentContext(m_xFactory) );
if ( !xEmbCreator.is() )
throw uno::RuntimeException();
......
......@@ -20,19 +20,15 @@
#ifndef __XFACTORY_HXX_
#define __XFACTORY_HXX_
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XEmbeddedObjectCreator.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase2.hxx>
class OleEmbeddedObjectFactory : public ::cppu::WeakImplHelper4<
::com::sun::star::embed::XEmbedObjectCreator,
::com::sun::star::embed::XEmbedObjectFactory,
::com::sun::star::embed::XLinkCreator,
class OleEmbeddedObjectFactory : public ::cppu::WeakImplHelper2<
::com::sun::star::embed::XEmbeddedObjectCreator,
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
......
......@@ -114,10 +114,13 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing/fr
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\
DocumentCloser \
EmbeddedObjectCreator \
FileSystemStorageFactory \
HatchWindowFactory \
InstanceLocker \
OLESimpleStorage \
OLEEmbeddedObjectFactory \
OOoEmbeddedObjectFactory \
StorageFactory \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/inspection,\
......@@ -2336,6 +2339,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/embed,\
XComponentSupplier \
XEmbedObjectClipboardCreator \
XEmbedObjectCreator \
XEmbeddedObjectCreator \
XEmbedObjectFactory \
XEmbedPersist \
XEmbeddedClient \
......
/* -*- 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_embed_EmbeddedObjectCreator_idl__
#define __com_sun_star_embed_EmbeddedObjectCreator_idl__
#include <com/sun/star/embed/XEmbeddedObjectCreator.idl>
module com { module sun { module star { module embed {
/**
@since LibreOffice 4.1
*/
service EmbeddedObjectCreator : XEmbeddedObjectCreator;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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_embed_OLEEmbeddedObjectFactory_idl__
#define __com_sun_star_embed_OLEEmbeddedObjectFactory_idl__
#include <com/sun/star/embed/XEmbeddedObjectCreator.idl>
module com { module sun { module star { module embed {
/**
@since LibreOffice 4.1
*/
service OLEEmbeddedObjectFactory : XEmbeddedObjectCreator;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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_embed_OOoEmbeddedObjectFactory_idl__
#define __com_sun_star_embed_OOoEmbeddedObjectFactory_idl__
#include <com/sun/star/embed/XEmbeddedObjectCreator.idl>
module com { module sun { module star { module embed {
/**
@since LibreOffice 4.1
*/
service OOoEmbeddedObjectFactory : XEmbeddedObjectCreator;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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_embed_XEmbeddedObjectCreator_idl__
#define __com_sun_star_embed_XEmbeddedObjectCreator_idl__
#include <com/sun/star/embed/XEmbedObjectCreator.idl>
#include <com/sun/star/embed/XEmbedObjectFactory.idl>
#include <com/sun/star/embed/XLinkCreator.idl>
#include <com/sun/star/embed/XLinkFactory.idl>
module com { module sun { module star { module embed {
/**
@since LibreOffice 4.1
*/
interface XEmbeddedObjectCreator
{
interface XEmbedObjectCreator;
interface XEmbedObjectFactory;
interface XLinkCreator;
[optional] interface XLinkFactory;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,7 +20,8 @@
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
#include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
#include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
#include <com/sun/star/embed/XLinkCreator.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
......@@ -279,8 +280,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
aClass, ::rtl::OUString(), xStorage, aName,
......@@ -568,9 +568,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
{
// create object with desired ClassId
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Reference < embed::XLinkCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OOoEmbeddedObjectFactory")) ),
uno::UNO_QUERY_THROW );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
aMediaDescriptor[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
......@@ -701,8 +700,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
// create object with desired ClassId
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
aClass, ::rtl::OUString(), xStorage, aName,
......@@ -833,8 +831,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
// create object with desired ClassId
::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("DummyName"));
uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
uno::Reference < embed::XEmbedObjectCreator > xFactory( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator")) ), uno::UNO_QUERY );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
aClass, ::rtl::OUString(), xStorage, aName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment