sfx2/source/sidebar/SidebarController.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 5c43becf829b13109a50cdd2276fe4437ec27143
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Sat Nov 23 19:10:45 2019 -0500
Commit:     Ashod Nakashian <ashnak...@gmail.com>
CommitDate: Mon Nov 25 13:37:17 2019 +0100

    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 <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

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 {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to