sd/source/ui/view/ToolBarManager.cxx |   71 ++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 37 deletions(-)

New commits:
commit cdbd4139790383052f004def482f32fdec604fbb
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Wed May 22 17:50:55 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu May 23 02:26:26 2024 +0200

    Revert "tdf#126095 sd notebookbar: don't force table/media toolbar"
    
    This reverts my 24.2 commit e58e251756ecb0312cb6891d4df23e17ef8f6fcb.
    
    Unintended side affect in Draw (not Writer) sidebar.
    
    Change-Id: I948263c1e8be1202e0504f109d84ce4469ddf45d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167970
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sd/source/ui/view/ToolBarManager.cxx 
b/sd/source/ui/view/ToolBarManager.cxx
index 5296b7bd94ef..afb5c135e1d6 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -1045,49 +1045,46 @@ void ToolBarRules::SelectionHasChanged (
 
     mpToolBarManager->ResetToolBars(ToolBarManager::ToolBarGroup::Function);
 
-    if (!sfx2::SfxNotebookBar::IsActive())
+    switch (rView.GetContext())
     {
-        switch (rView.GetContext())
-        {
-            case SdrViewContext::Graphic:
-                if (!bTextEdit)
-                    
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
-                                                      
ToolbarId::Draw_Graf_Toolbox);
-                break;
-
-            case SdrViewContext::Media:
-                if (!bTextEdit)
-                    
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
-                                                      
ToolbarId::Draw_Media_Toolbox);
-                break;
+        case SdrViewContext::Graphic:
+            if (!bTextEdit)
+                
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
+                                                  
ToolbarId::Draw_Graf_Toolbox);
+            break;
 
-            case SdrViewContext::Table:
+        case SdrViewContext::Media:
+            if (!bTextEdit)
                 
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
-                                                  
ToolbarId::Draw_Table_Toolbox);
-                bTextEdit = true;
-                break;
+                                                  
ToolbarId::Draw_Media_Toolbox);
+            break;
 
-            case SdrViewContext::Standard:
-            default:
-                if (!bTextEdit)
+        case SdrViewContext::Table:
+            
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
+                                              ToolbarId::Draw_Table_Toolbox);
+            bTextEdit = true;
+            break;
+
+        case SdrViewContext::Standard:
+        default:
+            if (!bTextEdit)
+            {
+                switch(rViewShell.GetShellType())
                 {
-                    switch(rViewShell.GetShellType())
-                    {
-                        case ::sd::ViewShell::ST_IMPRESS:
-                        case ::sd::ViewShell::ST_DRAW:
-                        case ::sd::ViewShell::ST_NOTES:
-                        case ::sd::ViewShell::ST_HANDOUT:
-                            
mpToolBarManager->SetToolBar(ToolBarManager::ToolBarGroup::Function,
-                                                         
ToolBarManager::msDrawingObjectToolBar);
-                            
mpToolBarManager->SetToolBar(ToolBarManager::ToolBarGroup::Permanent,
-                                                         
ToolBarManager::msToolBar);
-                            break;
-                        default:
-                            break;
-                    }
-                    break;
+                    case ::sd::ViewShell::ST_IMPRESS:
+                    case ::sd::ViewShell::ST_DRAW:
+                    case ::sd::ViewShell::ST_NOTES:
+                    case ::sd::ViewShell::ST_HANDOUT:
+                        
mpToolBarManager->SetToolBar(ToolBarManager::ToolBarGroup::Function,
+                                                     
ToolBarManager::msDrawingObjectToolBar);
+                        
mpToolBarManager->SetToolBar(ToolBarManager::ToolBarGroup::Permanent,
+                                                     
ToolBarManager::msToolBar);
+                        break;
+                    default:
+                        break;
                 }
-        }
+                break;
+            }
     }
 
     if( bTextEdit )

Reply via email to