diff options
Diffstat (limited to 'sd')
29 files changed, 809 insertions, 361 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 7a9078f5418e..b86c51c02662 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -194,6 +194,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/app/sdxfer \ sd/source/ui/app/tmplctrl \ sd/source/ui/controller/slidelayoutcontroller \ + sd/source/ui/controller/displaymodecontroller \ sd/source/ui/dlg/AnimationChildWindow \ sd/source/ui/dlg/LayerTabBar \ sd/source/ui/dlg/NavigatorChildWindow \ diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index f75757e84547..c9dd138d1b6d 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -69,9 +69,10 @@ // FREE #define SID_CONVERT_TO_3D_LATHE (SID_SD_START+8) #define SID_DRAWINGMODE (SID_SD_START+9) -#define SID_OUTLINEMODE (SID_SD_START+10) -#define SID_DIAMODE (SID_SD_START+11) - // FREE +#define SID_OUTLINE_MODE (SID_SD_START+10) +#define SID_SLIDE_SORTER_MODE (SID_SD_START+11) +#define SID_DISPLAY_MODE (SID_SD_START+12) +#define SID_TOGGLE_TABBAR_VISIBILITY (SID_SD_START+13) #define SID_INSERTPAGE (SID_SD_START+14) #define SID_INSERTFILE (SID_SD_START+15) #define SID_INSERTSYMBOL (SID_SD_START+16) @@ -123,18 +124,18 @@ #define SID_ANIMATION_OBJECTS (SID_SD_START+62) #define SID_ANIMATION_EFFECTS (SID_SD_START+63) #define SID_PRESENTATION_LAYOUT (SID_SD_START+64) -// In svxids.hrc: SID_BEZIER_CONVERT (SID_SD_START+65) -// In svxids.hrc: SID_BEZIER_EDGE (SID_SD_START+66) -// In svxids.hrc: SID_BEZIER_SYMMTR (SID_SD_START+67) +// In svxids.hrc: SID_BEZIER_CONVERT (SID_SD_START+65) +// In svxids.hrc: SID_BEZIER_EDGE (SID_SD_START+66) +// In svxids.hrc: SID_BEZIER_SYMMTR (SID_SD_START+67) #define SID_PRESENTATION_TEMPLATES (SID_SD_START+68) -#define SID_NOTESMODE (SID_SD_START+69) -#define SID_HANDOUTMODE (SID_SD_START+70) +#define SID_NOTES_MODE (SID_SD_START+69) +#define SID_HANDOUT_MASTER_MODE (SID_SD_START+70) #define SID_LINEEND_POLYGON (SID_SD_START+71) // FREE #define SID_GRAPHIC_EXPORT (SID_SD_START+73) #define SID_SWITCH_POINTEDIT (SID_SD_START+74) // FREE -// In svxids.hrc: SID_TEXTEDIT (SID_SD_START+76) +// In svxids.hrc: SID_TEXTEDIT (SID_SD_START+76) #define SID_SET_SNAPITEM (SID_SD_START+77) // FREE #define SID_DELETE_PAGE (SID_SD_START+80) @@ -388,9 +389,9 @@ #define SID_SUMMARY_PAGE (SID_SD_START+344) #define SID_LEAVE_ALL_GROUPS (SID_SD_START+345) // FREE -#define SID_SLIDE_MASTERPAGE (SID_SD_START+348) +#define SID_SLIDE_MASTER_MODE (SID_SD_START+348) #define SID_HANDOUT_MASTERPAGE (SID_SD_START+349) -#define SID_NOTES_MASTERPAGE (SID_SD_START+350) +#define SID_NOTES_MASTER_MODE (SID_SD_START+350) // FREE #define SID_INSERTPAGE_QUICK (SID_SD_START+352) // FREE diff --git a/sd/inc/sdcommands.h b/sd/inc/sdcommands.h index 1d3502f1cd6b..4642124ce750 100644 --- a/sd/inc/sdcommands.h +++ b/sd/inc/sdcommands.h @@ -56,7 +56,7 @@ #define CMD_SID_GLUE_VERTALIGN_CENTER ".uno:GlueVertAlignCenter" #define CMD_SID_GLUE_VERTALIGN_TOP ".uno:GlueVertAlignTop" #define CMD_SID_GRID_FRONT ".uno:GridFront" -#define CMD_SID_HANDOUTMODE ".uno:HandoutMode" +#define CMD_SID_HANDOUT_MASTER_MODE ".uno:HandoutMode" #define CMD_SID_HELPLINES_FRONT ".uno:HelplinesFront" #define CMD_SID_HELPLINES_USE ".uno:HelplinesUse" #define CMD_SID_HELPLINES_VISIBLE ".uno:HelplinesVisible" @@ -74,7 +74,7 @@ #define CMD_SID_NAME_GROUP ".uno:NameGroup" #define CMD_SID_OBJECT_TITLE_DESCRIPTION ".uno:ObjectTitleDescription" #define CMD_SID_CONNECTION_NEW_ROUTING ".uno:NewRouting" -#define CMD_SID_NOTESMODE ".uno:NotesMode" +#define CMD_SID_NOTES_MODE ".uno:NotesMode" #define CMD_SID_POSITION ".uno:ObjectPosition" #define CMD_SID_ORIGINAL_SIZE ".uno:OriginalSize" #define CMD_SID_OUTLINE_TEXT_AUTOFIT ".uno.OutlineTextAutofit" diff --git a/sd/sdi/ViewShellBase.sdi b/sd/sdi/ViewShellBase.sdi index 98da5f536d0d..0f1bcb8f4fb2 100644 --- a/sd/sdi/ViewShellBase.sdi +++ b/sd/sdi/ViewShellBase.sdi @@ -52,31 +52,51 @@ interface ViewShellBaseView ExecMethod = Execute; StateMethod = GetState; ] + SID_TOGGLE_TABBAR_VISIBILITY + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + SID_DISPLAY_MODE + [ + ExecMethod = Execute; + StateMethod = GetState; + ] SID_DRAWINGMODE [ ExecMethod = Execute; StateMethod = GetState; ] - SID_DIAMODE + SID_SLIDE_SORTER_MODE [ ExecMethod = Execute; StateMethod = GetState; ] - SID_OUTLINEMODE + SID_OUTLINE_MODE [ ExecMethod = Execute; StateMethod = GetState; ] - SID_NOTESMODE + SID_NOTES_MODE [ ExecMethod = Execute; StateMethod = GetState; ] - SID_HANDOUTMODE + SID_HANDOUT_MASTER_MODE [ ExecMethod = Execute; StateMethod = GetState; ] + SID_SLIDE_MASTER_MODE + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] + SID_NOTES_MASTER_MODE + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] SID_WIN_FULLSCREEN [ ExecMethod = Execute; diff --git a/sd/sdi/drviewsh.sdi b/sd/sdi/drviewsh.sdi index 682c7eca0948..2e9f7a3ee70c 100644 --- a/sd/sdi/drviewsh.sdi +++ b/sd/sdi/drviewsh.sdi @@ -135,21 +135,6 @@ interface ImpressEditView : DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] - SID_SLIDE_MASTERPAGE // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_NOTES_MASTERPAGE // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_HANDOUT_MASTERPAGE // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] SID_STYLE_FAMILY [ ExecMethod = FuSupport ; diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index fd0e8bc29db8..82fa634d52a1 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -1932,8 +1932,7 @@ SfxVoidItem DeSelect SID_UNSELECT GroupId = GID_EDIT; ] -SfxBoolItem DiaMode SID_DIAMODE - +SfxBoolItem DiaMode SID_SLIDE_SORTER_MODE [ /* flags: */ AutoUpdate = FALSE, @@ -2944,7 +2943,7 @@ SfxVoidItem HandoutMasterPage SID_HANDOUT_MASTERPAGE GroupId = GID_VIEW; ] -SfxBoolItem HandoutMode SID_HANDOUTMODE +SfxBoolItem HandoutMode SID_HANDOUT_MASTER_MODE [ /* flags: */ @@ -4160,6 +4159,56 @@ SfxUInt32Item AssignLayout SID_ASSIGN_LAYOUT GroupId = GID_MODIFY; ] + +SfxBoolItem ToggleTabBarVisibility SID_TOGGLE_TABBAR_VISIBILITY + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = TRUE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_VIEW; +] + + +SfxVoidItem DisplayMode SID_DISPLAY_MODE +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_VIEW; +] + SfxVoidItem ModifyPresentationObject SID_PRESENTATIONOBJECT () [ @@ -4463,8 +4512,8 @@ SfxBoolItem NewRouting SID_CONNECTION_NEW_ROUTING GroupId = GID_DRAWING; ] -SfxVoidItem NotesMasterPage SID_NOTES_MASTERPAGE -(SfxBoolItem Isactive ID_VAL_ISACTIVE) +SfxVoidItem NotesMasterPage SID_NOTES_MASTER_MODE +() [ /* flags: */ AutoUpdate = FALSE, @@ -4479,10 +4528,7 @@ SfxVoidItem NotesMasterPage SID_NOTES_MASTERPAGE RecordPerSet; Synchron; - /* status: */ - SlotType = SfxBoolItem - - /* config: */ + /* config: */ AccelConfig = TRUE, MenuConfig = TRUE, StatusBarConfig = FALSE, @@ -4490,7 +4536,7 @@ SfxVoidItem NotesMasterPage SID_NOTES_MASTERPAGE GroupId = GID_VIEW; ] -SfxBoolItem NotesMode SID_NOTESMODE +SfxVoidItem NotesMode SID_NOTES_MODE [ /* flags: */ @@ -4592,7 +4638,7 @@ SfxVoidItem OriginalSize SID_ORIGINAL_SIZE GroupId = GID_MODIFY; ] -SfxBoolItem OutlineMode SID_OUTLINEMODE +SfxVoidItem OutlineMode SID_OUTLINE_MODE [ /* flags: */ @@ -5615,8 +5661,8 @@ SfxBoolItem SlideChangeWindow SID_SLIDE_TRANSITIONS_PANEL GroupId = GID_MODIFY; ] -SfxVoidItem SlideMasterPage SID_SLIDE_MASTERPAGE -(SfxBoolItem Isactive ID_VAL_ISACTIVE) +SfxVoidItem SlideMasterPage SID_SLIDE_MASTER_MODE +() [ /* flags: */ AutoUpdate = FALSE, @@ -5631,9 +5677,6 @@ SfxVoidItem SlideMasterPage SID_SLIDE_MASTERPAGE RecordPerSet; Synchron; - /* status: */ - SlotType = SfxBoolItem - /* config: */ AccelConfig = TRUE, MenuConfig = TRUE, diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 5a1084afc691..4d6535545d64 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1277,7 +1277,7 @@ bool ImplSdPPTImport::Import() } pFrameView->SetPageKind( ePageKind ); pFrameView->SetSelectedPage( nSelectedPage ); - pFrameView->SetViewShEditMode( eEditMode, ePageKind ); + pFrameView->SetViewShEditMode( eEditMode ); } } DffRecordHeader aCustomShowHeader; diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src index 6308c02e15a0..caa575286fbd 100644 --- a/sd/source/ui/app/strings.src +++ b/sd/source/ui/app/strings.src @@ -120,14 +120,18 @@ String STR_UNDO_BEZCLOSE { Text [ en-US ] = "Close Polygon" ; }; -String STR_SLIDE_MODE +String STR_SLIDE_SORTER_MODE { Text [ en-US ] = "Slide Sorter" ; }; -String STR_DRAW_MODE +String STR_NORMAL_MODE { Text [ en-US ] = "Normal" ; }; +String STR_SLIDE_MASTER_MODE +{ + Text [ en-US ] = "Slide Master" ; +}; String STR_OUTLINE_MODE { Text [ en-US ] = "Outline" ; @@ -136,7 +140,11 @@ String STR_NOTES_MODE { Text [ en-US ] = "Notes" ; }; -String STR_HANDOUT_MODE +String STR_NOTES_MASTER_MODE +{ + Text [ en-US ] = "Notes Master" ; +}; +String STR_HANDOUT_MASTER_MODE { Text [ en-US ] = "Handout" ; }; @@ -234,7 +242,14 @@ String STR_AUTOLAYOUT_HANDOUT9 { Text [ en-US ] = "Nine Slides" ; }; - +String STR_DISPLAYMODE_EDITMODES +{ + Text [ en-US ] = "Edit Modes" ; +}; +String STR_DISPLAYMODE_MASTERMODES +{ + Text [ en-US ] = "Master Modes" ; +}; String STR_AUTOLAYOUT_NOTES { Text [ en-US ] = "Notes" ; diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx new file mode 100644 index 000000000000..32209e6517c1 --- /dev/null +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -0,0 +1,316 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/text/WritingMode.hpp> +#include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/DrawViewMode.hpp> + +#include <osl/mutex.hxx> + +#include <vcl/svapp.hxx> +#include <vcl/toolbox.hxx> + +#include <svl/languageoptions.hxx> + +#include <svtools/ctrltool.hxx> +#include <svtools/ctrlbox.hxx> +#include <svtools/toolbarmenu.hxx> +#include <svtools/valueset.hxx> + +#include <toolkit/helper/vclunohelper.hxx> +#include <comphelper/processfactory.hxx> + +#include <sfx2/imagemgr.hxx> + +#include "app.hrc" +#include "facreg.hxx" +#include "glob.hrc" +#include "strings.hrc" +#include "res_bmp.hrc" +#include "sdresid.hxx" +#include "pres.hxx" +#include "displaymodecontroller.hxx" +#include "ViewShellBase.hxx" + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::beans; + +namespace sd +{ + +// Component to select which display mode has to be used. +// Composed of a combobox in the toolbar and a popup menu to select +// the value + +class DisplayModeToolbarMenu : public svtools::ToolbarMenu +{ +public: + DisplayModeToolbarMenu( DisplayModeController& rController, + const Reference< XFrame >& xFrame, vcl::Window* pParent ); + virtual ~DisplayModeToolbarMenu(); + virtual void dispose() SAL_OVERRIDE; + +protected: + DECL_LINK_TYPED( SelectToolbarMenuHdl, ToolbarMenu*, void ); + DECL_LINK_TYPED( SelectValueSetHdl, ValueSet*, void ); + void SelectHdl(void*); + +private: + DisplayModeController& mrController; + Reference< XFrame > mxFrame; + VclPtr<ValueSet> mpDisplayModeSet1; + VclPtr<ValueSet> mpDisplayModeSet2; +}; + +struct snewfoil_value_info +{ + sal_uInt16 mnId; + sal_uInt16 mnBmpResId; + sal_uInt16 mnStrResId; + OUString msUnoCommand; +}; + +static const snewfoil_value_info editmodes[] = +{ + {1, + BMP_DISPLAYMODE_SLIDE, + STR_NORMAL_MODE, + OUString(".uno:NormalMultiPaneGUI") }, + {2, + BMP_DISPLAYMODE_NOTES, + STR_NOTES_MODE, + OUString(".uno:NotesMode") }, + {3, + BMP_DISPLAYMODE_OUTLINE, + STR_OUTLINE_MODE, + OUString(".uno:OutlineMode") }, + {4, + BMP_DISPLAYMODE_SLIDE_SORTER, + STR_SLIDE_SORTER_MODE, + OUString(".uno:DiaMode") }, + {0, 0, 0, OUString() } +}; + +static const snewfoil_value_info mastermodes[] = +{ + {5, + BMP_DISPLAYMODE_SLIDE_MASTER, + STR_SLIDE_MASTER_MODE, + OUString(".uno:SlideMasterPage") }, + {6, + BMP_DISPLAYMODE_NOTES_MASTER, + STR_NOTES_MASTER_MODE, + OUString(".uno:NotesMasterPage") }, + {7, + BMP_DISPLAYMODE_HANDOUT_MASTER, + STR_HANDOUT_MASTER_MODE, + OUString(".uno:HandoutMode") }, + {0, 0, 0, OUString() } +}; + + +static void fillLayoutValueSet( ValueSet* pValue, const snewfoil_value_info* pInfo ) +{ + Size aLayoutItemSize; + for( ; pInfo->mnId; pInfo++ ) + { + OUString aText( SD_RESSTR( pInfo->mnStrResId ) ); + BitmapEx aBmp( SdResId( pInfo->mnBmpResId ) ); + + pValue->InsertItem(pInfo->mnId, Image(aBmp), aText); + + aLayoutItemSize.Width() = std::max( aLayoutItemSize.Width(), aBmp.GetSizePixel().Width() ); + aLayoutItemSize.Height() = std::max( aLayoutItemSize.Height(), aBmp.GetSizePixel().Height() ); + } + + aLayoutItemSize = pValue->CalcItemSizePixel( aLayoutItemSize ); + pValue->SetSizePixel( pValue->CalcWindowSizePixel( aLayoutItemSize ) ); +} + +DisplayModeToolbarMenu::DisplayModeToolbarMenu( DisplayModeController& rController, + const Reference< XFrame >& xFrame, vcl::Window* pParent ) +: svtools::ToolbarMenu(xFrame, pParent, WB_CLIPCHILDREN ) +, mrController( rController ) +, mxFrame(xFrame) +, mpDisplayModeSet1( 0 ) +, mpDisplayModeSet2( 0 ) +{ + const sal_Int32 LAYOUT_BORDER_PIX = 7; + + OUString aTitle1( SD_RESSTR( STR_DISPLAYMODE_EDITMODES ) ); + OUString aTitle2( SD_RESSTR( STR_DISPLAYMODE_MASTERMODES ) ); + + SvtLanguageOptions aLanguageOptions; + + SetSelectHdl( LINK( this, DisplayModeToolbarMenu, SelectToolbarMenuHdl ) ); + + mpDisplayModeSet1 = createEmptyValueSetControl(); + mpDisplayModeSet1->SetSelectHdl( LINK( this, DisplayModeToolbarMenu, SelectValueSetHdl ) ); + + sal_Int16 nColCount = 2; + mpDisplayModeSet1->SetColCount( nColCount ); + fillLayoutValueSet( mpDisplayModeSet1, &editmodes[0] ); + + Size aSize( mpDisplayModeSet1->GetOutputSizePixel() ); + aSize.Width() += (mpDisplayModeSet1->GetColCount() + 1) * LAYOUT_BORDER_PIX; + aSize.Height() += (mpDisplayModeSet1->GetLineCount() +1) * LAYOUT_BORDER_PIX; + mpDisplayModeSet1->SetOutputSizePixel( aSize ); + + appendEntry( -1, aTitle1 ); + appendEntry( 1, mpDisplayModeSet1 ); + + mpDisplayModeSet2 = VclPtr<ValueSet>::Create( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); + + mpDisplayModeSet2->SetSelectHdl( LINK( this, DisplayModeToolbarMenu, SelectValueSetHdl ) ); + mpDisplayModeSet2->SetColCount( nColCount ); + mpDisplayModeSet2->EnableFullItemMode( false ); + mpDisplayModeSet2->SetColor( GetControlBackground() ); + + fillLayoutValueSet( mpDisplayModeSet2, &mastermodes[0] ); + + aSize = mpDisplayModeSet2->GetOutputSizePixel(); + aSize.Width() += (mpDisplayModeSet2->GetColCount() + 1) * LAYOUT_BORDER_PIX; + aSize.Height() += (mpDisplayModeSet2->GetLineCount() + 1) * LAYOUT_BORDER_PIX; + mpDisplayModeSet2->SetOutputSizePixel( aSize ); + + appendEntry( -1, aTitle2 ); + appendEntry( 2, mpDisplayModeSet2 ); + + SetOutputSizePixel( getMenuSize() ); +} + +DisplayModeToolbarMenu::~DisplayModeToolbarMenu() +{ + disposeOnce(); +} + +void DisplayModeToolbarMenu::dispose() +{ + mpDisplayModeSet1.clear(); + mpDisplayModeSet2.clear(); + svtools::ToolbarMenu::dispose(); +} + +IMPL_LINK_TYPED( DisplayModeToolbarMenu, SelectValueSetHdl, ValueSet*, pControl, void ) +{ + SelectHdl(pControl); +} +IMPL_LINK_TYPED( DisplayModeToolbarMenu, SelectToolbarMenuHdl, ToolbarMenu *, pControl, void ) +{ + SelectHdl(pControl); +} + +void DisplayModeToolbarMenu::SelectHdl(void * pControl) +{ + if ( IsInPopupMode() ) + EndPopupMode(); + + OUString sCommandURL; + sal_uInt16 nImage = 0; + + if( pControl == mpDisplayModeSet1 ) { + sCommandURL = editmodes[mpDisplayModeSet1->GetSelectItemId() - 1 ].msUnoCommand; + nImage = editmodes[mpDisplayModeSet1->GetSelectItemId() - 1 ].mnBmpResId; + } + else if( pControl == mpDisplayModeSet2 ) { + sCommandURL = mastermodes[mpDisplayModeSet2->GetSelectItemId() - 5 ].msUnoCommand; + nImage = mastermodes[mpDisplayModeSet2->GetSelectItemId() - 5 ].mnBmpResId; + } + + Sequence< PropertyValue > aArgs; + if (!sCommandURL.isEmpty()) + mrController.dispatchCommand( sCommandURL, aArgs ); + + mrController.setToolboxItemImage( nImage ); +} + +OUString DisplayModeController_getImplementationName() throw (css::uno::RuntimeException) +{ + return OUString( "com.sun.star.comp.sd.DisplayModeController" ); +} + +Sequence< OUString > DisplayModeController_getSupportedServiceNames() throw( RuntimeException ) +{ + Sequence< OUString > aSNS( 1 ); + aSNS.getArray()[0] = "com.sun.star.frame.ToolbarController"; + return aSNS; +} + +// class SlideLayoutController + +DisplayModeController::DisplayModeController( const Reference< uno::XComponentContext >& rxContext, const OUString& sCommandURL ) +: svt::PopupWindowController( rxContext, Reference< frame::XFrame >(), sCommandURL ) +{ +} + +void SAL_CALL DisplayModeController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) + throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) +{ + svt::PopupWindowController::initialize( aArguments ); + setToolboxItemImage( BMP_DISPLAYMODE_SLIDE ); +} + +VclPtr<vcl::Window> DisplayModeController::createPopupWindow( vcl::Window* pParent ) +{ + return VclPtr<sd::DisplayModeToolbarMenu>::Create( *this, m_xFrame, pParent ); +} + +void DisplayModeController::setToolboxItemImage( sal_uInt16 nImage ) +{ + sal_uInt16 nId; + ToolBox* pToolBox; + getToolboxId( nId, &pToolBox ); + + SdResId resId( nImage ); + BitmapEx aBmp( resId ); + int targetSize = (pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE) ? 32 : 16; + double scale = 1.0f; + Size size = aBmp.GetSizePixel(); + if (size.Width() > targetSize) + scale = (double)targetSize / (double)size.Width(); + if (size.Height() > targetSize) + scale = ::std::min( scale, (double)targetSize / (double)size.Height() ); + aBmp.Scale( scale, scale ); + pToolBox->SetItemImage( nId, Image( aBmp ) ); + +} + +// XServiceInfo + +OUString SAL_CALL DisplayModeController::getImplementationName() throw( RuntimeException, std::exception ) +{ + return DisplayModeController_getImplementationName(); +} + +Sequence< OUString > SAL_CALL DisplayModeController::getSupportedServiceNames( ) throw( RuntimeException, std::exception ) +{ + return DisplayModeController_getSupportedServiceNames(); +} + +} + + +extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL +com_sun_star_comp_sd_DisplayModeController_get_implementation(::com::sun::star::uno::XComponentContext* context, + ::com::sun::star::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new sd::DisplayModeController(context, ".uno:DisplayMode")); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/controller/displaymodecontroller.hxx b/sd/source/ui/controller/displaymodecontroller.hxx new file mode 100644 index 000000000000..ff2f25073b5f --- /dev/null +++ b/sd/source/ui/controller/displaymodecontroller.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SD_SOURCE_UI_CONTROLLER_DISPLAYMODECONTROLLER_HXX +#define INCLUDED_SD_SOURCE_UI_CONTROLLER_DISPLAYMODECONTROLLER_HXX + +#include <svtools/popupwindowcontroller.hxx> + +namespace sd +{ + +class DisplayModeController : public svt::PopupWindowController +{ +public: + DisplayModeController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, + const OUString& sCommandURL ); + + virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) + throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + void setToolboxItemImage( sal_uInt16 nImage ); + + using svt::PopupWindowController::createPopupWindow; +}; + +} + +#endif // INCLUDED_SD_SOURCE_UI_CONTROLLER_DISPLAYMODECONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/framework/module/SlideSorterModule.cxx b/sd/source/ui/framework/module/SlideSorterModule.cxx index fcf643711d62..bf6c040c8034 100644 --- a/sd/source/ui/framework/module/SlideSorterModule.cxx +++ b/sd/source/ui/framework/module/SlideSorterModule.cxx @@ -134,7 +134,7 @@ void SlideSorterModule::UpdateViewTabBar (const Reference<XTabBar>& rxTabBar) aButtonA.ResourceId = FrameworkHelper::CreateResourceId( FrameworkHelper::msSlideSorterURL, FrameworkHelper::msCenterPaneURL); - aButtonA.ButtonLabel = SD_RESSTR(STR_SLIDE_MODE); + aButtonA.ButtonLabel = SD_RESSTR(STR_SLIDE_SORTER_MODE); TabBarButton aButtonB; aButtonB.ResourceId = FrameworkHelper::CreateResourceId( diff --git a/sd/source/ui/framework/module/ViewTabBarModule.cxx b/sd/source/ui/framework/module/ViewTabBarModule.cxx index cfa0b3155de5..02a7b553b2e1 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.cxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.cxx @@ -155,7 +155,7 @@ void ViewTabBarModule::UpdateViewTabBar (const Reference<XTabBar>& rxTabBar) aImpressViewButton.ResourceId = FrameworkHelper::CreateResourceId( FrameworkHelper::msImpressViewURL, xAnchor); - aImpressViewButton.ButtonLabel = SD_RESSTR(STR_DRAW_MODE); + aImpressViewButton.ButtonLabel = SD_RESSTR(STR_NORMAL_MODE); if ( ! xBar->hasTabBarButton(aImpressViewButton)) xBar->addTabBarButtonAfter(aImpressViewButton, aEmptyButton); @@ -179,7 +179,7 @@ void ViewTabBarModule::UpdateViewTabBar (const Reference<XTabBar>& rxTabBar) aHandoutViewButton.ResourceId = FrameworkHelper::CreateResourceId( FrameworkHelper::msHandoutViewURL, xAnchor); - aHandoutViewButton.ButtonLabel = SD_RESSTR(STR_HANDOUT_MODE); + aHandoutViewButton.ButtonLabel = SD_RESSTR(STR_HANDOUT_MASTER_MODE); if ( ! xBar->hasTabBarButton(aHandoutViewButton)) xBar->addTabBarButtonAfter(aHandoutViewButton, aNotesViewButton); } diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 564f75605f4c..585a82db1ff0 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -522,27 +522,26 @@ void FrameworkHelper::HandleModeChangeSlot ( sal_uLong nSlotId, SfxRequest& rRequest) { - bool bIsActive = true; - if ( ! mxConfigurationController.is()) return; - switch (nSlotId) + // Parameters are allowed for NotesMasterPage and SlideMasterPage + // for these command, transfor xxxxMasterPage with param = false + // to ActivatexxxxxMode + if (nSlotId == SID_NOTES_MASTER_MODE || nSlotId == SID_SLIDE_MASTER_MODE) { - case SID_DRAWINGMODE: - case SID_NOTESMODE: - case SID_HANDOUTMODE: - case SID_DIAMODE: - case SID_OUTLINEMODE: + const SfxItemSet* pRequestArguments = rRequest.GetArgs(); + if (pRequestArguments) { - const SfxItemSet* pRequestArguments = rRequest.GetArgs(); - if (pRequestArguments) + const SfxBoolItem* pIsActive = rRequest.GetArg<SfxBoolItem>((sal_uInt16)nSlotId); + if (!pIsActive->GetValue ()) { - const SfxBoolItem* pIsActive = rRequest.GetArg<SfxBoolItem>((sal_uInt16)nSlotId); - bIsActive = pIsActive->GetValue (); + if (nSlotId == SID_NOTES_MASTER_MODE) + nSlotId = SID_NOTES_MODE; + else + nSlotId = SID_NORMAL_MULTI_PANE_GUI; } } - break; } try @@ -555,60 +554,68 @@ void FrameworkHelper::HandleModeChangeSlot ( Reference<XView> xView (GetView(xPaneId)); ::std::shared_ptr<ViewShell> pCenterViewShell (GetViewShell(xView)); + // Compute requested view OUString sRequestedView; - if (bIsActive) + switch (nSlotId) { - switch (nSlotId) - { - case SID_NORMAL_MULTI_PANE_GUI: - case SID_DRAWINGMODE: - sRequestedView = FrameworkHelper::msImpressViewURL; - break; - - case SID_NOTESMODE: - sRequestedView = FrameworkHelper::msNotesViewURL; + // draw + case SID_DRAWINGMODE: + // impress + case SID_NORMAL_MULTI_PANE_GUI: + case SID_SLIDE_MASTER_MODE: + sRequestedView = FrameworkHelper::msImpressViewURL; break; - case SID_HANDOUTMODE: - sRequestedView = FrameworkHelper::msHandoutViewURL; - break; + case SID_NOTES_MODE: + case SID_NOTES_MASTER_MODE: + sRequestedView = FrameworkHelper::msNotesViewURL; + break; - case SID_SLIDE_SORTER_MULTI_PANE_GUI: - case SID_DIAMODE: - sRequestedView = FrameworkHelper::msSlideSorterURL; - break; + case SID_HANDOUT_MASTER_MODE: + sRequestedView = FrameworkHelper::msHandoutViewURL; + break; - case SID_OUTLINEMODE: - sRequestedView = FrameworkHelper::msOutlineViewURL; - break; - } - } + case SID_SLIDE_SORTER_MULTI_PANE_GUI: + case SID_SLIDE_SORTER_MODE: + sRequestedView = FrameworkHelper::msSlideSorterURL; + break; - if (xView.is() - && xView->getResourceId()->getResourceURL().equals(sRequestedView)) - { - // We do not have to switch the view shell but maybe the edit mode - // has changed. - DrawViewShell* pDrawViewShell - = dynamic_cast<DrawViewShell*>(pCenterViewShell.get()); - if (pDrawViewShell != nullptr) - { - pCenterViewShell->Broadcast ( - ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START)); + case SID_OUTLINE_MODE: + sRequestedView = FrameworkHelper::msOutlineViewURL; + break; + } - pDrawViewShell->ChangeEditMode ( - EM_PAGE, pDrawViewShell->IsLayerModeActive()); + // Compute requested mode + EditMode eEMode = EM_PAGE; + if (nSlotId == SID_SLIDE_MASTER_MODE + || nSlotId == SID_NOTES_MASTER_MODE + || nSlotId == SID_HANDOUT_MASTER_MODE) + eEMode = EM_MASTERPAGE; + // Ensure we have the expected view shell + if (!(xView.is() && xView->getResourceId()->getResourceURL().equals(sRequestedView))) - pCenterViewShell->Broadcast ( - ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END)); - } - } - else { mxConfigurationController->requestResourceActivation( CreateResourceId(sRequestedView, msCenterPaneURL), ResourceActivationMode_REPLACE); } + + // Ensure we have the expected edit mode + // The check is only for DrawViewShell as OutlineViewShell + // and SlideSorterViewShell have no master mode + DrawViewShell* pDrawViewShell + = dynamic_cast<DrawViewShell*>(pCenterViewShell.get()); + if (pDrawViewShell != NULL) + { + pCenterViewShell->Broadcast ( + ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START)); + + pDrawViewShell->ChangeEditMode ( + eEMode, pDrawViewShell->IsLayerModeActive()); + + pCenterViewShell->Broadcast ( + ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END)); + } } catch (RuntimeException&) { diff --git a/sd/source/ui/func/fusearch.cxx b/sd/source/ui/func/fusearch.cxx index 7dca8701cbd1..6c839ab1b240 100644 --- a/sd/source/ui/func/fusearch.cxx +++ b/sd/source/ui/func/fusearch.cxx @@ -42,10 +42,12 @@ namespace sd { static sal_uInt16 SidArraySpell[] = { SID_DRAWINGMODE, - SID_OUTLINEMODE, - SID_DIAMODE, - SID_NOTESMODE, - SID_HANDOUTMODE, + SID_SLIDE_MASTER_MODE, + SID_OUTLINE_MODE, + SID_SLIDE_SORTER_MODE, + SID_NOTES_MODE, + SID_NOTES_MASTER_MODE, + SID_HANDOUT_MASTER_MODE, 0 }; diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx index ffc37cb8a53b..f59c6b6db898 100644 --- a/sd/source/ui/inc/FrameView.hxx +++ b/sd/source/ui/inc/FrameView.hxx @@ -103,8 +103,8 @@ public: /** can be used to get the page that was selected on last save of this document */ sal_uInt16 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; } - void SetViewShEditMode(EditMode eMode, PageKind eKind); - EditMode GetViewShEditMode (PageKind eKind); + void SetViewShEditMode(EditMode eMode); + EditMode GetViewShEditMode (); /** Remember the edit mode of the main view shell at the time when the document is loaded. @@ -184,9 +184,10 @@ private: sal_uInt16 mnSelectedPage; PageKind mePageKindOnLoad; sal_uInt16 mnSelectedPageOnLoad; - EditMode meStandardEditMode; ///< edit mode in drawing mode (Page/MasterPage) - EditMode meNotesEditMode; ///< edit mode in notes mode (Page/MasterPage) - EditMode meHandoutEditMode; ///< edit mode in handout mode (Page/MasterPage) + EditMode meEditMode; ///< edit mode in drawing mode (Page/MasterPage) + // EditMode meStandardEditMode; ///< edit mode in drawing mode (Page/MasterPage) + // EditMode meNotesEditMode; ///< edit mode in notes mode (Page/MasterPage) + // EditMode meHandoutEditMode; ///< edit mode in handout mode (Page/MasterPage) EditMode meEditModeOnLoad; bool mbLayerMode; ///< layer on/off bool mbQuickEdit; ///< QuickEdit on/off diff --git a/sd/source/ui/inc/strings.hrc b/sd/source/ui/inc/strings.hrc index ca3f496af9f1..06cc14c9531e 100644 --- a/sd/source/ui/inc/strings.hrc +++ b/sd/source/ui/inc/strings.hrc @@ -72,15 +72,17 @@ #define STR_MEDIUM (RID_APP_START+113) #define STR_FAST (RID_APP_START+114) -#define STR_SLIDE_MODE (RID_APP_START+121) -#define STR_DRAW_MODE (RID_APP_START+122) +#define STR_SLIDE_SORTER_MODE (RID_APP_START+121) +#define STR_NORMAL_MODE (RID_APP_START+122) #define STR_OUTLINE_MODE (RID_APP_START+123) +#define STR_SLIDE_MASTER_MODE (RID_APP_START+124) +#define STR_NOTES_MASTER_MODE (RID_APP_START+125) #define STR_UNDO_BEZCLOSE (RID_APP_START+127) #define STR_END_SPELLING_OBJ (RID_APP_START+129) #define STR_NOTES_MODE (RID_APP_START+135) -#define STR_HANDOUT_MODE (RID_APP_START+136) +#define STR_HANDOUT_MASTER_MODE (RID_APP_START+136) #define STR_LINEEND (RID_APP_START+137) #define STR_DESC_LINEEND (RID_APP_START+138) @@ -144,16 +146,19 @@ #define STR_AUTOLAYOUT_CONTENT_OVER_CONTENT (RID_APP_START+221) #define STR_AUTOLAYOUT_4CONTENT (RID_APP_START+222) #define STR_AUTOLAYOUT_6CONTENT (RID_APP_START+223) - -#define STR_AUTOLAYOUT_HANDOUT1 (RID_APP_START+231) -#define STR_AUTOLAYOUT_HANDOUT2 (RID_APP_START+232) -#define STR_AUTOLAYOUT_HANDOUT3 (RID_APP_START+233) -#define STR_AUTOLAYOUT_HANDOUT4 (RID_APP_START+234) -#define STR_AUTOLAYOUT_HANDOUT6 (RID_APP_START+235) -#define STR_AUTOLAYOUT_NOTES (RID_APP_START+236) -#define STR_AUTOLAYOUT_HANDOUT9 (RID_APP_START+237) - -#define STR_TRANSFORM (RID_APP_START+240) + // FREE +#define STR_AUTOLAYOUT_HANDOUT1 (RID_APP_START+231) +#define STR_AUTOLAYOUT_HANDOUT2 (RID_APP_START+232) +#define STR_AUTOLAYOUT_HANDOUT3 (RID_APP_START+233) +#define STR_AUTOLAYOUT_HANDOUT4 (RID_APP_START+234) +#define STR_AUTOLAYOUT_HANDOUT6 (RID_APP_START+235) +#define STR_AUTOLAYOUT_NOTES (RID_APP_START+236) +#define STR_AUTOLAYOUT_HANDOUT9 (RID_APP_START+237) + +#define STR_DISPLAYMODE_EDITMODES (RID_APP_START+238) +#define STR_DISPLAYMODE_MASTERMODES (RID_APP_START+239) + +#define STR_TRANSFORM (RID_APP_START+240) #define STR_EXPORT_HTML_NAME (RID_APP_START+244) #define STR_EXPORT_HTML_FILTER (RID_APP_START+245) diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx index 8e1f90254b4d..937320bc7000 100644 --- a/sd/source/ui/inc/unokywds.hxx +++ b/sd/source/ui/inc/unokywds.hxx @@ -139,9 +139,10 @@ const char sUNO_View_PreviewDrawMode[] = "PreviewDrawMode"; const char sUNO_View_IsShowPreviewInPageMode[] = "IsShowPreviewInPageMode"; const char sUNO_View_IsShowPreviewInMasterPageMode[] = "IsShowPreviewInMasterPageMode"; const char sUNO_View_SetShowPreviewInOutlineMode[] = "SetShowPreviewInOutlineMode"; -const char sUNO_View_EditModeStandard[] = "EditModeStandard"; -const char sUNO_View_EditModeNotes[] = "EditModeNotes"; -const char sUNO_View_EditModeHandout[] = "EditModeHandout"; +const char sUNO_View_EditMode[] = "EditMode"; +const char sUNO_View_EditModeStandard[] = "EditModeStandard"; // To be deprecated +// const char sUNO_View_EditModeNotes[] = "EditModeNotes"; +// const char sUNO_View_EditModeHandout[] = "EditModeHandout"; const char sUNO_View_VisArea[] = "VisArea"; const char sUNO_View_GridIsVisible[] = "GridIsVisible"; diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index e710a05e0815..b03821cb7f39 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -388,10 +388,10 @@ void SlotManager::FuSupport (SfxRequest& rRequest) break; case SID_DRAWINGMODE: - case SID_NOTESMODE: - case SID_HANDOUTMODE: - case SID_DIAMODE: - case SID_OUTLINEMODE: + case SID_NOTES_MODE: + case SID_HANDOUT_MASTER_MODE: + case SID_SLIDE_SORTER_MODE: + case SID_OUTLINE_MODE: { ViewShellBase* pBase = mrSlideSorter.GetViewShellBase(); if (pBase != nullptr) @@ -538,10 +538,10 @@ void SlotManager::GetMenuState (SfxItemSet& rSet) rSet.Put( SfxBoolItem( nSId, true ) ); } rSet.Put( SfxBoolItem( SID_DRAWINGMODE, false ) ); - rSet.Put( SfxBoolItem( SID_DIAMODE, true ) ); - rSet.Put( SfxBoolItem( SID_OUTLINEMODE, false ) ); - rSet.Put( SfxBoolItem( SID_NOTESMODE, false ) ); - rSet.Put( SfxBoolItem( SID_HANDOUTMODE, false ) ); + rSet.Put( SfxBoolItem( SID_SLIDE_SORTER_MODE, true ) ); + rSet.Put( SfxBoolItem( SID_OUTLINE_MODE, false ) ); + rSet.Put( SfxBoolItem( SID_NOTES_MODE, false ) ); + rSet.Put( SfxBoolItem( SID_HANDOUT_MASTER_MODE, false ) ); if (pShell!=nullptr && pShell->IsMainViewShell()) { diff --git a/sd/source/ui/view/GraphicViewShellBase.cxx b/sd/source/ui/view/GraphicViewShellBase.cxx index 7157a04c852d..fec98e780c9b 100644 --- a/sd/source/ui/view/GraphicViewShellBase.cxx +++ b/sd/source/ui/view/GraphicViewShellBase.cxx @@ -72,10 +72,12 @@ void GraphicViewShellBase::Execute (SfxRequest& rRequest) { case SID_NOTES_WINDOW: case SID_SLIDE_SORTER_MULTI_PANE_GUI: - case SID_DIAMODE: - case SID_OUTLINEMODE: - case SID_NOTESMODE: - case SID_HANDOUTMODE: + case SID_SLIDE_SORTER_MODE: + case SID_SLIDE_MASTER_MODE: + case SID_OUTLINE_MODE: + case SID_NOTES_MODE: + case SID_NOTES_MASTER_MODE: + case SID_HANDOUT_MASTER_MODE: // Prevent some Impress-only slots from being executed. rRequest.Cancel(); break; diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 3436e3d8e2e1..41ad7255dfcf 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -157,6 +157,9 @@ public: */ void ShowViewTabBar (bool bShow); + void SetUserWantsTabBar(bool inValue); + inline bool GetUserWantsTabBar() { return mbUserWantsTabBar; } + /** Common code of ViewShellBase::OuterResizePixel() and ViewShellBase::InnerResizePixel(). */ @@ -187,7 +190,8 @@ public: private: ViewShellBase& mrBase; - + bool mbUserWantsTabBar; + bool mbTabBarShouldBeVisible; /** Hold a reference to the page cache manager of the slide sorter in order to ensure that it stays alive while the ViewShellBase is alive. @@ -364,6 +368,8 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) if (pFrameView != nullptr) pFrameView->SetViewShellTypeOnLoad(pViewShell->GetShellType()); } + // Hide the TabBar + mpImpl->SetUserWantsTabBar(false); } std::shared_ptr<ViewShellManager> ViewShellBase::GetViewShellManager() const @@ -630,13 +636,23 @@ void ViewShellBase::Execute (SfxRequest& rRequest) framework::FrameworkHelper::msSlideSorterURL); break; + case SID_TOGGLE_TABBAR_VISIBILITY: + mpImpl->SetUserWantsTabBar(!mpImpl->GetUserWantsTabBar()); + rRequest.Done(); + break; + + // draw + case SID_DRAWINGMODE: + // impress normal case SID_NORMAL_MULTI_PANE_GUI: + case SID_NOTES_MODE: + case SID_OUTLINE_MODE: case SID_SLIDE_SORTER_MULTI_PANE_GUI: - case SID_DRAWINGMODE: - case SID_DIAMODE: - case SID_OUTLINEMODE: - case SID_NOTESMODE: - case SID_HANDOUTMODE: + case SID_SLIDE_SORTER_MODE: + // impress master + case SID_SLIDE_MASTER_MODE: + case SID_NOTES_MASTER_MODE: + case SID_HANDOUT_MASTER_MODE: framework::FrameworkHelper::Instance(*this)->HandleModeChangeSlot(nSlotId, rRequest); break; @@ -833,8 +849,7 @@ void ViewShellBase::UpdateBorder ( bool bForce /* = false */ ) void ViewShellBase::ShowUIControls (bool bVisible) { - if (mpImpl->mpViewTabBar.is()) - mpImpl->mpViewTabBar->GetTabControl()->Show(bVisible); + mpImpl->ShowViewTabBar(bVisible); ViewShell* pMainViewShell = GetMainViewShell().get(); if (pMainViewShell != nullptr) @@ -1015,6 +1030,8 @@ ViewShellBase::Implementation::Implementation (ViewShellBase& rBase) mpEventMultiplexer(), mpFormShellManager(), mrBase(rBase), + mbUserWantsTabBar(false), + mbTabBarShouldBeVisible(true), mpPageCacheManager(slidesorter::cache::PageCacheManager::Instance()) { } @@ -1041,9 +1058,11 @@ void ViewShellBase::Implementation::ProcessRestoreEditingViewSlot() if (pFrameView != nullptr) { // Set view shell, edit mode, and page kind. + // pFrameView->SetViewShEditMode( + // pFrameView->GetViewShEditModeOnLoad(), + // pFrameView->GetPageKindOnLoad()); pFrameView->SetViewShEditMode( - pFrameView->GetViewShEditModeOnLoad(), - pFrameView->GetPageKindOnLoad()); + pFrameView->GetViewShEditModeOnLoad() ); pFrameView->SetPageKind( pFrameView->GetPageKindOnLoad()); std::shared_ptr<FrameworkHelper> pHelper (FrameworkHelper::Instance(mrBase)); @@ -1055,8 +1074,18 @@ void ViewShellBase::Implementation::ProcessRestoreEditingViewSlot() } } +void ViewShellBase::Implementation::SetUserWantsTabBar(bool inValue) +{ + mbUserWantsTabBar = inValue; + // Call ShowViewTabBar to refresh the TabBar visibility + ShowViewTabBar(mbTabBarShouldBeVisible); +} + void ViewShellBase::Implementation::ShowViewTabBar (bool bShow) { + mbTabBarShouldBeVisible = bShow; + bShow = bShow && mbUserWantsTabBar; + if (mpViewTabBar.is() && mpViewTabBar->GetTabControl()->IsVisible() != bShow) { @@ -1194,6 +1223,8 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) ::comphelper::getProcessComponentContext() ); SfxWhichIter aSetIterator (rSet); sal_uInt16 nItemId (aSetIterator.FirstWhich()); + + FrameView *pFrameView; while (nItemId > 0) { bool bState (false); @@ -1205,49 +1236,62 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) case SID_LEFT_PANE_IMPRESS: xResourceId = ResourceId::create( xContext, FrameworkHelper::msLeftImpressPaneURL); + bState = xConfiguration->hasResource(xResourceId); break; case SID_LEFT_PANE_DRAW: xResourceId = ResourceId::create( xContext, FrameworkHelper::msLeftDrawPaneURL); + bState = xConfiguration->hasResource(xResourceId); break; case SID_NORMAL_MULTI_PANE_GUI: - xResourceId = ResourceId::createWithAnchorURL( - xContext, - FrameworkHelper::msImpressViewURL, - FrameworkHelper::msCenterPaneURL); + pFrameView = mrBase.GetMainViewShell()->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_PAGE + && pFrameView->GetPageKind() == PK_STANDARD; break; + case SID_SLIDE_MASTER_MODE: + pFrameView = mrBase.GetMainViewShell()->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE + && pFrameView->GetPageKind() == PK_STANDARD; + case SID_SLIDE_SORTER_MULTI_PANE_GUI: - case SID_DIAMODE: + case SID_SLIDE_SORTER_MODE: xResourceId = ResourceId::createWithAnchorURL( xContext, FrameworkHelper::msSlideSorterURL, FrameworkHelper::msCenterPaneURL); + bState = xConfiguration->hasResource(xResourceId); break; - case SID_OUTLINEMODE: + case SID_OUTLINE_MODE: xResourceId = ResourceId::createWithAnchorURL( xContext, FrameworkHelper::msOutlineViewURL, FrameworkHelper::msCenterPaneURL); + bState = xConfiguration->hasResource(xResourceId); break; - case SID_HANDOUTMODE: - // There is only the master page mode for the handout - // view so ignore the master page flag. - xResourceId = ResourceId::createWithAnchorURL( - xContext, - FrameworkHelper::msHandoutViewURL, - FrameworkHelper::msCenterPaneURL); + case SID_HANDOUT_MASTER_MODE: + pFrameView = mrBase.GetMainViewShell()->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE + && pFrameView->GetPageKind() == PK_HANDOUT; break; - case SID_NOTESMODE: - xResourceId = ResourceId::createWithAnchorURL( - xContext, - FrameworkHelper::msNotesViewURL, - FrameworkHelper::msCenterPaneURL); + case SID_NOTES_MODE: + pFrameView = mrBase.GetMainViewShell()->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_PAGE + && pFrameView->GetPageKind() == PK_NOTES; + break; + + case SID_NOTES_MASTER_MODE: + pFrameView = mrBase.GetMainViewShell()->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE + && pFrameView->GetPageKind() == PK_NOTES; + + case SID_TOGGLE_TABBAR_VISIBILITY: + bState = GetUserWantsTabBar(); break; default: @@ -1267,7 +1311,7 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) switch (nItemId) { case SID_NORMAL_MULTI_PANE_GUI: - case SID_NOTESMODE: + case SID_NOTES_MODE: { // Determine the master page mode. ViewShell* pCenterViewShell = FrameworkHelper::Instance(mrBase)->GetViewShell( @@ -1285,7 +1329,7 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) break; } - case SID_HANDOUTMODE: + case SID_HANDOUT_MASTER_MODE: // There is only the master page mode for the handout // view so ignore the master page flag. break; diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 8be1d79295ce..a933808352d0 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -485,9 +485,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) Invalidate( SID_MASTERPAGE ); Invalidate( SID_DELETE_MASTER_PAGE ); Invalidate( SID_DELETE_PAGE ); - Invalidate( SID_SLIDE_MASTERPAGE ); - Invalidate( SID_NOTES_MASTERPAGE ); - Invalidate( SID_HANDOUT_MASTERPAGE ); + Invalidate( SID_SLIDE_MASTER_MODE ); + Invalidate( SID_NOTES_MASTER_MODE ); + Invalidate( SID_HANDOUT_MASTER_MODE ); InvalidateWindows(); SetContextName(GetSidebarContextName()); diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 88963c856f08..1b9649e98b71 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -277,7 +277,7 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView) nSelectedPage = pView->GetSelectedPage(); } - EditMode eNewEditMode = pView->GetViewShEditMode(mePageKind); + EditMode eNewEditMode = pView->GetViewShEditMode(/*mePageKind*/); bool bNewLayerMode = pView->IsLayerMode(); if(IsLayerModeActive() && bNewLayerMode) @@ -355,7 +355,7 @@ void DrawViewShell::WriteFrameViewData() mpFrameView->SetSelectedPage( maTabControl->GetCurPageId() - 1 ); } - mpFrameView->SetViewShEditMode(meEditMode, mePageKind); + mpFrameView->SetViewShEditMode(meEditMode); mpFrameView->SetLayerMode(IsLayerModeActive()); SdrPageView* pPageView = mpDrawView->GetSdrPageView(); @@ -478,15 +478,15 @@ void DrawViewShell::ReadUserDataSequence ( const css::uno::Sequence < css::beans if (mePageKind == PK_NOTES) { - SetHelpId( SID_NOTESMODE ); - GetActiveWindow()->SetHelpId( CMD_SID_NOTESMODE ); - GetActiveWindow()->SetUniqueId( CMD_SID_NOTESMODE ); + SetHelpId( SID_NOTES_MODE ); + GetActiveWindow()->SetHelpId( CMD_SID_NOTES_MODE ); + GetActiveWindow()->SetUniqueId( CMD_SID_NOTES_MODE ); } else if (mePageKind == PK_HANDOUT) { - SetHelpId( SID_HANDOUTMODE ); - GetActiveWindow()->SetHelpId( CMD_SID_HANDOUTMODE ); - GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUTMODE ); + SetHelpId( SID_HANDOUT_MASTER_MODE ); + GetActiveWindow()->SetHelpId( CMD_SID_HANDOUT_MASTER_MODE ); + GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUT_MASTER_MODE ); } else { @@ -518,7 +518,6 @@ void DrawViewShell::ReadUserDataSequence ( const css::uno::Sequence < css::beans SetZoomRect(aVisArea); } - ChangeEditMode (meEditMode, ! IsLayerModeActive()); ResetActualLayer(); } diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index feaad5ef48b1..1740fa69ab16 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -748,9 +748,9 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) **********************************************************************/ rSet.Put(SfxBoolItem(SID_PAGEMODE, true)); rSet.Put(SfxBoolItem(SID_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false)); rSet.DisableItem (SID_INSERT_MASTER_PAGE); rSet.DisableItem (SID_DELETE_MASTER_PAGE); @@ -767,22 +767,22 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) **********************************************************************/ if (mePageKind == PK_STANDARD) { - rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, true)); - rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, true)); + rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false)); } else if (mePageKind == PK_NOTES) { - rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, true)); - rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, true)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false)); } else if (mePageKind == PK_HANDOUT) { - rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, false)); - rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, true)); + rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, true)); } } @@ -1556,25 +1556,27 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) void DrawViewShell::GetModeSwitchingMenuState (SfxItemSet &rSet) { //DrawView - rSet.Put(SfxBoolItem(SID_DIAMODE, false)); - rSet.Put(SfxBoolItem(SID_OUTLINEMODE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_SORTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_OUTLINE_MODE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false)); if (mePageKind == PK_NOTES) { rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false)); - rSet.Put(SfxBoolItem(SID_NOTESMODE, true)); - rSet.Put(SfxBoolItem(SID_HANDOUTMODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MODE, true)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false)); } else if (mePageKind == PK_HANDOUT) { rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false)); - rSet.Put(SfxBoolItem(SID_NOTESMODE, false)); - rSet.Put(SfxBoolItem(SID_HANDOUTMODE, true)); + rSet.Put(SfxBoolItem(SID_NOTES_MODE, false)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, true)); } else { rSet.Put(SfxBoolItem(SID_DRAWINGMODE, true)); - rSet.Put(SfxBoolItem(SID_NOTESMODE, false)); - rSet.Put(SfxBoolItem(SID_HANDOUTMODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MODE, false)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false)); } // Removed [GetDocSh()->GetCurrentFunction() ||] from the following @@ -1591,33 +1593,45 @@ void DrawViewShell::GetModeSwitchingMenuState (SfxItemSet &rSet) rSet.DisableItem( SID_DRAWINGMODE ); } - rSet.ClearItem( SID_NOTESMODE ); - rSet.DisableItem( SID_NOTESMODE ); + rSet.ClearItem( SID_NOTES_MODE ); + rSet.DisableItem( SID_NOTES_MODE ); - rSet.ClearItem( SID_HANDOUTMODE ); - rSet.DisableItem( SID_HANDOUTMODE ); + rSet.ClearItem( SID_HANDOUT_MASTER_MODE ); + rSet.DisableItem( SID_HANDOUT_MASTER_MODE ); - rSet.ClearItem( SID_OUTLINEMODE ); - rSet.DisableItem( SID_OUTLINEMODE ); + rSet.ClearItem( SID_OUTLINE_MODE ); + rSet.DisableItem( SID_OUTLINE_MODE ); - rSet.ClearItem( SID_DIAMODE ); - rSet.DisableItem( SID_DIAMODE ); + rSet.ClearItem( SID_SLIDE_MASTER_MODE ); + rSet.DisableItem( SID_SLIDE_MASTER_MODE ); + + rSet.ClearItem( SID_NOTES_MASTER_MODE ); + rSet.DisableItem( SID_NOTES_MASTER_MODE ); + + rSet.ClearItem( SID_SLIDE_SORTER_MODE ); + rSet.DisableItem( SID_SLIDE_SORTER_MODE ); } if (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED) { // Outplace-Edit: do not allow switch - rSet.ClearItem( SID_OUTLINEMODE ); - rSet.DisableItem( SID_OUTLINEMODE ); + rSet.ClearItem( SID_OUTLINE_MODE ); + rSet.DisableItem( SID_OUTLINE_MODE ); + + rSet.ClearItem( SID_SLIDE_SORTER_MODE ); + rSet.DisableItem( SID_SLIDE_SORTER_MODE ); + + rSet.ClearItem( SID_NOTES_MODE ); + rSet.DisableItem( SID_NOTES_MODE ); - rSet.ClearItem( SID_DIAMODE ); - rSet.DisableItem( SID_DIAMODE ); + rSet.ClearItem( SID_HANDOUT_MASTER_MODE ); + rSet.DisableItem( SID_HANDOUT_MASTER_MODE ); - rSet.ClearItem( SID_NOTESMODE ); - rSet.DisableItem( SID_NOTESMODE ); + rSet.ClearItem( SID_SLIDE_MASTER_MODE ); + rSet.DisableItem( SID_SLIDE_MASTER_MODE ); - rSet.ClearItem( SID_HANDOUTMODE ); - rSet.DisableItem( SID_HANDOUTMODE ); + rSet.ClearItem( SID_NOTES_MASTER_MODE ); + rSet.DisableItem( SID_NOTES_MASTER_MODE ); } svx::ExtrusionBar::getState( mpDrawView, rSet ); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index c79450a88a0f..fd7de69dba7f 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -264,7 +264,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) /* In order to set the correct EditMode of the FrameView, we select another one (small trick). */ - if (mpFrameView->GetViewShEditMode(mePageKind) == EM_PAGE) + if (mpFrameView->GetViewShEditMode(/*mePageKind*/) == EM_PAGE) { meEditMode = EM_MASTERPAGE; } @@ -286,18 +286,18 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) { if (mePageKind == PK_NOTES) { - SetHelpId( SID_NOTESMODE ); - GetActiveWindow()->SetHelpId( CMD_SID_NOTESMODE ); - GetActiveWindow()->SetUniqueId( CMD_SID_NOTESMODE ); + SetHelpId( SID_NOTES_MODE ); + GetActiveWindow()->SetHelpId( CMD_SID_NOTES_MODE ); + GetActiveWindow()->SetUniqueId( CMD_SID_NOTES_MODE ); // AutoLayouts have to be created GetDoc()->StopWorkStartupDelay(); } else if (mePageKind == PK_HANDOUT) { - SetHelpId( SID_HANDOUTMODE ); - GetActiveWindow()->SetHelpId( CMD_SID_HANDOUTMODE ); - GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUTMODE ); + SetHelpId( SID_HANDOUT_MASTER_MODE ); + GetActiveWindow()->SetHelpId( CMD_SID_HANDOUT_MASTER_MODE ); + GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUT_MASTER_MODE ); // AutoLayouts have to be created GetDoc()->StopWorkStartupDelay(); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index fea938d48b7d..80b2bab98a8f 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -56,6 +56,7 @@ #include <tools/urlobj.hxx> #include <svl/slstitm.hxx> #include <sfx2/ipclient.hxx> +#include <sfx2/sidebar/Sidebar.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <avmedia/mediawindow.hxx> #include <svl/urihelper.hxx> @@ -964,15 +965,18 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) } break; - case SID_NOTESMODE: - case SID_HANDOUTMODE: + case SID_NOTES_MODE: + case SID_SLIDE_MASTER_MODE: + case SID_NOTES_MASTER_MODE: + case SID_HANDOUT_MASTER_MODE: + // AutoLayouts have to be ready. GetDoc()->StopWorkStartupDelay(); // Fall through to following case statements. case SID_DRAWINGMODE: - case SID_DIAMODE: - case SID_OUTLINEMODE: + case SID_SLIDE_SORTER_MODE: + case SID_OUTLINE_MODE: // Let the sub-shell manager handle the slot handling. framework::FrameworkHelper::Instance(GetViewShellBase())->HandleModeChangeSlot( nSId, @@ -981,9 +985,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) break; case SID_MASTERPAGE: // BASIC - case SID_SLIDE_MASTERPAGE: // BASIC - case SID_NOTES_MASTERPAGE: // BASIC - case SID_HANDOUT_MASTERPAGE: // BASIC { // AutoLayouts needs to be finished GetDoc()->StopWorkStartupDelay(); @@ -999,70 +1000,32 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) Broadcast ( ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START)); - if (nSId == SID_MASTERPAGE || - (nSId == SID_SLIDE_MASTERPAGE && mePageKind == PK_STANDARD) || - (nSId == SID_NOTES_MASTERPAGE && mePageKind == PK_NOTES) || - (nSId == SID_HANDOUT_MASTERPAGE && mePageKind == PK_HANDOUT)) - { - if (nSId == SID_SLIDE_MASTERPAGE) - { - // Is there a page with the AutoLayout "Title"? - bool bFound = false; - sal_uInt16 i = 0; - sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD); + // Is there a page with the AutoLayout "Title"? + bool bFound = false; + sal_uInt16 i = 0; + sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD); - while (i < nCount && !bFound) - { - SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD); - - if (nSId == SID_SLIDE_MASTERPAGE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE) - { - bFound = true; - SwitchPage((pPage->GetPageNum() - 1) / 2); - } + while (i < nCount && !bFound) + { + SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD); - i++; - } + if (nSId == SID_SLIDE_MASTER_MODE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE) + { + bFound = true; + SwitchPage((pPage->GetPageNum() - 1) / 2); } - // turn on default layer of MasterPage - mpDrawView->SetActiveLayer( SD_RESSTR(STR_LAYER_BCKGRNDOBJ) ); - - ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive); - - if(HasCurrentFunction(SID_BEZIER_EDIT)) - GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); + i++; } - else - { - // Switch to requested ViewShell. - ::OUString sRequestedView; - PageKind ePageKind; - switch (nSId) - { - case SID_SLIDE_MASTERPAGE: - default: - sRequestedView = framework::FrameworkHelper::msImpressViewURL; - ePageKind = PK_STANDARD; - break; - case SID_NOTES_MASTERPAGE: - sRequestedView = framework::FrameworkHelper::msNotesViewURL; - ePageKind = PK_NOTES; - break; + // turn on default layer of MasterPage + mpDrawView->SetActiveLayer( SD_RESSTR(STR_LAYER_BCKGRNDOBJ) ); - case SID_HANDOUT_MASTERPAGE: - sRequestedView = framework::FrameworkHelper::msHandoutViewURL; - ePageKind = PK_HANDOUT; - break; - } + ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive); + + if(HasCurrentFunction(SID_BEZIER_EDIT)) + GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); - mpFrameView->SetViewShEditMode(EM_MASTERPAGE, ePageKind); - mpFrameView->SetLayerMode(mbIsLayerModeActive); - framework::FrameworkHelper::Instance(GetViewShellBase())->RequestView( - sRequestedView, - framework::FrameworkHelper::msCenterPaneURL); - } Broadcast ( ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END)); diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 2b34d6b51eca..99c879759b31 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -175,9 +175,10 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * mePageKindOnLoad = pFrameView->GetPageKindOnLoad(); mnSelectedPage = pFrameView->GetSelectedPage(); mnSelectedPageOnLoad = pFrameView->GetSelectedPageOnLoad(); - meStandardEditMode = pFrameView->GetViewShEditMode(PK_STANDARD); - meNotesEditMode = pFrameView->GetViewShEditMode(PK_NOTES); - meHandoutEditMode = pFrameView->GetViewShEditMode(PK_HANDOUT); + meEditMode = pFrameView->GetViewShEditMode(); + // meStandardEditMode = pFrameView->GetViewShEditMode(PK_STANDARD); + // meNotesEditMode = pFrameView->GetViewShEditMode(PK_NOTES); + // meHandoutEditMode = pFrameView->GetViewShEditMode(PK_HANDOUT); SetViewShEditModeOnLoad(pFrameView->GetViewShEditModeOnLoad()); mbLayerMode = pFrameView->IsLayerMode(); mbQuickEdit = pFrameView->IsQuickEdit(); @@ -209,9 +210,10 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * mePageKindOnLoad = PK_STANDARD; mnSelectedPage = 0; mnSelectedPageOnLoad = 0; - meStandardEditMode = EM_PAGE; - meNotesEditMode = EM_PAGE; - meHandoutEditMode = EM_MASTERPAGE; + meEditMode = EM_PAGE; + // meStandardEditMode = EM_PAGE; + // meNotesEditMode = EM_PAGE; + // meHandoutEditMode = EM_MASTERPAGE; SetViewShEditModeOnLoad(EM_PAGE); mbLayerMode = false; SetEliminatePolyPoints(false); @@ -317,43 +319,17 @@ void FrameView::Update(SdOptions* pOptions) /** * Set EditMode (Page or MasterPage) of working mode */ -void FrameView::SetViewShEditMode(EditMode eMode, PageKind eKind) +void FrameView::SetViewShEditMode(EditMode eMode) { - if (eKind == PK_STANDARD) - { - meStandardEditMode = eMode; - } - else if (eKind == PK_NOTES) - { - meNotesEditMode = eMode; - } - else if (eKind == PK_HANDOUT) - { - meHandoutEditMode = eMode; - } + meEditMode = eMode; } /** * Return EditMode (Page or MasterPage) of working mode */ -EditMode FrameView::GetViewShEditMode(PageKind eKind) +EditMode FrameView::GetViewShEditMode() { - EditMode eMode = EM_PAGE; - - if (eKind == PK_STANDARD) - { - eMode = meStandardEditMode; - } - else if (eKind == PK_NOTES) - { - eMode = meNotesEditMode; - } - else if (eKind == PK_HANDOUT) - { - eMode = meHandoutEditMode; - } - - return eMode; + return meEditMode; } void FrameView::SetViewShEditModeOnLoad (EditMode eMode) @@ -445,9 +421,10 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert aUserData.addValue( sUNO_View_IsClickChangeRotation, makeAny( IsClickChangeRotation() ) ); aUserData.addValue( sUNO_View_SlidesPerRow, makeAny( (sal_Int16)GetSlidesPerRow() ) ); - aUserData.addValue( sUNO_View_EditModeStandard, makeAny( (sal_Int32)GetViewShEditMode( PK_STANDARD ) ) ); - aUserData.addValue( sUNO_View_EditModeNotes, makeAny( (sal_Int32)GetViewShEditMode( PK_NOTES ) ) ); - aUserData.addValue( sUNO_View_EditModeHandout, makeAny( (sal_Int32)GetViewShEditMode( PK_HANDOUT ) ) ); + aUserData.addValue( sUNO_View_EditMode, makeAny( (sal_Int32)GetViewShEditMode() ) ); + // aUserData.addValue( sUNO_View_EditModeStandard, makeAny( (sal_Int32)GetViewShEditMode( PK_STANDARD ) ) ); + // aUserData.addValue( sUNO_View_EditModeNotes, makeAny( (sal_Int32)GetViewShEditMode( PK_NOTES ) ) ); + // aUserData.addValue( sUNO_View_EditModeHandout, makeAny( (sal_Int32)GetViewShEditMode( PK_HANDOUT ) ) ); { const Rectangle aVisArea = GetVisArea(); @@ -655,31 +632,25 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr SetSlidesPerRow( (sal_uInt16)nInt16 ); } } - else if ( pValue->Name == sUNO_View_EditModeStandard ) + else if ( pValue->Name == sUNO_View_EditMode ) { if( pValue->Value >>= nInt32 ) { SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() ); if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) - SetViewShEditMode( (EditMode)nInt32, PK_STANDARD ); + SetViewShEditMode( (EditMode)nInt32 ); } } - else if ( pValue->Name == sUNO_View_EditModeNotes ) - { - if( pValue->Value >>= nInt32 ) - { - SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() ); - if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) - SetViewShEditMode( (EditMode)nInt32, PK_NOTES ); - } - } - else if ( pValue->Name == sUNO_View_EditModeHandout ) + // This one is kept for compatibility. Old value read from sUNO_View_EditModeStandard + // is used. New value will be written into sUNO_View_EditMode. + // Values from sUNO_View_EditModeNotes and sUNO_View_EditModeHangout will be ignored. + else if ( pValue->Name == sUNO_View_EditModeStandard ) { if( pValue->Value >>= nInt32 ) { SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() ); if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) - SetViewShEditMode( (EditMode)nInt32, PK_HANDOUT ); + SetViewShEditMode( (EditMode)nInt32 ); } } else if ( pValue->Name == sUNO_View_VisibleAreaTop ) @@ -906,13 +877,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr } } - switch (GetPageKindOnLoad()) - { - case PK_STANDARD: SetViewShEditModeOnLoad(meStandardEditMode); break; - case PK_NOTES: SetViewShEditModeOnLoad(meNotesEditMode); break; - case PK_HANDOUT: SetViewShEditModeOnLoad(meHandoutEditMode); break; - default: SetViewShEditModeOnLoad(EM_PAGE); break; - } + SetViewShEditModeOnLoad(EM_PAGE); const Fraction aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom ); const Fraction aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom ); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index bacfa42515ae..8acacd4459ca 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -538,10 +538,12 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) break; case SID_DRAWINGMODE: - case SID_NOTESMODE: - case SID_HANDOUTMODE: - case SID_DIAMODE: - case SID_OUTLINEMODE: + case SID_SLIDE_MASTER_MODE: + case SID_NOTES_MODE: + case SID_NOTES_MASTER_MODE: + case SID_HANDOUT_MASTER_MODE: + case SID_SLIDE_SORTER_MODE: + case SID_OUTLINE_MODE: framework::FrameworkHelper::Instance(GetViewShellBase())->HandleModeChangeSlot( nSlot, rReq); @@ -724,11 +726,13 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) { ViewShell::GetMenuState(rSet); - rSet.Put(SfxBoolItem(SID_DIAMODE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_SORTER_MODE, false)); rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false)); - rSet.Put(SfxBoolItem(SID_OUTLINEMODE, true)); - rSet.Put(SfxBoolItem(SID_NOTESMODE, false)); - rSet.Put(SfxBoolItem(SID_HANDOUTMODE, false)); + rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_OUTLINE_MODE, true)); + rSet.Put(SfxBoolItem(SID_NOTES_MODE, false)); + rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false)); + rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false)); if (!mpZoomList->IsNextPossible()) { diff --git a/sd/uiconfig/simpress/toolbar/standardbar.xml b/sd/uiconfig/simpress/toolbar/standardbar.xml index ef4658c4baa3..47d67769a5dc 100644 --- a/sd/uiconfig/simpress/toolbar/standardbar.xml +++ b/sd/uiconfig/simpress/toolbar/standardbar.xml @@ -41,6 +41,9 @@ <toolbar:toolbaritem xlink:href=".uno:Undo"/> <toolbar:toolbaritem xlink:href=".uno:Redo"/> <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:DisplayMode" toolbar:style="dropdownonly"/> + <toolbar:toolbaritem xlink:href=".uno:ToggleTabBarVisibility" toolbar:visible="false"/> + <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> <toolbar:toolbaritem xlink:href=".uno:SpellDialog"/> <toolbar:toolbaritem xlink:href=".uno:SpellOnline" toolbar:visible="false"/> diff --git a/sd/util/sd.component b/sd/util/sd.component index ab85d55ccce9..a3e531a657d7 100644 --- a/sd/util/sd.component +++ b/sd/util/sd.component @@ -103,6 +103,10 @@ constructor="com_sun_star_comp_sd_SlideLayoutController_get_implementation"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> + <implementation name="com.sun.star.comp.sd.DisplayModeController" + constructor="com_sun_star_comp_sd_DisplayModeController_get_implementation"> + <service name="com.sun.star.frame.ToolbarController"/> + </implementation> <implementation name="sd::RandomAnimationNode" constructor="RandomAnimationNode_get_implementation"> <service name="com.sun.star.comp.sd.RandomAnimationNode"/> |