From 891b770e42455ad7c2ea1a4137e67d4e7906a533 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Sun, 14 Oct 2012 12:46:28 +0200 Subject: mbIsEnabled is always true Change-Id: I473db13d6df401fffc6e161314202446ad4d1333 --- sd/source/ui/framework/module/ResourceManager.cxx | 37 ++++++++++------------- sd/source/ui/framework/module/ResourceManager.hxx | 1 - 2 files changed, 16 insertions(+), 22 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/framework/module/ResourceManager.cxx b/sd/source/ui/framework/module/ResourceManager.cxx index 49a40be984d0..c0b07c71bfeb 100644 --- a/sd/source/ui/framework/module/ResourceManager.cxx +++ b/sd/source/ui/framework/module/ResourceManager.cxx @@ -65,8 +65,7 @@ ResourceManager::ResourceManager ( mxResourceId(rxResourceId), mxMainViewAnchorId(FrameworkHelper::Instance(rxController)->CreateResourceId( FrameworkHelper::msCenterPaneURL)), - msCurrentMainViewURL(), - mbIsEnabled(true) + msCurrentMainViewURL() { Reference xControllerManager (rxController, UNO_QUERY); if (xControllerManager.is()) @@ -190,8 +189,7 @@ void ResourceManager::UpdateForMainViewShell (void) { ConfigurationController::Lock aLock (mxConfigurationController); - if (mbIsEnabled - && mpActiveMainViewContainer->find(msCurrentMainViewURL) + if (mpActiveMainViewContainer->find(msCurrentMainViewURL) != mpActiveMainViewContainer->end()) { // Activate resource. @@ -232,25 +230,22 @@ void ResourceManager::HandleResourceRequest( bool bActivation, const Reference& rxConfiguration) { - if (mbIsEnabled) + Sequence > aCenterViews = rxConfiguration->getResources( + FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL), + FrameworkHelper::msViewURLPrefix, + AnchorBindingMode_DIRECT); + if (aCenterViews.getLength() == 1) { - Sequence > aCenterViews = rxConfiguration->getResources( - FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL), - FrameworkHelper::msViewURLPrefix, - AnchorBindingMode_DIRECT); - if (aCenterViews.getLength() == 1) + if (bActivation) { - if (bActivation) - { - mpActiveMainViewContainer->insert(aCenterViews[0]->getResourceURL()); - } - else - { - MainViewContainer::iterator iElement ( - mpActiveMainViewContainer->find(aCenterViews[0]->getResourceURL())); - if (iElement != mpActiveMainViewContainer->end()) - mpActiveMainViewContainer->erase(iElement); - } + mpActiveMainViewContainer->insert(aCenterViews[0]->getResourceURL()); + } + else + { + MainViewContainer::iterator iElement ( + mpActiveMainViewContainer->find(aCenterViews[0]->getResourceURL())); + if (iElement != mpActiveMainViewContainer->end()) + mpActiveMainViewContainer->erase(iElement); } } } diff --git a/sd/source/ui/framework/module/ResourceManager.hxx b/sd/source/ui/framework/module/ResourceManager.hxx index c206877454cf..60da4dd1609d 100644 --- a/sd/source/ui/framework/module/ResourceManager.hxx +++ b/sd/source/ui/framework/module/ResourceManager.hxx @@ -94,7 +94,6 @@ private: css::uno::Reference mxMainViewAnchorId; ::rtl::OUString msCurrentMainViewURL; - bool mbIsEnabled; void HandleMainViewSwitch ( const ::rtl::OUString& rsViewURL, -- cgit