Revert "tdf#126095 sd notebookbar: don't force table/media toolbar"

This reverts my 24.2 commit e58e251756.

Unintended side affect in Draw (not Writer) sidebar.

Change-Id: I948263c1e8be1202e0504f109d84ce4469ddf45d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167970
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
This commit is contained in:
Justin Luth
2024-05-23 02:26:26 +02:00
parent fe5b4257d8
commit cdbd413979
+35 -38
View File
@@ -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::Table:
case SdrViewContext::Graphic:
if (!bTextEdit)
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
ToolbarId::Draw_Table_Toolbox);
bTextEdit = true;
break;
ToolbarId::Draw_Graf_Toolbox);
break;
case SdrViewContext::Standard:
default:
if (!bTextEdit)
case SdrViewContext::Media:
if (!bTextEdit)
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
ToolbarId::Draw_Media_Toolbox);
break;
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 )