diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/vba/testvba/testvba.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbahelper.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindows.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheet.cxx | 9 |
5 files changed, 10 insertions, 24 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 7dba3539522b..df3f2ade6650 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -18,6 +18,7 @@ */ #include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> using namespace ::com::sun::star; @@ -2254,11 +2255,7 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument() try { SC_MOD()->SetInSharedDocLoading( true ); - uno::Reference< lang::XMultiServiceFactory > xFactory( - ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XComponentLoader > xLoader( - xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ), - uno::UNO_QUERY_THROW ); + uno::Reference< frame::XDesktop2 > xLoader = frame::Desktop::create( ::comphelper::getProcessComponentContext() ); uno::Sequence < beans::PropertyValue > aArgs( 1 ); aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" )); aArgs[0].Value <<= sal_True; diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx index 8d68d0ddbd23..433dea872408 100644 --- a/sc/source/ui/vba/testvba/testvba.cxx +++ b/sc/source/ui/vba/testvba/testvba.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp> @@ -293,8 +294,7 @@ int main( int argv, char** argc ) Reference<XMultiComponentFactory> xFactory = xCC->getServiceManager(); OSL_TRACE("got servicemanager"); std::cout << "got servicemanager" << std::endl; - Reference<XInterface> desktop = xFactory->createInstanceWithContext( - ascii("com.sun.star.frame.Desktop"), xCC); + Reference<XDesktop2> desktop = Desktop::create(xCC); OSL_TRACE("got desktop"); std::cout << "got desktop" << std::endl; Reference<frame::XComponentLoader> xLoader(desktop, UNO_QUERY_THROW); diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index f8ae29e0ad91..96c1aeb44df0 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/script/Converter.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -270,9 +270,7 @@ getCurrentDocument() throw (uno::RuntimeException) { uno::Reference< uno::XComponentContext > xCtx( comphelper::getProcessComponentContext() ); - uno::Reference<lang::XMultiComponentFactory > xSMgr( - xCtx->getServiceManager() ); - uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop"), xCtx), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(xCtx); xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY ); if ( !xModel.is() ) { diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index b78d8eb1eff3..56ddccf9e9c0 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -21,7 +21,7 @@ #include <boost/unordered_map.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <cppuhelper/implbase3.hxx> #include "vbawindow.hxx" @@ -66,11 +66,7 @@ public: WindowComponentEnumImpl( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) : m_xContext( xContext ) { - uno::Reference< lang::XMultiComponentFactory > xSMgr( - m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - - uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), m_xContext), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_xContext); uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration(); while( mxComponents->hasMoreElements() ) { diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index fac9a46dcf95..3fdc2c8bab22 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -47,7 +47,7 @@ #include <com/sun/star/sheet/XNamedRanges.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/table/XColumnRowRange.hpp> #include <com/sun/star/table/XTableChartsSupplier.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> @@ -160,13 +160,8 @@ openNewDoc(rtl::OUString aSheetName ) { uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); - uno::Reference<lang::XMultiComponentFactory > xServiceManager( - xContext->getServiceManager() ); - uno::Reference <frame::XComponentLoader > xComponentLoader( - xServiceManager->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), - xContext ), uno::UNO_QUERY_THROW ); + uno::Reference <frame::XDesktop2 > xComponentLoader = frame::Desktop::create(xContext); uno::Reference<lang::XComponent > xComponent( xComponentLoader->loadComponentFromURL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/scalc" ) ), |