diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-03-06 12:17:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-12 17:19:45 +0200 |
commit | afaa944633cb94205fb835c1d93775fa51ead749 (patch) | |
tree | b07c3a8aea487481760c074d3b3946ee4462e586 | |
parent | tdf#116563: floating windows must get input focus at some point (diff) | |
download | core-afaa944633cb94205fb835c1d93775fa51ead749.tar.gz core-afaa944633cb94205fb835c1d93775fa51ead749.zip |
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 <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
(cherry picked from commit 10e4528e8cb9818e7b8fcef8b1e96985f8b28640)
Reviewed-on: https://gerrit.libreoffice.org/52011
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 ead0ce7d7f11..9267f296b17d 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -254,6 +254,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 5752120038a4..78efa83ed087 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() && |