diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-05 14:55:34 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-05 14:56:19 +0200 |
commit | 24391f605703bda1bcfa99ef06e5a73c6b52d267 (patch) | |
tree | 3a4cf9732c8a8c82b56cdc038e5dfda857cdc518 /sfx2 | |
parent | fdo#46808, Adapt frame::ModuleManager UNO service to new style (diff) | |
download | core-24391f605703bda1bcfa99ef06e5a73c6b52d267.tar.gz core-24391f605703bda1bcfa99ef06e5a73c6b52d267.zip |
Some clean up of previous commit
Change-Id: I14097acf09e9663af7d7abc5f0c9d481880ecc51
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/guisaveas.hxx | 9 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/imagemgr.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/dialog/recfloat.cxx | 17 | ||||
-rw-r--r-- | sfx2/source/dialog/taskpane.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/inc/templdgi.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 11 |
14 files changed, 55 insertions, 95 deletions
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx index 6491332a4171..689c237a9b52 100644 --- a/sfx2/inc/guisaveas.hxx +++ b/sfx2/inc/guisaveas.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/frame/XModuleManager2.hpp> #include <comphelper/sequenceashashmap.hxx> #include <sfx2/signaturestate.hxx> @@ -50,15 +50,12 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xFilterCFG; ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > m_xFilterQuery; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xNamedModManager; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleManager; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory(); ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetFilterConfiguration(); ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > GetFilterQuery(); - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > GetModuleManager(); - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetNamedModuleManager(); - + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > GetModuleManager(); public: SfxStoringHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 4d9d216dc027..6135f7bfa6e3 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -935,7 +935,7 @@ namespace Reference < XFramesSupplier > xSupplier( i_rContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); Reference < XIndexAccess > xContainer( xSupplier->getFrames(), UNO_QUERY_THROW ); - Reference< XModuleManager > xCheck( ModuleManager::create(i_rContext.getUNOContext()), UNO_QUERY_THROW ); + Reference< XModuleManager2 > xCheck( ModuleManager::create(i_rContext.getUNOContext()) ); sal_Int32 nCount = xContainer->getCount(); for ( sal_Int32 i=0; i<nCount; ++i ) diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index 032e6355bd13..b8f996662cb2 100644 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -142,15 +142,13 @@ Image SAL_CALL GetImage( } } - static WeakReference< XModuleManager > m_xModuleManager; + static WeakReference< XModuleManager2 > m_xModuleManager; - Reference< XModuleManager > xModuleManager = m_xModuleManager; + Reference< XModuleManager2 > xModuleManager = m_xModuleManager; if ( !xModuleManager.is() ) { - xModuleManager = Reference< XModuleManager >( - ModuleManager::create(::comphelper::getProcessComponentContext()), - UNO_QUERY ); + xModuleManager = ModuleManager::create(::comphelper::getProcessComponentContext()); m_xModuleManager = xModuleManager; } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 217538300969..f2d86c2520fa 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <toolkit/helper/vclunohelper.hxx> @@ -415,13 +414,13 @@ SfxHelp::~SfxHelp() { ::rtl::OUString sIdentifier; Reference < XFrame > xCurrentFrame; - Reference < XModuleManager > xModuleManager( ModuleManager::create(::comphelper::getProcessComponentContext()), UNO_QUERY ); + Reference < XModuleManager2 > xModuleManager( ModuleManager::create(::comphelper::getProcessComponentContext()) ); Reference < XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); if ( xDesktop.is() ) xCurrentFrame = xDesktop->getCurrentFrame(); - if ( xCurrentFrame.is() && xModuleManager.is() ) + if ( xCurrentFrame.is() ) { try { @@ -450,12 +449,10 @@ String SfxHelp::GetHelpModuleName_Impl() { try { - Reference < XModuleManager > xModuleManager( - ModuleManager::create(::comphelper::getProcessComponentContext()), UNO_QUERY ); + Reference < XModuleManager2 > xModuleManager( + ModuleManager::create(::comphelper::getProcessComponentContext()) ); Sequence< PropertyValue > lProps; - Reference< ::com::sun::star::container::XNameAccess > xCont( xModuleManager, UNO_QUERY); - if ( xCont.is() ) - xCont->getByName( aModuleIdentifier ) >>= lProps; + xModuleManager->getByName( aModuleIdentifier ) >>= lProps; for ( sal_Int32 i = 0; i < lProps.getLength(); ++i ) { if ( lProps[i].Name == "ooSetupFactoryShortName" ) diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 1bcf9866fba3..e10da5d97852 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -176,14 +176,12 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , uno::UNO_QUERY ); } - static uno::WeakReference< frame::XModuleManager > m_xModuleManager; + static uno::WeakReference< frame::XModuleManager2 > m_xModuleManager; - uno::Reference< frame::XModuleManager > xModuleManager( m_xModuleManager ); + uno::Reference< frame::XModuleManager2 > xModuleManager( m_xModuleManager ); if ( !xModuleManager.is() ) { - xModuleManager = uno::Reference< frame::XModuleManager >( - frame::ModuleManager::create(comphelper::ComponentContext(xServiceManager).getUNOContext()), - uno::UNO_QUERY ); + xModuleManager = frame::ModuleManager::create(comphelper::ComponentContext(xServiceManager).getUNOContext()); m_xModuleManager = xModuleManager; } diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 9465fa0a4d6a..813683ba941a 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -307,7 +307,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( if (!xContext.is()) return eRet; - css::uno::Reference< css::frame::XModuleManager > xModuleManager( css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW ); + css::uno::Reference< css::frame::XModuleManager2 > xModuleManager( css::frame::ModuleManager::create(xContext) ); rtl::OUString aModule; try @@ -428,18 +428,17 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( if ( !bHasLocation || aFilterName.isEmpty()) { // Retrieve the user defined default filter - css::uno::Reference< css::container::XNameAccess > xNameAccess( xModuleManager, css::uno::UNO_QUERY ); try { - ::comphelper::SequenceAsHashMap aFilterPropsHM( xNameAccess->getByName( aModule ) ); + ::comphelper::SequenceAsHashMap aFilterPropsHM( xModuleManager->getByName( aModule ) ); aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( ::rtl::OUString("ooSetupFactoryDefaultFilter"), ::rtl::OUString() ); - css::uno::Reference< css::container::XNameAccess > xNameAccess2( + css::uno::Reference< css::container::XNameAccess > xNameAccess( xContainerQuery, css::uno::UNO_QUERY ); - if ( xNameAccess2.is() ) + if ( xNameAccess.is() ) { - ::comphelper::SequenceAsHashMap aFilterPropsHM2( xNameAccess2->getByName( aFilterName ) ); + ::comphelper::SequenceAsHashMap aFilterPropsHM2( xNameAccess->getByName( aFilterName ) ); aTypeName = aFilterPropsHM2.getUnpackedValueOrDefault( ::rtl::OUString("Type"), ::rtl::OUString() ); diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index fb30ecc42f1b..edb28dc22818 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -47,11 +47,11 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c uno::Reference< container::XNameAccess > xUICommandLabels; uno::Reference< uno::XComponentContext > xContext; uno::Reference< container::XNameAccess > xUICommandDescription; - uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager; + uno::Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager; static uno::WeakReference< uno::XComponentContext > xTmpContext; static uno::WeakReference< container::XNameAccess > xTmpNameAccess; - static uno::WeakReference< ::com::sun::star::frame::XModuleManager > xTmpModuleMgr; + static uno::WeakReference< ::com::sun::star::frame::XModuleManager2 > xTmpModuleMgr; xContext = xTmpContext; if ( !xContext.is() ) @@ -63,14 +63,14 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c xUICommandDescription = xTmpNameAccess; if ( !xUICommandDescription.is() ) { - xUICommandDescription = uno::Reference< container::XNameAccess >( ui::UICommandDescription::create(xContext) ); + xUICommandDescription = ui::UICommandDescription::create(xContext); xTmpNameAccess = xUICommandDescription; } xModuleManager = xTmpModuleMgr; if ( !xModuleManager.is() ) { - xModuleManager = uno::Reference< frame::XModuleManager >( frame::ModuleManager::create(xContext), uno::UNO_QUERY_THROW ); + xModuleManager = frame::ModuleManager::create(xContext); xTmpModuleMgr = xModuleManager; } @@ -85,12 +85,9 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c { } - if ( xUICommandDescription.is() ) - { - uno::Any a = xUICommandDescription->getByName( aModuleIdentifier ); - uno::Reference< container::XNameAccess > xUICommands; - a >>= xUICommandLabels; - } + uno::Any a = xUICommandDescription->getByName( aModuleIdentifier ); + uno::Reference< container::XNameAccess > xUICommands; + a >>= xUICommandLabels; } catch ( uno::Exception& ) { diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 2f8e90476c3c..fa73b7523b2e 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -72,13 +72,12 @@ namespace sfx2 using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; using ::com::sun::star::frame::ModuleManager; - using ::com::sun::star::frame::XModuleManager; + using ::com::sun::star::frame::XModuleManager2; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::ui::XToolPanel; using ::com::sun::star::ui::XUIElementFactory; using ::com::sun::star::ui::XUIElement; using ::com::sun::star::awt::XWindow; - using ::com::sun::star::frame::XModuleManager; using ::com::sun::star::frame::XFrame; using ::com::sun::star::lang::XComponent; using ::com::sun::star::graphic::XGraphicProvider; @@ -101,7 +100,7 @@ namespace sfx2 ::rtl::OUStringBuffer aPathComposer; try { - const Reference< XNameAccess > xModuleAccess( ModuleManager::create(aContext.getUNOContext()), UNO_QUERY_THROW ); + const Reference< XModuleManager2 > xModuleAccess( ModuleManager::create(aContext.getUNOContext()) ); const ::comphelper::NamedValueCollection aModuleProps( xModuleAccess->getByName( i_rModuleIdentifier ) ); const ::rtl::OUString sWindowStateRef( aModuleProps.getOrDefault( "ooSetupFactoryWindowStateConfigRef", ::rtl::OUString() ) ); @@ -129,7 +128,7 @@ namespace sfx2 try { const Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - const Reference< XModuleManager > xModuleManager( ModuleManager::create(xContext), UNO_QUERY_THROW ); + const Reference< XModuleManager2 > xModuleManager( ModuleManager::create(xContext) ); sModuleName = xModuleManager->identify( i_rDocumentFrame ); } catch( const Exception& ) diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 64a242cfbee8..7e994dcfd9fb 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -745,7 +745,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx pStyleSheetPool ( NULL ), pTreeBox ( NULL ), pCurObjShell ( NULL ), - xModuleManager ( frame::ModuleManager::create(::comphelper::getProcessComponentContext()), UNO_QUERY ), + xModuleManager ( frame::ModuleManager::create(::comphelper::getProcessComponentContext()) ), m_pDeletionWatcher ( NULL ), aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH ), @@ -1876,7 +1876,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry) //------------------------------------------------------------------------- -static rtl::OUString getModuleIdentifier( const Reference< XModuleManager >& i_xModMgr, SfxObjectShell* i_pObjSh ) +static rtl::OUString getModuleIdentifier( const Reference< XModuleManager2 >& i_xModMgr, SfxObjectShell* i_pObjSh ) { OSL_ENSURE( i_xModMgr.is(), "getModuleIdentifier(): no XModuleManager" ); OSL_ENSURE( i_pObjSh, "getModuleIdentifier(): no ObjectShell" ); @@ -1907,14 +1907,10 @@ sal_Int32 SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter( SfxObjectShell* sal_Int32 nFilter = -1; Sequence< PropertyValue > lProps; - Reference< ::com::sun::star::container::XNameAccess > xContainer( xModuleManager, UNO_QUERY ); - if ( xContainer.is() ) - { - ::comphelper::SequenceAsHashMap aFactoryProps( - xContainer->getByName( getModuleIdentifier( xModuleManager, i_pObjSh ) ) ); - sal_Int32 nDefault = -1; - nFilter = aFactoryProps.getUnpackedValueOrDefault( DEFINE_CONST_UNICODE("ooSetupFactoryStyleFilter"), nDefault ); - } + ::comphelper::SequenceAsHashMap aFactoryProps( + xModuleManager->getByName( getModuleIdentifier( xModuleManager, i_pObjSh ) ) ); + sal_Int32 nDefault = -1; + nFilter = aFactoryProps.getUnpackedValueOrDefault( DEFINE_CONST_UNICODE("ooSetupFactoryStyleFilter"), nDefault ); return nFilter; } @@ -1924,14 +1920,10 @@ sal_Int32 SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter( SfxObjectShell* void SfxCommonTemplateDialog_Impl::SaveFactoryStyleFilter( SfxObjectShell* i_pObjSh, sal_Int32 i_nFilter ) { OSL_ENSURE( i_pObjSh, "SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter(): no ObjectShell" ); - Reference< ::com::sun::star::container::XNameReplace > xContainer( xModuleManager, UNO_QUERY ); - if ( xContainer.is() ) - { - Sequence< PropertyValue > lProps(1); - lProps[0].Name = DEFINE_CONST_UNICODE("ooSetupFactoryStyleFilter"); - lProps[0].Value = makeAny( i_nFilter );; - xContainer->replaceByName( getModuleIdentifier( xModuleManager, i_pObjSh ), makeAny( lProps ) ); - } + Sequence< PropertyValue > lProps(1); + lProps[0].Name = DEFINE_CONST_UNICODE("ooSetupFactoryStyleFilter"); + lProps[0].Value = makeAny( i_nFilter );; + xModuleManager->replaceByName( getModuleIdentifier( xModuleManager, i_pObjSh ), makeAny( lProps ) ); } //------------------------------------------------------------------------- diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 135ef0bc7920..94eea2b2b4e4 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -386,9 +386,8 @@ String SfxObjectFactory::GetModuleName() const { css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - css::uno::Reference< css::container::XNameAccess > xModuleManager( - css::frame::ModuleManager::create(xContext), - css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XModuleManager2 > xModuleManager( + css::frame::ModuleManager::create(xContext)); ::rtl::OUString sDocService(GetDocumentServiceName()); ::comphelper::SequenceAsHashMap aPropSet( xModuleManager->getByName(sDocService) ); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 1ea6af05ced6..1218562121ec 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1844,9 +1844,8 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, throw uno::RuntimeException(); // get document service name - uno::Reference< frame::XModuleManager > xModuleManager( - frame::ModuleManager::create(comphelper::ComponentContext(xFactory).getUNOContext()), - uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModuleManager2 > xModuleManager( + frame::ModuleManager::create(comphelper::ComponentContext(xFactory).getUNOContext()) ); sDocServiceName = xModuleManager->identify( uno::Reference< uno::XInterface >( rStorable, uno::UNO_QUERY ) ); if ( sDocServiceName.isEmpty() ) throw uno::RuntimeException(); diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 3af0dd378252..133cf6c6d61e 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -416,7 +416,7 @@ const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetModuleProps() if ( !m_pModulePropsHM ) { uno::Sequence< beans::PropertyValue > aModuleProps; - m_pOwner->GetNamedModuleManager()->getByName( GetModuleName() ) >>= aModuleProps; + m_pOwner->GetModuleManager()->getByName( GetModuleName() ) >>= aModuleProps; if ( !aModuleProps.getLength() ) throw uno::RuntimeException(); // TODO; m_pModulePropsHM = new ::comphelper::SequenceAsHashMap( aModuleProps ); @@ -1275,32 +1275,18 @@ uno::Reference< container::XContainerQuery > SfxStoringHelper::GetFilterQuery() } //------------------------------------------------------------------------- -uno::Reference< ::com::sun::star::frame::XModuleManager > SfxStoringHelper::GetModuleManager() +uno::Reference< ::com::sun::star::frame::XModuleManager2 > SfxStoringHelper::GetModuleManager() { if ( !m_xModuleManager.is() ) { - m_xModuleManager = uno::Reference< ::com::sun::star::frame::XModuleManager >( - frame::ModuleManager::create(comphelper::ComponentContext(GetServiceFactory()).getUNOContext()), - uno::UNO_QUERY_THROW ); + m_xModuleManager = frame::ModuleManager::create( + comphelper::ComponentContext(GetServiceFactory()).getUNOContext()); } return m_xModuleManager; } //------------------------------------------------------------------------- -uno::Reference< container::XNameAccess > SfxStoringHelper::GetNamedModuleManager() -{ - if ( !m_xNamedModManager.is() ) - { - m_xNamedModManager = uno::Reference< container::XNameAccess >( GetModuleManager(), uno::UNO_QUERY ); - if ( !m_xNamedModManager.is() ) - throw uno::RuntimeException(); - } - - return m_xNamedModManager; -} - -//------------------------------------------------------------------------- sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xModel, const ::rtl::OUString& aSlotName, uno::Sequence< beans::PropertyValue >& aArgsSequence, diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index a95c19e12104..0cc98f327bf4 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -47,7 +47,7 @@ class SfxCommonTemplateDialog_Impl; class SfxTemplateDialogWrapper; class SfxDockingWindow; -namespace com { namespace sun { namespace star { namespace frame { class XModuleManager; } } } } +namespace com { namespace sun { namespace star { namespace frame { class XModuleManager2; } } } } // class DropListBox_Impl ------------------------------------------------ @@ -138,7 +138,7 @@ protected: SfxStyleSheetBasePool* pStyleSheetPool; SvTreeListBox* pTreeBox; SfxObjectShell* pCurObjShell; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager; DeletionWatcher* m_pDeletionWatcher; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 8ea9415164c3..0a4a0def55e5 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -224,11 +224,11 @@ static ::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& rCommandURL, const css::uno::Reference< css::frame::XFrame >& rFrame ) { - static css::uno::WeakReference< frame::XModuleManager > s_xModuleManager; + static css::uno::WeakReference< frame::XModuleManager2 > s_xModuleManager; static css::uno::WeakReference< container::XNameAccess > s_xNameAccess; ::rtl::OUString aLabel; - css::uno::Reference< css::frame::XModuleManager > xModuleManager( s_xModuleManager ); + css::uno::Reference< css::frame::XModuleManager2 > xModuleManager( s_xModuleManager ); css::uno::Reference< css::container::XNameAccess > xNameAccess( s_xNameAccess ); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( ::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW); @@ -239,8 +239,7 @@ static ::rtl::OUString RetrieveLabelFromCommand( { if ( !xModuleManager.is() ) { - xModuleManager = css::uno::Reference< css::frame::XModuleManager >( - css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW); + xModuleManager = css::frame::ModuleManager::create(xContext); s_xModuleManager = xModuleManager; } @@ -366,7 +365,7 @@ enum ETypeFamily { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR (::comphelper::getProcessServiceFactory() , css::uno::UNO_QUERY_THROW); css::uno::Reference< css::uno::XComponentContext > xContext (::comphelper::getProcessComponentContext() , css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::frame::XModuleManager > xModuleManager(css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XModuleManager2 > xModuleManager(css::frame::ModuleManager::create(xContext)); ::rtl::OUString sModule = xModuleManager->identify(xFrame); ::rtl::OUString sType ; @@ -628,7 +627,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) css::uno::Reference< css::frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); css::uno::Reference< css::frame::XModel > xModel; - css::uno::Reference< css::frame::XModuleManager > xModuleManager( css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW ); + css::uno::Reference< css::frame::XModuleManager2 > xModuleManager( css::frame::ModuleManager::create(xContext) ); rtl::OUString aModule; try |