[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 21 16:42:04 UTC 2019


 sfx2/source/appl/app.cxx                  |    2 +-
 sfx2/source/sidebar/SidebarController.cxx |   11 +++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit b78bb32e743cb1a24e7e8f5e76f01af5441ef956
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Nov 19 23:02:41 2019 -0500
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Thu Nov 21 17:41:01 2019 +0100

    sidebar: don't switch the deck when unchanged
    
    Switching the deck without checking if it's changed
    recreates it. This causes a recursion in Online when
    there are multiple views, because each view needs to
    render the "new" sidebar, and the sidebar is re-activated
    when changing the frame between each view, which re-creates
    the sidebar...
    
    The overloaded SwitchToDeck function checks for change
    in the sidebar and does nothing if the sidebar hasn't
    changed. This resolves the issue, and is also more efficient.
    
    Change-Id: Ie637bbc08bf6330093019aaa417fcad5b6b7fbc8
    Reviewed-on: https://gerrit.libreoffice.org/83253
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index b9636269172f..29162c725522 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -290,7 +290,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
         // DocWinActivate : both frames belong to the same TopWindow
         // TopWinActivate : both frames belong to different TopWindows
 
-        bool bTaskActivate = pOldFrame != pFrame;
+        const bool bTaskActivate = pOldFrame != pFrame;
 
         if ( pOldFrame )
         {
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 7bf958ec6275..a7fe0e26d302 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_NoForce),
+      mnRequestedForceFlags(SwitchFlag_ForceNewDeck | SwitchFlag_ForceNewPanels),
       msCurrentDeckId(gsDefaultDeckId),
       maPropertyChangeForwarder([this](){ return this->BroadcastPropertyChange(); }),
       maContextChangeUpdate([this](){ return this->UpdateConfigurations(); }),
@@ -515,7 +515,7 @@ void SidebarController::UpdateConfigurations()
     if (!maRequestedContext.msApplication.isEmpty() &&
             (maCurrentContext.msApplication != maRequestedContext.msApplication))
     {
-        OUString sLastActiveDeck = mpResourceManager->GetLastActiveDeck( maRequestedContext );
+        const OUString sLastActiveDeck = mpResourceManager->GetLastActiveDeck(maRequestedContext);
         if (!sLastActiveDeck.isEmpty())
             msCurrentDeckId = sLastActiveDeck;
     }
@@ -567,12 +567,7 @@ void SidebarController::UpdateConfigurations()
     // with the deck.
     mpTabBar->HighlightDeck(sNewDeckId);
 
-    std::shared_ptr<DeckDescriptor> xDescriptor = mpResourceManager->GetDeckDescriptor(sNewDeckId);
-
-    if (xDescriptor)
-    {
-        SwitchToDeck(*xDescriptor, maCurrentContext);
-    }
+    SwitchToDeck(sNewDeckId);
 }
 
 namespace {


More information about the Libreoffice-commits mailing list