summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-06-03 16:28:02 +0200
committerYousuf Philips <philipz85@hotmail.com>2015-06-03 21:48:37 +0000
commitdb79d2710e78c712763aaba0dc74165da5ad01cc (patch)
tree16a7de9f3e5a1b877b1efef68593c898f2df3522
parent8aeb66d1b31b171b9268342d987d358930196f38 (diff)
tdf#87822 Impress: hide common task toolbar in master view
When Master Slide or Master Notes are active, hides the Common task toolbar as it it not usefull. Change-Id: Ice07661bf203c029d733614e1eceb5ef3d0661f9 Reviewed-on: https://gerrit.libreoffice.org/16060 Reviewed-by: Yousuf Philips <philipz85@hotmail.com> Tested-by: Yousuf Philips <philipz85@hotmail.com> (cherry picked from commit 1191ed8584f9fd63c39514dd2e3e71682913d4bc) Reviewed-on: https://gerrit.libreoffice.org/16061 Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--sd/source/ui/inc/ToolBarManager.hxx1
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx9
-rw-r--r--sd/source/ui/view/drviews1.cxx24
3 files changed, 23 insertions, 11 deletions
diff --git a/sd/source/ui/inc/ToolBarManager.hxx b/sd/source/ui/inc/ToolBarManager.hxx
index b5b9f80df612..5263dd059e0b 100644
--- a/sd/source/ui/inc/ToolBarManager.hxx
+++ b/sd/source/ui/inc/ToolBarManager.hxx
@@ -126,6 +126,7 @@ public:
TBG_PERMANENT = TBG__FIRST,
TBG_FUNCTION,
+ TBG_COMMON_TASK,
TBG_MASTER_MODE,
TBG__LAST = TBG_MASTER_MODE
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index 403230c7f1f6..9e59223ecaf3 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -1001,9 +1001,6 @@ void ToolBarRules::MainViewShellChanged (ViewShell::ShellType nShellType)
ToolBarManager::msOptionsToolBar);
mpToolBarManager->AddToolBar(
ToolBarManager::TBG_PERMANENT,
- ToolBarManager::msCommonTaskToolBar);
- mpToolBarManager->AddToolBar(
- ToolBarManager::TBG_PERMANENT,
ToolBarManager::msViewerToolBar);
break;
@@ -1065,10 +1062,16 @@ void ToolBarRules::MainViewShellChanged (const ViewShell& rMainViewShell)
const DrawViewShell* pDrawViewShell
= dynamic_cast<const DrawViewShell*>(&rMainViewShell);
if (pDrawViewShell != NULL)
+ {
if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
mpToolBarManager->AddToolBar(
ToolBarManager::TBG_MASTER_MODE,
ToolBarManager::msMasterViewToolBar);
+ else
+ mpToolBarManager->AddToolBar(
+ ToolBarManager::TBG_COMMON_TASK,
+ ToolBarManager::msCommonTaskToolBar);
+ }
break;
}
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 9aa19dabd03c..109d82c72e74 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -363,14 +363,18 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
// view.
bool bShowMasterViewToolbar (meEditMode == EM_MASTERPAGE
&& GetShellType() != ViewShell::ST_HANDOUT);
+ bool bShowPresentationToolbar (meEditMode != EM_MASTERPAGE
+ && GetShellType() != ViewShell::ST_HANDOUT);
// If the master view toolbar is not shown we hide it before
// switching the edit mode.
if (::sd::ViewShell::mpImpl->mbIsInitialized
- && IsMainViewShell()
- && ! bShowMasterViewToolbar)
+ && IsMainViewShell())
{
- GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE);
+ if ( !bShowMasterViewToolbar )
+ GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE);
+ if ( !bShowPresentationToolbar )
+ GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_COMMON_TASK);
}
if (meEditMode == EM_PAGE)
@@ -441,12 +445,16 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
// If the master view toolbar is to be shown we turn it on after the
// edit mode has been changed.
if (::sd::ViewShell::mpImpl->mbIsInitialized
- && IsMainViewShell()
- && bShowMasterViewToolbar)
+ && IsMainViewShell())
{
- GetViewShellBase().GetToolBarManager()->SetToolBar(
- ToolBarManager::TBG_MASTER_MODE,
- ToolBarManager::msMasterViewToolBar);
+ if (bShowMasterViewToolbar)
+ GetViewShellBase().GetToolBarManager()->SetToolBar(
+ ToolBarManager::TBG_MASTER_MODE,
+ ToolBarManager::msMasterViewToolBar);
+ if (bShowPresentationToolbar)
+ GetViewShellBase().GetToolBarManager()->SetToolBar(
+ ToolBarManager::TBG_COMMON_TASK,
+ ToolBarManager::msCommonTaskToolBar);
}
if ( ! mbIsLayerModeActive)