summaryrefslogtreecommitdiffstats
path: root/sfx2/source/sidebar/SidebarController.cxx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-10-18 12:50:59 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-10-21 15:02:50 +0200
commit23467fa5cfa2feffbeba2177c0d393f8ebe1a0a3 (patch)
tree71e3c86a862291530699fce94dcd90a61ab421c1 /sfx2/source/sidebar/SidebarController.cxx
parentReplace list by vector for maPS3Font (vcl) (diff)
downloadcore-23467fa5cfa2feffbeba2177c0d393f8ebe1a0a3.tar.gz
core-23467fa5cfa2feffbeba2177c0d393f8ebe1a0a3.zip
tdf#67770: Read/writer LastActiveDeck bits
Change-Id: Id5e3c3cb4144b9fc56ab5e4a4e49f1fc69e70023 Reviewed-on: https://gerrit.libreoffice.org/43493 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sfx2/source/sidebar/SidebarController.cxx')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index e5cc4296b74a..fb50b264fb5b 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -140,7 +140,7 @@ rtl::Reference<SidebarController> SidebarController::create(
if (instance->mxReadOnlyModeDispatch.is())
instance->mxReadOnlyModeDispatch->addStatusListener(instance.get(), aURL);
- instance->SwitchToDeck(gsDefaultDeckId);
+ //first UpdateConfigurations call will SwitchToDeck
return instance;
}
@@ -210,7 +210,10 @@ void SAL_CALL SidebarController::disposing()
// so need to test if GetCurrentContext is still valid regarding msApplication
if (GetCurrentContext().msApplication != "none")
+ {
mpResourceManager->SaveDecksSettings(GetCurrentContext());
+ mpResourceManager->SaveLastActiveDeck(GetCurrentContext(), msCurrentDeckId);
+ }
// clear decks
ResourceManager::DeckContextDescriptorContainer aDecks;
@@ -437,6 +440,15 @@ void SidebarController::UpdateConfigurations()
if (maCurrentContext.msApplication != "none")
mpResourceManager->SaveDecksSettings(maCurrentContext);
+ // get last active deck for this application on first update
+ if (!maRequestedContext.msApplication.isEmpty() &&
+ (maCurrentContext.msApplication != maRequestedContext.msApplication))
+ {
+ OUString sLastActiveDeck = mpResourceManager->GetLastActiveDeck( maRequestedContext );
+ if (!sLastActiveDeck.isEmpty())
+ msCurrentDeckId = sLastActiveDeck;
+ }
+
maCurrentContext = maRequestedContext;
mpResourceManager->InitDeckContext(GetCurrentContext());