diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-07 18:46:43 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-12 18:56:47 +0200 |
commit | 4e6a1615d1a4c81c490cfb479d5e30f4e98adc47 (patch) | |
tree | b9777a74c83f7b8591ee93aa593624c70fdd6bf7 | |
parent | 04716cb9acfde7e247c01d79afde694f8e4f9f7f (diff) |
use XController instead of XFrame where it makes sense
Change-Id: I22990c861c0dd9d9dab3fbdbc35fdb2b51e82005
-rw-r--r-- | include/sfx2/sidebar/ResourceManager.hxx | 10 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarController.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/sidebar/Tools.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/ControllerFactory.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/sidebar/Tools.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/sidebar/UnoDecks.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/sidebar/UnoPanels.cxx | 4 |
9 files changed, 32 insertions, 32 deletions
diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx index 5768db0445b3..568b7f87e593 100644 --- a/include/sfx2/sidebar/ResourceManager.hxx +++ b/include/sfx2/sidebar/ResourceManager.hxx @@ -23,7 +23,7 @@ #include "PanelDescriptor.hxx" #include <sfx2/sidebar/Context.hxx> #include <unotools/confignode.hxx> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XController.hpp> #include <set> #include <boost/shared_ptr.hpp> #include <svtools/miscopt.hxx> @@ -89,13 +89,13 @@ public: DeckContextDescriptorContainer& rDeckDescriptors, const Context& rContext, const bool bIsDocumentReadOnly, - const css::uno::Reference<css::frame::XFrame>& rxFrame); + const css::uno::Reference<css::frame::XController>& rxController); const PanelContextDescriptorContainer& GetMatchingPanels( PanelContextDescriptorContainer& rPanelDescriptors, const Context& rContext, const OUString& rsDeckId, - const css::uno::Reference<css::frame::XFrame>& rxFrame); + const css::uno::Reference<css::frame::XController>& rxController); /** Remember the expansions state per panel and context. This is not persistent past application end. @@ -121,13 +121,13 @@ private: static void ReadContextList(const utl::OConfigurationNode& rNode, ContextList& rContextList, const OUString& rsDefaultMenuCommand); - void ReadLegacyAddons(const css::uno::Reference<css::frame::XFrame>& rxFrame); + void ReadLegacyAddons(const css::uno::Reference<css::frame::XController>& rxController); static utl::OConfigurationTreeRoot GetLegacyAddonRootNode(const OUString& rsModuleName); static void GetToolPanelNodeNames(std::vector<OUString>& rMatchingNames, const utl::OConfigurationTreeRoot& aRoot); static bool IsDeckEnabled(const OUString& rsDeckId, const Context& rContext, - const css::uno::Reference<css::frame::XFrame>& rxFrame); + const css::uno::Reference<css::frame::XController>& rxController); }; } } // end of namespace sfx2::sidebar diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index 29c7d4379edf..78a047865a97 100644 --- a/include/sfx2/sidebar/SidebarController.hxx +++ b/include/sfx2/sidebar/SidebarController.hxx @@ -158,7 +158,7 @@ public: private: typedef ::std::map< - const css::uno::Reference<css::frame::XFrame>, + const css::uno::Reference<css::frame::XController>, css::uno::WeakReference<SidebarController> > SidebarControllerContainer; static SidebarControllerContainer maSidebarControllerContainer; diff --git a/include/sfx2/sidebar/Tools.hxx b/include/sfx2/sidebar/Tools.hxx index 3aff9ea7a022..c6b790975ad8 100644 --- a/include/sfx2/sidebar/Tools.hxx +++ b/include/sfx2/sidebar/Tools.hxx @@ -54,7 +54,7 @@ public: const css::util::URL& rURL); static ::rtl::OUString GetModuleName ( - const css::uno::Reference<css::frame::XFrame>& rxFrame); + const css::uno::Reference<css::frame::XController>& rxFrame); }; diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx index c635751e6809..ff457c298824 100644 --- a/sfx2/source/sidebar/ControllerFactory.cxx +++ b/sfx2/source/sidebar/ControllerFactory.cxx @@ -143,7 +143,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController( { Reference<XComponentContext> xContext = comphelper::getProcessComponentContext(); Reference<frame::XUIControllerFactory> xFactory = frame::theToolbarControllerFactory::get( xContext ); - OUString sModuleName (Tools::GetModuleName(rxFrame)); + OUString sModuleName (Tools::GetModuleName(rxFrame->getController())); if (xFactory.is() && xFactory->hasController(rsCommandName, sModuleName)) { diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 21a6f8bdbfef..93a1b89c904c 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -179,9 +179,9 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch DeckContextDescriptorContainer& rDecks, const Context& rContext, const bool bIsDocumentReadOnly, - const Reference<frame::XFrame>& rxFrame) + const Reference<frame::XController>& rxController) { - ReadLegacyAddons(rxFrame); + ReadLegacyAddons(rxController); std::multimap<sal_Int32,DeckContextDescriptor> aOrderedIds; DeckContainer::const_iterator iDeck; @@ -196,7 +196,7 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch aDeckContextDescriptor.msId = rDeckDescriptor.msId; aDeckContextDescriptor.mbIsEnabled = ! bIsDocumentReadOnly - || IsDeckEnabled(rDeckDescriptor.msId, rContext, rxFrame); + || IsDeckEnabled(rDeckDescriptor.msId, rContext, rxController); aOrderedIds.insert(::std::multimap<sal_Int32,DeckContextDescriptor>::value_type( rDeckDescriptor.mnOrderIndex, aDeckContextDescriptor)); @@ -215,9 +215,9 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc PanelContextDescriptorContainer& rPanelIds, const Context& rContext, const OUString& rsDeckId, - const Reference<frame::XFrame>& rxFrame) + const Reference<frame::XController>& rxController) { - ReadLegacyAddons(rxFrame); + ReadLegacyAddons(rxController); std::multimap<sal_Int32, PanelContextDescriptor> aOrderedIds; PanelContainer::const_iterator iPanel; @@ -485,10 +485,10 @@ void ResourceManager::ReadContextList ( } } -void ResourceManager::ReadLegacyAddons (const Reference<frame::XFrame>& rxFrame) +void ResourceManager::ReadLegacyAddons (const Reference<frame::XController>& rxController) { // Get module name for given frame. - OUString sModuleName (Tools::GetModuleName(rxFrame)); + OUString sModuleName (Tools::GetModuleName(rxController)); if (sModuleName.getLength() == 0) return; if (maProcessedApplications.find(sModuleName) != maProcessedApplications.end()) @@ -625,14 +625,14 @@ void ResourceManager::GetToolPanelNodeNames ( bool ResourceManager::IsDeckEnabled ( const OUString& rsDeckId, const Context& rContext, - const Reference<frame::XFrame>& rxFrame) + const Reference<frame::XController>& rxController) { // Check if any panel that matches the current context can be // displayed. ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors; ResourceManager::Instance().GetMatchingPanels(aPanelContextDescriptors, - rContext, rsDeckId, rxFrame); + rContext, rsDeckId, rxController); ResourceManager::PanelContextDescriptorContainer::const_iterator iPanel; for (iPanel = aPanelContextDescriptors.begin(); iPanel != aPanelContextDescriptors.end(); ++iPanel) diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 867aa2008aba..d98a5b53d52b 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -153,7 +153,7 @@ SidebarController::SidebarController ( WeakReference<SidebarController> xWeakController (this); maSidebarControllerContainer.insert( SidebarControllerContainer::value_type( - rxFrame, + rxFrame->getController(), xWeakController)); } @@ -164,7 +164,7 @@ SidebarController::~SidebarController() SidebarController* SidebarController::GetSidebarControllerForFrame ( const css::uno::Reference<css::frame::XFrame>& rxFrame) { - SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(rxFrame)); + SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(rxFrame->getController())); if (iEntry == maSidebarControllerContainer.end()) return NULL; @@ -190,7 +190,7 @@ void SAL_CALL SidebarController::disposing() aDecks, GetCurrentContext(), IsDocumentReadOnly(), - mxFrame); + mxFrame->getController()); for (ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck(aDecks.begin()), iEnd(aDecks.end()); @@ -202,7 +202,7 @@ void SAL_CALL SidebarController::disposing() aDeck.disposeAndClear(); } - SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame)); + SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame->getController())); if (iEntry != maSidebarControllerContainer.end()) maSidebarControllerContainer.erase(iEntry); @@ -425,7 +425,7 @@ void SidebarController::UpdateConfigurations() aDecks, maCurrentContext, mbIsDocumentReadOnly, - mxFrame); + mxFrame->getController()); // Notify the tab bar about the updated set of decks. mpTabBar->SetDecks(aDecks); @@ -564,7 +564,7 @@ void SidebarController::SwitchToDeck ( aPanelContextDescriptors, rContext, rDeckDescriptor.msId, - mxFrame); + mxFrame->getController()); if (aPanelContextDescriptors.empty()) { @@ -1219,7 +1219,7 @@ ResourceManager::DeckContextDescriptorContainer SidebarController::GetMatchingDe mpResourceManager->GetMatchingDecks (aDecks, GetCurrentContext(), IsDocumentReadOnly(), - mxFrame); + mxFrame->getController()); return aDecks; } @@ -1230,7 +1230,7 @@ ResourceManager::PanelContextDescriptorContainer SidebarController::GetMatchingP mpResourceManager->GetMatchingPanels(aPanels, GetCurrentContext(), rDeckId, - mxFrame); + mxFrame->getController()); return aPanels; } diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx index fa9b256f6e0a..0e62e6d309f9 100644 --- a/sfx2/source/sidebar/Tools.cxx +++ b/sfx2/source/sidebar/Tools.cxx @@ -146,16 +146,16 @@ Reference<frame::XDispatch> Tools::GetDispatch ( } ::rtl::OUString Tools::GetModuleName ( - const css::uno::Reference<css::frame::XFrame>& rxFrame) + const css::uno::Reference<css::frame::XController>& rxController) { - if ( ! rxFrame.is() || ! rxFrame->getController().is()) + if (!rxController.is()) return ::rtl::OUString(); try { const Reference<XComponentContext> xComponentContext (::comphelper::getProcessComponentContext()); const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xComponentContext ); - return xModuleManager->identify(rxFrame); + return xModuleManager->identify(rxController); } catch (const Exception&) { diff --git a/sfx2/source/sidebar/UnoDecks.cxx b/sfx2/source/sidebar/UnoDecks.cxx index 30882ea8511a..42965dae73ed 100644 --- a/sfx2/source/sidebar/UnoDecks.cxx +++ b/sfx2/source/sidebar/UnoDecks.cxx @@ -68,7 +68,7 @@ uno::Sequence< OUString > SAL_CALL SfxUnoDecks::getElementNames() aDecks, pSidebarController->GetCurrentContext(), pSidebarController->IsDocumentReadOnly(), - xFrame); + xFrame->getController()); deckList.realloc(aDecks.size()); @@ -104,7 +104,7 @@ sal_Bool SAL_CALL SfxUnoDecks::hasByName( const OUString& aName ) aDecks, pSidebarController->GetCurrentContext(), pSidebarController->IsDocumentReadOnly(), - xFrame); + xFrame->getController()); for (ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck(aDecks.begin()), iEnd(aDecks.end()); diff --git a/sfx2/source/sidebar/UnoPanels.cxx b/sfx2/source/sidebar/UnoPanels.cxx index 8075667377b7..0e712d9623a0 100644 --- a/sfx2/source/sidebar/UnoPanels.cxx +++ b/sfx2/source/sidebar/UnoPanels.cxx @@ -81,7 +81,7 @@ uno::Sequence< OUString > SAL_CALL SfxUnoPanels::getElementNames() pSidebarController->GetResourceManager()->GetMatchingPanels(aPanels, pSidebarController->GetCurrentContext(), mDeckId, - xFrame); + xFrame->getController()); panelList.realloc(aPanels.size()); @@ -114,7 +114,7 @@ sal_Bool SAL_CALL SfxUnoPanels::hasByName( const OUString& aName ) pSidebarController->GetResourceManager()->GetMatchingPanels(aPanels, pSidebarController->GetCurrentContext(), mDeckId, - xFrame); + xFrame->getController()); for (ResourceManager::PanelContextDescriptorContainer::const_iterator iPanel(aPanels.begin()), iEnd(aPanels.end()); |