summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-11-23 19:10:45 -0500
committerAshod Nakashian <ashnakash@gmail.com>2019-11-25 13:37:17 +0100
commit5c43becf829b13109a50cdd2276fe4437ec27143 (patch)
tree61215b454082403c0a95bbca58b9bc6c7bfa14e4 /sfx2
parent98a7e776decd1082d3946fc3e00960be458242be (diff)
Revert "sidebar: don't switch the deck when unchanged"
This approach doesn't work when changing the context, since the Deck 'type' hasn't changed, but the contents have. A better way to handle the original recursive high-cpu issue is by avoiding sending/processing duplicate Deck 'created' notifications (in a follow-up patch). This reverts commit b78bb32e743cb1a24e7e8f5e76f01af5441ef956. Change-Id: I10e58d2fbfa899d21bf92306722cb7148ac4a571 Reviewed-on: https://gerrit.libreoffice.org/83628 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index a7fe0e26d302..a43ee91afdcd 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -131,7 +131,7 @@ SidebarController::SidebarController (
this)),
maCurrentContext(OUString(), OUString()),
maRequestedContext(),
- mnRequestedForceFlags(SwitchFlag_ForceNewDeck | SwitchFlag_ForceNewPanels),
+ mnRequestedForceFlags(SwitchFlag_NoForce),
msCurrentDeckId(gsDefaultDeckId),
maPropertyChangeForwarder([this](){ return this->BroadcastPropertyChange(); }),
maContextChangeUpdate([this](){ return this->UpdateConfigurations(); }),
@@ -567,7 +567,12 @@ void SidebarController::UpdateConfigurations()
// with the deck.
mpTabBar->HighlightDeck(sNewDeckId);
- SwitchToDeck(sNewDeckId);
+ std::shared_ptr<DeckDescriptor> xDescriptor = mpResourceManager->GetDeckDescriptor(sNewDeckId);
+
+ if (xDescriptor)
+ {
+ SwitchToDeck(*xDescriptor, maCurrentContext);
+ }
}
namespace {