diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-08 14:29:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-15 09:56:03 +0200 |
commit | 251f1b0b38be7d1267339898e44e320f05849e22 (patch) | |
tree | bb6568b4a42879743fb91c5b03c54654ffb53cac /embeddedobj/source/general | |
parent | 64fc0ccde17bbe80fb25f9e07ba68f6aa304c3ef (diff) |
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
Diffstat (limited to 'embeddedobj/source/general')
-rw-r--r-- | embeddedobj/source/general/xcreator.cxx | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx index 599fc7ce2df2..83d9b3e527ec 100644 --- a/embeddedobj/source/general/xcreator.cxx +++ b/embeddedobj/source/general/xcreator.cxx @@ -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 ); } |