From 10e4528e8cb9818e7b8fcef8b1e96985f8b28640 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Tue, 6 Mar 2018 12:17:07 +0100 Subject: tdf#115806: Remember last active deck also on context switch within 1 application Change-Id: Icab6dea9f9a7895732c41e6d96b9d4546cf0001f Reviewed-on: https://gerrit.libreoffice.org/51530 Tested-by: Jenkins Reviewed-by: Katarina Behrens --- sfx2/source/sidebar/ResourceManager.cxx | 5 +++++ sfx2/source/sidebar/SidebarController.cxx | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'sfx2/source') 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() && -- cgit