diff options
-rw-r--r-- | include/sfx2/sidebar/ResourceManager.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx index 0b8a3ea6495b..0e86c1f96c70 100644 --- a/include/sfx2/sidebar/ResourceManager.hxx +++ b/include/sfx2/sidebar/ResourceManager.hxx @@ -86,6 +86,7 @@ public: const css::uno::Reference<css::frame::XController>& rxController); const OUString& GetLastActiveDeck( const Context& rContext ); + void SetLastActiveDeck( const Context& rContext, const OUString& rsDeckId ); /** Remember the expansions state per panel and context. */ diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 7f77303833b6..5a4d6082285c 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -236,6 +236,11 @@ const OUString& ResourceManager::GetLastActiveDeck( const Context& rContext ) return maLastActiveDecks[rContext.msApplication]; } +void ResourceManager::SetLastActiveDeck( const Context& rContext, const OUString &rsDeckId ) +{ + maLastActiveDecks[rContext.msApplication] = rsDeckId; +} + void ResourceManager::ReadDeckList() { const utl::OConfigurationTreeRoot aDeckRootNode( diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index c57fbe2040c6..ebe568093772 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -437,8 +437,12 @@ void SidebarController::UpdateConfigurations() || mnRequestedForceFlags!=SwitchFlag_NoForce) { - if (maCurrentContext.msApplication != "none") + if ((maCurrentContext.msApplication != "none") && + !maCurrentContext.msApplication.isEmpty()) + { mpResourceManager->SaveDecksSettings(maCurrentContext); + mpResourceManager->SetLastActiveDeck(maCurrentContext, msCurrentDeckId); + } // get last active deck for this application on first update if (!maRequestedContext.msApplication.isEmpty() && |