include/svx/svdedxv.hxx | 8 sd/Library_sd.mk | 2 sd/inc/app.hrc | 2 sd/inc/glob.hxx | 2 sd/sdi/NotesPanelView.sdi | 514 ------ sd/sdi/sdslots.sdi | 1 sd/source/ui/app/sddll.cxx | 1 sd/source/ui/dlg/PaneChildWindows.cxx | 28 sd/source/ui/dlg/PaneShells.cxx | 17 sd/source/ui/framework/factories/BasicPaneFactory.cxx | 12 sd/source/ui/framework/factories/BasicViewFactory.cxx | 7 sd/source/ui/framework/tools/FrameworkHelper.cxx | 4 sd/source/ui/func/fuoltext.cxx | 141 - sd/source/ui/inc/NotesPanelView.hxx | 100 - sd/source/ui/inc/NotesPanelViewShell.hxx | 101 - sd/source/ui/inc/OutlineView.hxx | 18 sd/source/ui/inc/PaneChildWindows.hxx | 13 sd/source/ui/inc/PaneShells.hxx | 17 sd/source/ui/inc/TextObjectBar.hxx | 3 sd/source/ui/inc/ViewShell.hxx | 3 sd/source/ui/inc/framework/FrameworkHelper.hxx | 2 sd/source/ui/inc/fuoltext.hxx | 51 sd/source/ui/view/NotesPanelView.cxx | 320 --- sd/source/ui/view/NotesPanelViewShell.cxx | 1448 ------------------ sd/source/ui/view/ToolBarManager.cxx | 1 sd/source/ui/view/ViewShellBase.cxx | 25 sd/source/ui/view/ViewShellImplementation.cxx | 1 sd/source/ui/view/drtxtob.cxx | 34 sd/source/ui/view/drtxtob1.cxx | 48 sd/source/ui/view/outlview.cxx | 2 30 files changed, 131 insertions(+), 2795 deletions(-)
New commits: commit bbf4fb9daf4c9ac6845fd45d6801e484e5ccaf37 Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Fri Apr 12 01:09:57 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Fri Apr 12 01:13:40 2024 +0200 Revert "tdf#33603: sd: rework notes panel" Plus all related changes: * reverts commit 9a6a3c7771a5ba24d88043faf4c3dfdb7cd1d1e5 * reverts commit d6ae523008ca601b134bf86fcb51753bac13b149 * reverts commit 4151d0bb02a679eab7266e9b0e64de22403ee40a * reverts commit 762461a36fbcfcd141435570b86349127c6724d1 * reverts commit 2d2ba2a44bdd6c970571b39573d8dbcf7add0f11 diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 665e1f9562a3..37621159bb8c 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -253,19 +253,19 @@ public: // Now at this outliner, events can be send, attributes can be set, // call Cut/Copy/Paste, call Undo/Redo, and so on... - virtual const SdrOutliner* GetTextEditOutliner() const + const SdrOutliner* GetTextEditOutliner() const { return mpTextEditOutliner.get(); } - virtual SdrOutliner* GetTextEditOutliner() + SdrOutliner* GetTextEditOutliner() { return mpTextEditOutliner.get(); } - virtual const OutlinerView* GetTextEditOutlinerView() const + const OutlinerView* GetTextEditOutlinerView() const { return mpTextEditOutlinerView; } - virtual OutlinerView* GetTextEditOutlinerView() + OutlinerView* GetTextEditOutlinerView() { return mpTextEditOutlinerView; } diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index e133e7175a84..d7483cb77c25 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -517,8 +517,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/view/viewshe3 \ sd/source/ui/view/viewshel \ sd/source/ui/view/zoomlist \ - sd/source/ui/view/NotesPanelView \ - sd/source/ui/view/NotesPanelViewShell \ )) ifeq ($(ENABLE_SDREMOTE),TRUE) diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index 68cdde14a5d9..e275e4688258 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -421,7 +421,7 @@ #define SID_LEFT_PANE_IMPRESS (SID_SD_START+414) #define SID_LEFT_PANE_DRAW (SID_SD_START+415) -#define SID_BOTTOM_PANE_IMPRESS (SID_SD_START+416) + // FREE #define SID_NOTES_WINDOW (SID_SD_START+417) // FREE #define SID_NORMAL_MULTI_PANE_GUI TypedWhichId<SfxBoolItem>(SID_SD_START+420) diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx index 1a505a767c37..6ecfc3fd39ce 100644 --- a/sd/inc/glob.hxx +++ b/sd/inc/glob.hxx @@ -39,8 +39,6 @@ #define SD_IF_SDDRAWTABLEOBJECTBAR SFX_INTERFACE_SD_START + SfxInterfaceId(27) #define SD_IF_SDTOOLPANELPANESHELL SFX_INTERFACE_SD_START + SfxInterfaceId(29) #define SD_IF_SDTOOLPANELSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(30) -#define SD_IF_SDBOTTOMIMPRESSPANESHELL SFX_INTERFACE_SD_START + SfxInterfaceId(31) -#define SD_IF_SDNOTESPANELVIEWSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(32) // Object-Ids for StarDraw UserData diff --git a/sd/sdi/NotesPanelView.sdi b/sd/sdi/NotesPanelView.sdi deleted file mode 100644 index 90217efaa4e8..000000000000 --- a/sd/sdi/NotesPanelView.sdi +++ /dev/null @@ -1,514 +0,0 @@ -/* - * 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/. - */ - -interface NotesPanelView -{ - SID_CUT // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_COPY // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_PASTE // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_PASTE_UNFORMATTED // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_DELETE // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - Asynchron ; - ] - SID_DRAWINGMODE // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_ZOOM_NEXT // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_ZOOM_PREV // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_ZOOM_TOOLBOX // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetStatusBarState ; - ] - SID_ATTR_ZOOM // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetStatusBarState ; - ] - SID_ATTR_ZOOMSLIDER // status() - [ - ExecMethod = FuTemporary ; - StateMethod = GetStatusBarState ; - ] - SID_ZOOM_OUT // ole : no, status : play rec - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_ZOOM_IN // ole : no, status : play rec - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_SIZE_REAL // ole : no, status : play rec - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_SIZE_VISAREA // ole : no, status : no - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_HYPERLINK_SETLINK // ole : no, status : no - [ - ExecMethod = FuTemporaryModify ; - ] - SID_HYPERLINK_GETLINK // ole : no, status : no - [ - StateMethod = GetCtrlState ; - ] - SID_READONLY_MODE // ole : no, status : no - [ - StateMethod = GetCtrlState ; - ] - SID_CHARMAP // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_CHARMAP_CONTROL // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - FN_INSERT_SOFT_HYPHEN // status(final|play) - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - FN_INSERT_HARDHYPHEN // status() - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - FN_INSERT_HARD_SPACE // status(final|play) - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - FN_INSERT_NNBSP // status(final|play) - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_RLM - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_INSERT_LRM - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_ZWSP - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_WJ - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - FN_SVX_SET_BULLET - [ - ExecMethod = FuTemporaryModify ; - ] - FN_SVX_SET_NUMBER - [ - ExecMethod = FuTemporaryModify ; - ] - SID_OUTLINE_BULLET // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_CHAR_DLG // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_CHAR_DLG_EFFECT // wj for sym2_1876 - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_SELECTALL // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - GroupId = SfxGroupId::Document ; - ] - SID_INSERTFILE // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_PRESENTATION // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_PRESENTATION_CURRENT_SLIDE // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_EDIT_OUTLINER // ole : no, status : ? - [ - ExecMethod = FuPermanent ; - StateMethod = GetMenuState ; - ] - SID_SAVEDOC // ole : no, status : ? - [ - ExecMethod = Execute ; - StateMethod = GetMenuState ; - GroupId = SfxGroupId::Document ; - ] - SID_SAVEASDOC // ole : no, status : ? - [ - ExecMethod = Execute ; - GroupId = SfxGroupId::Document ; - ] - SID_RULER // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_STATUS_PAGE // ole : no, status : ? - [ - ExecMethod = ExecStatusBar ; - StateMethod = GetStatusBarState ; - ] - SID_STATUS_LAYOUT // ole : no, status : ? - [ - ExecMethod = ExecStatusBar ; - StateMethod = GetStatusBarState ; - ] - SID_SCALE // ole : no, status : ? - [ - ExecMethod = ExecStatusBar ; - StateMethod = GetStatusBarState ; - ] - SID_THESAURUS // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_SET_DEFAULT // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_PRESENTATIONOBJECT - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - // Templates - // no menu entry - SID_STYLE_FAMILY2 // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - SID_STYLE_FAMILY3 // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - // Templates - // no menu entry - SID_STYLE_FAMILY5 // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - ] - // no menu entry - SID_STYLE_EDIT // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - // no menu entry - SID_STYLE_UPDATE_BY_EXAMPLE // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - // no menu entry - SID_STYLE_WATERCAN // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - // no menu entry - SID_STYLE_NEW_BY_EXAMPLE // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - // no menu entry - SID_STYLE_NEW // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - // no menu entry - SID_STYLE_DELETE // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - SID_STYLE_HIDE - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - SID_STYLE_SHOW - [ - ExecMethod = FuTemporary ; - StateMethod = GetAttrState ; - GroupId = SfxGroupId::Document ; - ] - SID_AUTOSPELL_CHECK // ole : no, status : play rec - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_PREVIEW_STATE // ole : no, status : ? - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_PRESENTATION_DLG - [ - ExecMethod = FuTemporary ; - ] - SID_REMOTE_DLG - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] - SID_CUSTOMSHOW_DLG - [ - ExecMethod = FuTemporary ; - ] - SID_EXPAND_PAGE // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_SUMMARY_PAGE // ole : no, status : ? - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_DATE_FIX // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_DATE_VAR // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_TIME_FIX // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_TIME_VAR // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_PAGE_TITLE // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_PAGE // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_PAGES // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_FILE // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_INSERT_FLD_AUTHOR // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - SID_MODIFY_FIELD // ole : no, status : play rec - [ - ExecMethod = FuTemporaryModify ; - StateMethod = GetMenuState ; - ] - - SID_MAIL_SCROLLBODY_PAGEDOWN // ole : no, status : ? - [ - ExecMethod = ExecCtrl ; - StateMethod = GetCtrlState ; - ] - SID_STYLE_FAMILY - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_TRANSLITERATE_SENTENCE_CASE // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_TITLE_CASE // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_TOGGLE_CASE // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_UPPER // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_LOWER // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_HALFWIDTH // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_FULLWIDTH // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_HIRAGANA // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_TRANSLITERATE_KATAKANA // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetCtrlState ; - ] - SID_OPT_LOCALE_CHANGED // ole : no, status : ? - [ - ExecMethod = ExecCtrl ; - StateMethod = GetCtrlState ; - ] - - SID_GETUNDOSTRINGS // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_UNDO // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_GETREDOSTRINGS // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - SID_REDO // ole : no, status : ? - [ - ExecMethod = FuSupport ; - StateMethod = GetMenuState ; - ] - - SID_SEARCH_OPTIONS // ole : ?, status : ? - [ - ExecMethod = Execute ; - StateMethod = GetState ; - GroupId = SfxGroupId::Document ; - ] - SID_SEARCH_ITEM // ole : ?, status : ? - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] - SID_SPELL_DIALOG // ole : no, status : ? - [ - ExecMethod = Execute ; - StateMethod = GetMenuState ; - ] - SID_PHOTOALBUM - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] -} - -include "drtxtob.sdi" - -shell NotesPanelViewShell -{ - import NotesPanelView; - import TextObjectBar; -} diff --git a/sd/sdi/sdslots.sdi b/sd/sdi/sdslots.sdi index 95ed6d6ab152..751c09901fa8 100644 --- a/sd/sdi/sdslots.sdi +++ b/sd/sdi/sdslots.sdi @@ -88,5 +88,4 @@ module StarDraw include "ViewShellBase.sdi" include "mediaob.sdi" include "tables.sdi" - include "NotesPanelView.sdi" } diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 84d73a64611f..331c32afe5a7 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -177,7 +177,6 @@ void SdDLL::RegisterControllers(SdModule* pMod) ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod); #endif ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod); - ::sd::BottomPaneImpressChildWindow::RegisterChildWindow(false, pMod); ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod); ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod); ::sd::NotesChildWindow::RegisterChildWindow(false, pMod); diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 5bbfa4eb2c4d..320ce2a74b3d 100644 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -32,7 +32,6 @@ namespace sd { SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS) -SFX_IMPL_DOCKINGWINDOW_WITHID(BottomPaneImpressChildWindow, SID_BOTTOM_PANE_IMPRESS) SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW) //===== PaneChildWindow ======================================================= @@ -41,8 +40,7 @@ PaneChildWindow::PaneChildWindow ( sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo, - TranslateId pTitleBarResId, - SfxChildAlignment eAlignment) + TranslateId pTitleBarResId) : SfxChildWindow (pParentWindow, nId) { SetWindow( VclPtr<TitledDockingWindow>::Create( @@ -50,7 +48,7 @@ PaneChildWindow::PaneChildWindow ( this, pParentWindow, SdResId(pTitleBarResId))); - SetAlignment(eAlignment); + SetAlignment(SfxChildAlignment::LEFT); SfxDockingWindow* pDockingWindow = static_cast<SfxDockingWindow*>(GetWindow()); pDockingWindow->EnableInput(); pDockingWindow->Initialize(pInfo); @@ -85,24 +83,7 @@ LeftPaneImpressChildWindow::LeftPaneImpressChildWindow ( nId, pBindings, pInfo, - STR_LEFT_PANE_IMPRESS_TITLE, - SfxChildAlignment::LEFT) -{ -} - -//===== BottomPaneImpressChildWindow ============================================ -BottomPaneImpressChildWindow::BottomPaneImpressChildWindow ( - vcl::Window* pParentWindow, - sal_uInt16 nId, - SfxBindings* pBindings, - SfxChildWinInfo* pInfo) - : PaneChildWindow( - pParentWindow, - nId, - pBindings, - pInfo, - STR_NOTES_MODE, // TODO this isn't a specific translatable string for this view. - SfxChildAlignment::BOTTOM) + STR_LEFT_PANE_IMPRESS_TITLE) { } @@ -117,8 +98,7 @@ LeftPaneDrawChildWindow::LeftPaneDrawChildWindow ( nId, pBindings, pInfo, - STR_LEFT_PANE_DRAW_TITLE, - SfxChildAlignment::LEFT) + STR_LEFT_PANE_DRAW_TITLE) { } diff --git a/sd/source/ui/dlg/PaneShells.cxx b/sd/source/ui/dlg/PaneShells.cxx index ab523bf7c83c..77e411aaedc2 100644 --- a/sd/source/ui/dlg/PaneShells.cxx +++ b/sd/source/ui/dlg/PaneShells.cxx @@ -50,23 +50,6 @@ LeftImpressPaneShell::~LeftImpressPaneShell() { } -//===== BottomImpressPaneShell ================================================== - -static SfxSlot aBottomImpressPaneShellSlots_Impl[] - = { { 0, SfxGroupId::NONE, SfxSlotMode::NONE, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr, - 0, SfxDisableFlags::NONE, "" } }; - -SFX_IMPL_INTERFACE(BottomImpressPaneShell, SfxShell) - -void BottomImpressPaneShell::InitInterface_Impl() -{ - GetStaticInterface()->RegisterChildWindow(::sd::BottomPaneImpressChildWindow::GetChildWindowId()); -} - -BottomImpressPaneShell::BottomImpressPaneShell() { SetName("BottomImpressPane"); } - -BottomImpressPaneShell::~BottomImpressPaneShell() {} - //===== LeftDrawPaneShell ===================================================== static SfxSlot aLeftDrawPaneShellSlots_Impl[] = diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx index 5700de9583bd..e112ac4c315a 100644 --- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -46,7 +46,6 @@ namespace { CenterPaneId, FullScreenPaneId, LeftImpressPaneId, - BottomImpressPaneId, LeftDrawPaneId }; @@ -120,11 +119,6 @@ BasicPaneFactory::BasicPaneFactory ( mpPaneContainer->push_back(aDescriptor); xCC->addResourceFactory(aDescriptor.msPaneURL, this); - aDescriptor.msPaneURL = FrameworkHelper::msBottomImpressPaneURL; - aDescriptor.mePaneId = BottomImpressPaneId; - mpPaneContainer->push_back(aDescriptor); - xCC->addResourceFactory(aDescriptor.msPaneURL, this); - aDescriptor.msPaneURL = FrameworkHelper::msLeftDrawPaneURL; aDescriptor.mePaneId = LeftDrawPaneId; mpPaneContainer->push_back(aDescriptor); @@ -228,7 +222,6 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource ( break; case LeftImpressPaneId: - case BottomImpressPaneId: case LeftDrawPaneId: xPane = CreateChildWindowPane( rxPaneId, @@ -375,11 +368,6 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane ( nChildWindowId = ::sd::LeftPaneImpressChildWindow::GetChildWindowId(); break; - case BottomImpressPaneId: - pShell.reset(new BottomImpressPaneShell()); - nChildWindowId = ::sd::BottomPaneImpressChildWindow::GetChildWindowId(); - break; - case LeftDrawPaneId: pShell.reset(new LeftDrawPaneShell()); nChildWindowId = ::sd::LeftPaneDrawChildWindow::GetChildWindowId(); diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 61118d650bbe..3ea7e37f1f93 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -31,7 +31,6 @@ #include <DrawViewShell.hxx> #include <GraphicViewShell.hxx> #include <OutlineViewShell.hxx> -#include <NotesPanelViewShell.hxx> #include <PresentationViewShell.hxx> #include <SlideSorterViewShell.hxx> #include <FrameView.hxx> @@ -107,7 +106,6 @@ BasicViewFactory::BasicViewFactory (const rtl::Reference<::sd::DrawController>& mxConfigurationController->addResourceFactory(FrameworkHelper::msHandoutViewURL, this); mxConfigurationController->addResourceFactory(FrameworkHelper::msPresentationViewURL, this); mxConfigurationController->addResourceFactory(FrameworkHelper::msSlideSorterURL, this); - mxConfigurationController->addResourceFactory(FrameworkHelper::msNotesPanelViewURL, this); } catch (RuntimeException&) { @@ -369,11 +367,6 @@ std::shared_ptr<ViewShell> BasicViewFactory::CreateViewShell ( pFrameView); pViewShell->GetContentWindow()->set_id("slidesorter"); } - else if (rsViewURL == FrameworkHelper::msNotesPanelViewURL) - { - pViewShell = std::make_shared<NotesPanelViewShell>(&rFrame, *mpBase, &rWindow, pFrameView); - pViewShell->GetContentWindow()->set_id("notes_panel_win"); - } return pViewShell; } diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index d47ebc5fa8ac..0a42649b1c85 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -174,7 +174,6 @@ namespace { const OUString FrameworkHelper::msCenterPaneURL( msPaneURLPrefix + "CenterPane"); const OUString FrameworkHelper::msFullScreenPaneURL( msPaneURLPrefix + "FullScreenPane"); const OUString FrameworkHelper::msLeftImpressPaneURL( msPaneURLPrefix + "LeftImpressPane"); -const OUString FrameworkHelper::msBottomImpressPaneURL( msPaneURLPrefix + "BottomImpressPane"); const OUString FrameworkHelper::msLeftDrawPaneURL( msPaneURLPrefix + "LeftDrawPane"); // View URLs. @@ -187,7 +186,6 @@ const OUString FrameworkHelper::msHandoutViewURL( msViewURLPrefix + "HandoutView const OUString FrameworkHelper::msSlideSorterURL( msViewURLPrefix + "SlideSorter"); const OUString FrameworkHelper::msPresentationViewURL( msViewURLPrefix + "PresentationView"); const OUString FrameworkHelper::msSidebarViewURL( msViewURLPrefix + "SidebarView"); -const OUString FrameworkHelper::msNotesPanelViewURL( msViewURLPrefix + "NotesPanelView"); // Tool bar URLs. @@ -436,7 +434,6 @@ ViewShell::ShellType FrameworkHelper::GetViewId (const OUString& rsViewURL) maViewURLMap[msSlideSorterURL] = ViewShell::ST_SLIDE_SORTER; maViewURLMap[msPresentationViewURL] = ViewShell::ST_PRESENTATION; maViewURLMap[msSidebarViewURL] = ViewShell::ST_SIDEBAR; - maViewURLMap[msNotesPanelViewURL] = ViewShell::ST_NOTESPANEL; } ViewURLMap::const_iterator iView (maViewURLMap.find(rsViewURL)); if (iView != maViewURLMap.end()) @@ -457,7 +454,6 @@ OUString FrameworkHelper::GetViewURL (ViewShell::ShellType eType) case ViewShell::ST_SLIDE_SORTER : return msSlideSorterURL; case ViewShell::ST_PRESENTATION : return msPresentationViewURL; case ViewShell::ST_SIDEBAR : return msSidebarViewURL; - case ViewShell::ST_NOTESPANEL: return msNotesPanelViewURL; default: return OUString(); } diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index 0068f77d4053..fe64cac47dfb 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -82,85 +82,25 @@ const sal_uInt16 SidArray[] = { SID_SUMMARY_PAGE, 0 }; -void FuOutlineText::UpdateForKeyPress (const KeyEvent& rEvent) -{ - FuSimpleOutlinerText::UpdateForKeyPress(rEvent); - - bool bUpdatePreview = true; - switch (rEvent.GetKeyCode().GetCode()) - { - // When just the cursor has been moved the preview only changes when - // it moved to entries of another page. To prevent unnecessary - // updates we check this here. This is an early rejection test, so - // missing a key is not a problem. - case KEY_UP: - case KEY_DOWN: - case KEY_LEFT: - case KEY_RIGHT: - case KEY_HOME: - case KEY_END: - case KEY_PAGEUP: - case KEY_PAGEDOWN: - { - SdPage* pCurrentPage = pOutlineViewShell->GetActualPage(); - bUpdatePreview = (pCurrentPage != pOutlineViewShell->GetActualPage()); - } - break; - } - if (bUpdatePreview) - pOutlineViewShell->UpdatePreview (pOutlineViewShell->GetActualPage()); -} - -/** - * Process keyboard input - * @returns sal_True if a KeyEvent is being processed, sal_False otherwise - */ -bool FuOutlineText::KeyInput(const KeyEvent& rKEvt) -{ - sal_uInt16 nKeyGroup = rKEvt.GetKeyCode().GetGroup(); - if( !mpDocSh->IsReadOnly() || nKeyGroup == KEYGROUP_CURSOR ) - { - std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; - if( (nKeyGroup != KEYGROUP_CURSOR) && (nKeyGroup != KEYGROUP_FKEYS) ) - aGuard.reset( new OutlineViewModelChangeGuard( *static_cast<OutlineView*>(mpSimpleOutlinerView) ) ); - - return FuSimpleOutlinerText::KeyInput(rKEvt); - } - - return false; -} - -rtl::Reference<FuPoor> FuOutlineText::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, SfxRequest& rReq ) -{ - rtl::Reference<FuPoor> xFunc( new FuOutlineText( pViewSh, pWin, pView, pDoc, rReq ) ); - xFunc->DoExecute( rReq ); - return xFunc; -} FuOutlineText::FuOutlineText(ViewShell* pViewShell, ::sd::Window* pWindow, - ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, - SfxRequest& rReq) - : FuSimpleOutlinerText(pViewShell, pWindow, pView, pDoc, rReq) -{} - -FuSimpleOutlinerText::FuSimpleOutlinerText(ViewShell* pViewShell, ::sd::Window* pWindow, - ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, + ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq) : FuPoor(pViewShell, pWindow, pView, pDoc, rReq), - pOutlineViewShell (pViewShell), - mpSimpleOutlinerView (pView) + pOutlineViewShell (static_cast<OutlineViewShell*>(pViewShell)), + pOutlineView (static_cast<OutlineView*>(pView)) { } /** * forward to OutlinerView */ -bool FuSimpleOutlinerText::Command(const CommandEvent& rCEvt) +bool FuOutlineText::Command(const CommandEvent& rCEvt) { bool bResult = false; - OutlinerView* pOlView = mpSimpleOutlinerView->GetViewByWindow(mpWindow); - + OutlinerView* pOlView = + static_cast<OutlineView*>(mpView)->GetViewByWindow(mpWindow); DBG_ASSERT (pOlView, "no OutlineView found"); if (pOlView) @@ -172,18 +112,18 @@ bool FuSimpleOutlinerText::Command(const CommandEvent& rCEvt) } -rtl::Reference<FuPoor> FuSimpleOutlinerText::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, SfxRequest& rReq ) +rtl::Reference<FuPoor> FuOutlineText::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq ) { - rtl::Reference<FuPoor> xFunc( new FuSimpleOutlinerText( pViewSh, pWin, pView, pDoc, rReq ) ); + rtl::Reference<FuPoor> xFunc( new FuOutlineText( pViewSh, pWin, pView, pDoc, rReq ) ); xFunc->DoExecute( rReq ); return xFunc; } -bool FuSimpleOutlinerText::MouseButtonDown(const MouseEvent& rMEvt) +bool FuOutlineText::MouseButtonDown(const MouseEvent& rMEvt) { mpWindow->GrabFocus(); - bool bReturn = mpSimpleOutlinerView->GetViewByWindow(mpWindow)->MouseButtonDown(rMEvt); + bool bReturn = pOutlineView->GetViewByWindow(mpWindow)->MouseButtonDown(rMEvt); if (bReturn) { @@ -198,9 +138,9 @@ bool FuSimpleOutlinerText::MouseButtonDown(const MouseEvent& rMEvt) return bReturn; } -bool FuSimpleOutlinerText::MouseMove(const MouseEvent& rMEvt) +bool FuOutlineText::MouseMove(const MouseEvent& rMEvt) { - bool bReturn = mpSimpleOutlinerView->GetViewByWindow(mpWindow)->MouseMove(rMEvt); + bool bReturn = pOutlineView->GetViewByWindow(mpWindow)->MouseMove(rMEvt); if (!bReturn) { @@ -210,9 +150,9 @@ bool FuSimpleOutlinerText::MouseMove(const MouseEvent& rMEvt) return bReturn; } -bool FuSimpleOutlinerText::MouseButtonUp(const MouseEvent& rMEvt) +bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt) { - bool bReturn = mpSimpleOutlinerView->GetViewByWindow(mpWindow)->MouseButtonUp(rMEvt); + bool bReturn = pOutlineView->GetViewByWindow(mpWindow)->MouseButtonUp(rMEvt); if (bReturn) { @@ -221,7 +161,7 @@ bool FuSimpleOutlinerText::MouseButtonUp(const MouseEvent& rMEvt) } else { - const SvxFieldItem* pFieldItem = mpSimpleOutlinerView->GetViewByWindow( mpWindow )->GetFieldUnderMousePointer(); + const SvxFieldItem* pFieldItem = pOutlineView->GetViewByWindow( mpWindow )->GetFieldUnderMousePointer(); if( pFieldItem ) { const SvxFieldData* pField = pFieldItem->GetField(); @@ -264,7 +204,7 @@ bool FuSimpleOutlinerText::MouseButtonUp(const MouseEvent& rMEvt) * Process keyboard input * @returns sal_True if a KeyEvent is being processed, sal_False otherwise */ -bool FuSimpleOutlinerText::KeyInput(const KeyEvent& rKEvt) +bool FuOutlineText::KeyInput(const KeyEvent& rKEvt) { bool bReturn = false; @@ -273,7 +213,11 @@ bool FuSimpleOutlinerText::KeyInput(const KeyEvent& rKEvt) { mpWindow->GrabFocus(); - bReturn = mpSimpleOutlinerView->GetViewByWindow(mpWindow)->PostKeyEvent(rKEvt); + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; + if( (nKeyGroup != KEYGROUP_CURSOR) && (nKeyGroup != KEYGROUP_FKEYS) ) + aGuard.reset( new OutlineViewModelChangeGuard( *pOutlineView ) ); + + bReturn = pOutlineView->GetViewByWindow(mpWindow)->PostKeyEvent(rKEvt); if (bReturn) { @@ -288,49 +232,74 @@ bool FuSimpleOutlinerText::KeyInput(const KeyEvent& rKEvt) return bReturn; } -void FuSimpleOutlinerText::UpdateForKeyPress (const KeyEvent& /*rEvent*/) +void FuOutlineText::UpdateForKeyPress (const KeyEvent& rEvent) { // Attributes at the current text position may have changed. mpViewShell->GetViewFrame()->GetBindings().Invalidate(SidArray); + + bool bUpdatePreview = true; + switch (rEvent.GetKeyCode().GetCode()) + { + // When just the cursor has been moved the preview only changes when + // it moved to entries of another page. To prevent unnecessary + // updates we check this here. This is an early rejection test, so + // missing a key is not a problem. + case KEY_UP: + case KEY_DOWN: + case KEY_LEFT: + case KEY_RIGHT: + case KEY_HOME: + case KEY_END: + case KEY_PAGEUP: + case KEY_PAGEDOWN: + { + SdPage* pCurrentPage = pOutlineViewShell->GetActualPage(); + bUpdatePreview = (pCurrentPage != pOutlineViewShell->GetActualPage()); + } + break; + } + if (bUpdatePreview) + pOutlineViewShell->UpdatePreview (pOutlineViewShell->GetActualPage()); } /** * Cut object to clipboard */ -void FuSimpleOutlinerText::DoCut() +void FuOutlineText::DoCut() { - mpSimpleOutlinerView->GetViewByWindow(mpWindow)->Cut(); + pOutlineView->GetViewByWindow(mpWindow)->Cut(); } /** * Copy object to clipboard */ -void FuSimpleOutlinerText::DoCopy() +void FuOutlineText::DoCopy() { - mpSimpleOutlinerView->GetViewByWindow(mpWindow)->Copy(); + pOutlineView->GetViewByWindow(mpWindow)->Copy(); } /** * Paste object from clipboard */ -void FuSimpleOutlinerText::DoPaste() +void FuOutlineText::DoPaste() { - mpSimpleOutlinerView->GetViewByWindow(mpWindow)->PasteSpecial(); + pOutlineView->GetViewByWindow(mpWindow)->PasteSpecial(); } /** * Paste object as unformatted text from clipboard */ -void FuSimpleOutlinerText::DoPasteUnformatted() +void FuOutlineText::DoPasteUnformatted() { TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mpViewShell->GetActiveWindow() ) ); if (aDataHelper.GetTransferable().is()) { OUString aText; if (aDataHelper.GetString(SotClipboardFormatId::STRING, aText)) - mpSimpleOutlinerView->GetViewByWindow(mpWindow)->InsertText(aText); + pOutlineView->GetViewByWindow(mpWindow)->InsertText(aText); } } } // end of namespace sd + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/NotesPanelView.hxx b/sd/source/ui/inc/NotesPanelView.hxx deleted file mode 100644 index 810cddd6af71..000000000000 --- a/sd/source/ui/inc/NotesPanelView.hxx +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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/. - */ - -#pragma once - -#include "OutlineView.hxx" -#include <Outliner.hxx> - -class SdrTextObj; - -namespace sd::tools -{ -class EventMultiplexerEvent; -} - -namespace sd -{ -class DrawDocShell; -class NotesPanelViewShell; - -/** - * Derivative of ::sd::SimpleOutlinerView for the notes panel -|* -\************************************************************************/ - -class NotesPanelView final : public ::sd::SimpleOutlinerView -{ - NotesPanelViewShell& mrNotesPanelViewShell; - SdOutliner maOutliner; - OutlinerView maOutlinerView; - - Idle aModifyIdle; - - SdrTextObj* mpTextObj = nullptr; - bool mbIgnoreNotifications = false; - - /** stores the last used document color. - this is changed in onUpdateStyleSettings() - */ - Color maDocColor = COL_WHITE; - - void removeListener(); - void addListener(); - - void setListenerIgnored(bool bIgnore); - bool isListenerIgnored(); - - void getNotesFromDoc(); - void setNotesToDoc(); - -public: - NotesPanelView(DrawDocShell& rDocSh, vcl::Window* pWindow, - NotesPanelViewShell& rNotesPanelViewSh); - virtual ~NotesPanelView() override; - - void Paint(const ::tools::Rectangle& rRect, ::sd::Window const* pWin); - void onResize(); - - OutlinerView* GetOutlinerView(); - OutlinerView* GetViewByWindow(vcl::Window const* pWin) const override; - - SdOutliner& GetOutliner() { return maOutliner; } - - void FillOutliner(); - void onUpdateStyleSettings(bool bForceUpdate); - virtual SvtScriptType GetScriptType() const override; - - void SetLinks(); - void ResetLinks(); - virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; - - virtual void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr = false) const override; - virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false, - bool bSlide = false, bool bMaster = false) override; - - // SdrObjEditView's Outliner access overrides to use TextObjectBar implementations. - virtual const SdrOutliner* GetTextEditOutliner() const override { return &maOutliner; } - virtual SdrOutliner* GetTextEditOutliner() override { return &maOutliner; } - virtual const OutlinerView* GetTextEditOutlinerView() const override { return &maOutlinerView; } - virtual OutlinerView* GetTextEditOutlinerView() override { return &maOutlinerView; } - - virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, - SdrLayerID nLayer) override; - virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt, ::sd::Window* pTargetWindow, - sal_uInt16 nPage, SdrLayerID nLayer) override; - - DECL_LINK(StatusEventHdl, EditStatus&, void); - DECL_LINK(EditModifiedHdl, LinkParamNone*, void); - DECL_LINK(ModifyTimerHdl, Timer*, void); - DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); -}; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sd/source/ui/inc/NotesPanelViewShell.hxx b/sd/source/ui/inc/NotesPanelViewShell.hxx deleted file mode 100644 index e79ac899fe30..000000000000 --- a/sd/source/ui/inc/NotesPanelViewShell.hxx +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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/. - */ - -#pragma once - -#include "ViewShell.hxx" -#include <glob.hxx> - -class SdPage; - -namespace sd -{ -class NotesPanelView; - -class NotesPanelViewShell final : public ViewShell -{ -public: - SFX_DECL_VIEWFACTORY(NotesPanelViewShell); - SFX_DECL_INTERFACE(SD_IF_SDNOTESPANELVIEWSHELL) - -private: - /// SfxInterface initializer. - static void InitInterface_Impl(); - -public: - /** Create a new view shell for the notes panel. - @param rViewShellBase - The new object will be stacked on this view shell base. - @param pFrameView - The frame view that makes it possible to pass information from - one view shell to the next. - */ - NotesPanelViewShell(SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, - vcl::Window* pParentWindow, FrameView* pFrameView); - - virtual ~NotesPanelViewShell() override; - - virtual void Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin) override; - virtual bool PrepareClose(bool bUI = true) override; - virtual void UpdateScrollBars() override; - virtual void VirtHScrollHdl(ScrollAdaptor* pHScroll) override; - virtual void VirtVScrollHdl(ScrollAdaptor* pVScroll) override; - virtual void Activate(bool IsMDIActivate) override; - /** this method is called when the visible area of the view from this viewshell is changed */ - virtual void VisAreaChanged(const ::tools::Rectangle& rRect) override; - - virtual void ArrangeGUIElements() override; - virtual SdPage* GetActualPage() override; - virtual SdPage* getCurrentPage() const override; - virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController() override; - - void ExecCtrl(SfxRequest& rReq); - void GetCtrlState(SfxItemSet& rSet); - void GetAttrState(SfxItemSet& rSet); - void GetState(SfxItemSet& rSet); - void GetCharState(SfxItemSet& rSet); - - static void ExecStatusBar(SfxRequest& rReq); - void GetStatusBarState(SfxItemSet& rSet); - - void FuTemporary(SfxRequest& rReq); - void FuTemporaryModify(SfxRequest& rReq); - void FuPermanent(SfxRequest& rReq); - void FuSupport(SfxRequest& rReq); - void Execute(SfxRequest& rReq); - void ExecChar(SfxRequest& rReq); - - virtual void Command(const CommandEvent& rCEvt, ::sd::Window* pWin) override; - virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) override; - virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) override; - - virtual void SetZoom(::tools::Long nZoom) override; - virtual void SetZoomRect(const ::tools::Rectangle& rZoomRect) override; - - virtual void ReadFrameViewData(FrameView* pView) override; - virtual void WriteFrameViewData() override; - virtual css::uno::Reference<css::accessibility::XAccessible> - CreateAccessibleDocumentView(::sd::Window* /*pWindow*/) override - { - // TODO - return {}; - } - -private: - std::unique_ptr<NotesPanelView> mpNotesPanelView; - bool mbInitialized = false; - - /** Initiates the shell with it's NotesPanelView instance - */ - void Construct(); -}; - -} // end of namespace sd - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index 8ce1d23be308..06561a6e051e 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -46,24 +46,12 @@ class OutlineViewModelChangeGuard; const int MAX_OUTLINERVIEWS = 4; /** - * Common base for OutlineView and NotesPanelView that only have a single Outliner in the view. -|* -\************************************************************************/ -class SimpleOutlinerView : public ::sd::View -{ -public: - SimpleOutlinerView(SdDrawDocument& rDrawDoc, OutputDevice* pOutDev, ViewShell* pViewSh) - : View(rDrawDoc, pOutDev, pViewSh) {} - virtual OutlinerView* GetViewByWindow(vcl::Window const* pWin) const = 0; -}; - -/** - * Derivative of ::sd::SimpleOutlinerView for the outline mode + * Derivative of ::sd::View for the outline mode |* \************************************************************************/ class OutlineView final - : public SimpleOutlinerView + : public ::sd::View { friend class OutlineViewModelChangeGuard; public: @@ -90,7 +78,7 @@ public: virtual void AddDeviceToPaintView(OutputDevice& rDev, vcl::Window* pWindow) override; virtual void DeleteDeviceFromPaintView(OutputDevice& rDev) override; - OutlinerView* GetViewByWindow(vcl::Window const * pWin) const override; + OutlinerView* GetViewByWindow(vcl::Window const * pWin) const; SdrOutliner& GetOutliner() { return mrOutliner; } Paragraph* GetPrevTitle(const Paragraph* pPara); diff --git a/sd/source/ui/inc/PaneChildWindows.hxx b/sd/source/ui/inc/PaneChildWindows.hxx index 68989f3c01ce..f96ede468bac 100644 --- a/sd/source/ui/inc/PaneChildWindows.hxx +++ b/sd/source/ui/inc/PaneChildWindows.hxx @@ -34,8 +34,7 @@ public: sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo, - TranslateId pTitleBarResId, - SfxChildAlignment eAlignment); + TranslateId pTitleBarResId); virtual ~PaneChildWindow() override; }; @@ -50,16 +49,6 @@ public: SFX_DECL_CHILDWINDOW_WITHID(LeftPaneImpressChildWindow); }; -/// The notes panel (on the bottom) in Impress. -class BottomPaneImpressChildWindow final : public PaneChildWindow -{ -public: - BottomPaneImpressChildWindow(vcl::Window* pParentWindow, sal_uInt16 nId, SfxBindings* pBindings, - SfxChildWinInfo* pInfo); - - SFX_DECL_CHILDWINDOW_WITHID(BottomPaneImpressChildWindow); -}; - /// The pages sidebar (on the left) in Draw. class LeftPaneDrawChildWindow final : public PaneChildWindow diff --git a/sd/source/ui/inc/PaneShells.hxx b/sd/source/ui/inc/PaneShells.hxx index e15ce2dd3d41..73f24909c2fd 100644 --- a/sd/source/ui/inc/PaneShells.hxx +++ b/sd/source/ui/inc/PaneShells.hxx @@ -41,23 +41,6 @@ public: virtual ~LeftImpressPaneShell() override; }; -/** Shell that displays the bottom pane for Impress. The shell does not do - anything else and has especially no slots. -*/ -class BottomImpressPaneShell final : public SfxShell -{ -public: - SFX_DECL_INTERFACE(SD_IF_SDBOTTOMIMPRESSPANESHELL) - -private: - /// SfxInterface initializer. - static void InitInterface_Impl(); - -public: - BottomImpressPaneShell(); - virtual ~BottomImpressPaneShell() override; -}; - /** Shell that displays the left pane for Draw. The shell does not do anything else and has especially no slots. */ diff --git a/sd/source/ui/inc/TextObjectBar.hxx b/sd/source/ui/inc/TextObjectBar.hxx index aaa008f04f93..61394834fbc2 100644 --- a/sd/source/ui/inc/TextObjectBar.hxx +++ b/sd/source/ui/inc/TextObjectBar.hxx @@ -45,11 +45,8 @@ public: virtual ~TextObjectBar() override; void GetAttrState( SfxItemSet& rSet ); - static void GetAttrStateImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxItemSet& rSet, SfxShell* pTextObjectBar); void GetCharState( SfxItemSet& rSet ); - static void GetCharStateImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxItemSet& rSet); void Execute( SfxRequest &rReq ); - static void ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxRequest& rReq, SfxShell* pTextObjectBar); private: ViewShell* mpViewShell; diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 85bc43e86c09..89332537e94c 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -100,8 +100,7 @@ public: ST_OUTLINE, ST_SLIDE_SORTER, ST_PRESENTATION, - ST_SIDEBAR, - ST_NOTESPANEL + ST_SIDEBAR }; static const int MAX_HSPLIT_CNT = 1; static const int MAX_VSPLIT_CNT = 1; diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx index 5787ff535f39..927b206b9edf 100644 --- a/sd/source/ui/inc/framework/FrameworkHelper.hxx +++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx @@ -60,7 +60,6 @@ public: static const OUString msCenterPaneURL; static const OUString msFullScreenPaneURL; static const OUString msLeftImpressPaneURL; - static const OUString msBottomImpressPaneURL; static const OUString msLeftDrawPaneURL; // URLs of frequently used views. @@ -73,7 +72,6 @@ public: static const OUString msSlideSorterURL; static const OUString msPresentationViewURL; static const OUString msSidebarViewURL; - static const OUString msNotesPanelViewURL; // URLs of frequently used tool bars. static constexpr OUStringLiteral msToolBarURLPrefix = u"private:resource/toolbar/"; diff --git a/sd/source/ui/inc/fuoltext.hxx b/sd/source/ui/inc/fuoltext.hxx index ddbada52734b..288bcf190cb4 100644 --- a/sd/source/ui/inc/fuoltext.hxx +++ b/sd/source/ui/inc/fuoltext.hxx @@ -24,19 +24,22 @@ class SdDrawDocument; class SfxRequest; -namespace sd -{ +namespace sd { -class SimpleOutlinerView; +class View; +class ViewShell; +class OutlineView; +class OutlineViewShell; /** - * Functions class for shells that host only an Outliner e.g. NotesPanel - * + * text functions in outline mode */ -class FuSimpleOutlinerText : public FuPoor +class FuOutlineText final + : public FuPoor { public: - static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, SfxRequest& rReq ); + + static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq ); virtual bool Command(const CommandEvent& rCEvt) override; @@ -50,42 +53,22 @@ public: virtual void DoPaste() override; virtual void DoPasteUnformatted() override; - /** Call this method when the text in the outliner (may) have changed. - It will invalidate some slots of the view frame. - */ - virtual void UpdateForKeyPress (const KeyEvent& rEvent); - -protected: - FuSimpleOutlinerText( - ViewShell* pViewShell, - ::sd::Window* pWin, - ::sd::SimpleOutlinerView* pView, - SdDrawDocument* pDoc, - SfxRequest& rReq); - - ViewShell* pOutlineViewShell; - SimpleOutlinerView* mpSimpleOutlinerView; -}; - -class FuOutlineText final : public FuSimpleOutlinerText -{ -public: - static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, SfxRequest& rReq ); - - virtual bool KeyInput(const KeyEvent& rKEvt) override; - /** Call this method when the text in the outliner (may) have changed. + /** Call this method when the text in the outliner (may) has changed. It will invalidate some slots of the view frame and update the preview in the slide sorter. */ - virtual void UpdateForKeyPress(const KeyEvent& rEvent) override; + void UpdateForKeyPress (const KeyEvent& rEvent); private: - FuOutlineText( + FuOutlineText ( ViewShell* pViewShell, ::sd::Window* pWin, - ::sd::SimpleOutlinerView* pView, + ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq); + + OutlineViewShell* pOutlineViewShell; + OutlineView* pOutlineView; }; } // end of namespace sd diff --git a/sd/source/ui/view/NotesPanelView.cxx b/sd/source/ui/view/NotesPanelView.cxx deleted file mode 100644 index 2822a8df4c02..000000000000 --- a/sd/source/ui/view/NotesPanelView.cxx +++ /dev/null @@ -1,320 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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 <NotesPanelViewShell.hxx> -#include <NotesPanelView.hxx> -#include <OutlineView.hxx> -#include <ViewShellBase.hxx> -#include <editeng/editeng.hxx> -#include <editeng/outliner.hxx> -#include <sdresid.hxx> -#include <editeng/editund2.hxx> -#include <sdpage.hxx> -#include <DrawViewShell.hxx> -#include <DrawDocShell.hxx> -#include <Window.hxx> -#include <drawdoc.hxx> -#include <sdmod.hxx> -#include <officecfg/Office/Common.hxx> -#include <EventMultiplexer.hxx> -#include <app.hrc> -#include <strings.hrc> - -namespace sd -{ -NotesPanelView::NotesPanelView(DrawDocShell& rDocSh, vcl::Window* pWindow, - NotesPanelViewShell& rNotesPanelViewShell) - : ::sd::SimpleOutlinerView(*rDocSh.GetDoc(), pWindow->GetOutDev(), &rNotesPanelViewShell) - , mrNotesPanelViewShell(rNotesPanelViewShell) - , maOutliner(&mrDoc, OutlinerMode::TextObject) - , maOutlinerView(&maOutliner, pWindow) - , aModifyIdle("NotesEditWindow ModifyIdle") -{ - aModifyIdle.SetInvokeHandler(LINK(this, NotesPanelView, ModifyTimerHdl)); - aModifyIdle.SetPriority(TaskPriority::LOWEST); - - maOutliner.Init(OutlinerMode::OutlineView); - maOutliner.SetRefDevice(SD_MOD()->GetVirtualRefDevice()); - maOutliner.SetPaperSize(mrNotesPanelViewShell.GetActiveWindow()->GetViewSize()); - - maOutlinerView.SetOutputArea( - ::tools::Rectangle{ Point(0, 0), mrNotesPanelViewShell.GetActiveWindow()->GetViewSize() }); - maOutliner.InsertView(&maOutlinerView, EE_APPEND); - - onUpdateStyleSettings(true); - - // fill Outliner with contents - FillOutliner(); - - mrNotesPanelViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener( - LINK(this, NotesPanelView, EventMultiplexerListener)); - - // TODO: UNDO - // sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager()); - // if (pDocUndoMgr != nullptr) - // pDocUndoMgr->SetLinkedUndoManager(&maOutliner.GetUndoManager()); -} - -NotesPanelView::~NotesPanelView() -{ - mrNotesPanelViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( - LINK(this, NotesPanelView, EventMultiplexerListener)); - - ResetLinks(); - // DisconnectFromApplication(); - // mpProgress.reset(); -} - -void NotesPanelView::FillOutliner() -{ - maOutliner.GetUndoManager().Clear(); - maOutliner.EnableUndo(false); - ResetLinks(); - removeListener(); - mpTextObj = nullptr; - maOutliner.Clear(); - - SdPage* pNotesPage = mrNotesPanelViewShell.getCurrentPage(); - if (!pNotesPage) - return; - - SdrObject* pNotesObj = pNotesPage->GetPresObj(PresObjKind::Notes); - if (!pNotesObj) - return; - - mpTextObj = dynamic_cast<SdrTextObj*>(pNotesObj); - addListener(); - getNotesFromDoc(); - SetLinks(); - maOutliner.EnableUndo(true); -} - -void NotesPanelView::SetLinks() -{ - maOutliner.SetStatusEventHdl(LINK(this, NotesPanelView, StatusEventHdl)); -} - -void NotesPanelView::ResetLinks() { maOutliner.SetStatusEventHdl(Link<EditStatus&, void>()); } - -void NotesPanelView::removeListener() -{ - if (mpTextObj) - mpTextObj->RemoveListener(*this); -} -void NotesPanelView::addListener() -{ - if (mpTextObj) - mpTextObj->AddListener(*this); -} - -void NotesPanelView::setListenerIgnored(bool bIgnore) { mbIgnoreNotifications = bIgnore; } -bool NotesPanelView::isListenerIgnored() { return mbIgnoreNotifications; } - -void NotesPanelView::getNotesFromDoc() -{ - if (!mpTextObj) - return; - - // Ignore notifications that will rebound from updating the text - maOutliner.SetModifyHdl(Link<LinkParamNone*, void>()); - setListenerIgnored(true); - - if (OutlinerParaObject* pPara = mpTextObj->GetOutlinerParaObject()) - maOutliner.SetText(*pPara); - - setListenerIgnored(false); - maOutliner.SetModifyHdl(LINK(this, NotesPanelView, EditModifiedHdl)); -} - -void NotesPanelView::setNotesToDoc() -{ - if (!mpTextObj) - return; - - setListenerIgnored(true); - - std::optional<OutlinerParaObject> pNewText = maOutliner.CreateParaObject(); - mpTextObj->SetOutlinerParaObject(std::move(pNewText)); - if (mpTextObj->IsEmptyPresObj()) - mpTextObj->SetEmptyPresObj(false); - - setListenerIgnored(false); -} - -void NotesPanelView::Paint(const ::tools::Rectangle& rRect, ::sd::Window const* /*pWin*/) -{ - maOutlinerView.Paint(rRect); -} - -void NotesPanelView::Notify(SfxBroadcaster&, const SfxHint& rHint) -{ - if (isListenerIgnored()) - return; - - if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint) - { - const SdrHint& rSdrHint = reinterpret_cast<const SdrHint&>(rHint); - switch (rSdrHint.GetKind()) - { - case SdrHintKind::ObjectRemoved: - case SdrHintKind::ModelCleared: - FillOutliner(); - break; - case SdrHintKind::ObjectChange: - case SdrHintKind::EndEdit: - FillOutliner(); - break; - default: - break; - } - } -} - -OutlinerView* NotesPanelView::GetOutlinerView() { return &maOutlinerView; } - -void NotesPanelView::onUpdateStyleSettings(bool bForceUpdate /* = false */) -{ - svtools::ColorConfig aColorConfig; - const Color aDocColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); - if (!(bForceUpdate || (maDocColor != aDocColor))) - return; - - maOutlinerView.SetBackgroundColor(aDocColor); - if (vcl::Window* pWindow = maOutlinerView.GetWindow()) - pWindow->SetBackground(Wallpaper(aDocColor)); - - maOutliner.SetBackgroundColor(aDocColor); - maDocColor = aDocColor; -} - -void NotesPanelView::onResize() -{ - ::sd::Window* pWin = mrNotesPanelViewShell.GetActiveWindow(); - OutlinerView* pOutlinerView = GetOutlinerView(); - - Size aOutputSize = pWin->PixelToLogic(pWin->GetOutputSizePixel()); - - pOutlinerView->SetOutputArea({ Point(0, 0), aOutputSize }); - maOutliner.SetPaperSize(aOutputSize); - pOutlinerView->ShowCursor(); - - const ::tools::Long nMaxVisAreaStart = maOutliner.GetTextHeight() - aOutputSize.Height(); - - ::tools::Rectangle aVisArea(pOutlinerView->GetVisArea()); - - if (aVisArea.Top() > nMaxVisAreaStart) - { - aVisArea.SetTop(std::max<::tools::Long>(nMaxVisAreaStart, 0)); - aVisArea.SetSize(aOutputSize); - pOutlinerView->SetVisArea(aVisArea); - pOutlinerView->ShowCursor(); - } - - if (!aVisArea.IsEmpty()) // not when opening - { - mrNotesPanelViewShell.InitWindows(Point(0, 0), aVisArea.GetSize(), aVisArea.TopLeft(), - true); - mrNotesPanelViewShell.UpdateScrollBars(); - } -} - -/** - * Handler for StatusEvents - */ -IMPL_LINK_NOARG(NotesPanelView, StatusEventHdl, EditStatus&, void) { onResize(); } - -IMPL_LINK_NOARG(NotesPanelView, EditModifiedHdl, LinkParamNone*, void) -{ - // EditEngine calls ModifyHdl many times in succession for some edits. - // (e.g. when deleting multiple lines) - // Debounce the rapid ModifyHdl calls using a timer. - aModifyIdle.Start(); - return; -} - -IMPL_LINK_NOARG(NotesPanelView, ModifyTimerHdl, Timer*, void) -{ - setNotesToDoc(); - aModifyIdle.Stop(); -} - -IMPL_LINK(NotesPanelView, EventMultiplexerListener, tools::EventMultiplexerEvent&, rEvent, void) -{ - switch (rEvent.meEventId) - { - case EventMultiplexerEventId::CurrentPageChanged: - case EventMultiplexerEventId::MainViewRemoved: - case EventMultiplexerEventId::MainViewAdded: - FillOutliner(); - break; - default: - break; - } -} - -OutlinerView* NotesPanelView::GetViewByWindow(vcl::Window const* /*pWin*/) const -{ - return const_cast<NotesPanelView*>(this)->GetOutlinerView(); -} - -/** - * Set attributes of the selected text - */ -bool NotesPanelView::SetAttributes(const SfxItemSet& rSet, bool /*bSlide*/, bool /*bReplaceAll*/, - bool /*bMaster*/) -{ - bool bOk = false; - - OutlinerView* pOlView = GetOutlinerView(); - - if (pOlView) - { - pOlView->SetAttribs(rSet); - bOk = true; - } - - mrNotesPanelViewShell.Invalidate(SID_PREVIEW_STATE); - - return bOk; -} - -/** - * Get attributes of the selected text - */ -void NotesPanelView::GetAttributes(SfxItemSet& rTargetSet, bool) const -{ - rTargetSet.Put(const_cast<OutlinerView&>(maOutlinerView).GetAttribs(), false); -} - -SvtScriptType NotesPanelView::GetScriptType() const -{ - SvtScriptType nScriptType = ::sd::View::GetScriptType(); - - std::optional<OutlinerParaObject> pTempOPObj = maOutliner.CreateParaObject(); - if (pTempOPObj) - { - nScriptType = pTempOPObj->GetTextObject().GetScriptType(); - } - - return nScriptType; -} - -sal_Int8 NotesPanelView::AcceptDrop(const AcceptDropEvent&, DropTargetHelper&, SdrLayerID) -{ - return DND_ACTION_NONE; -} - -sal_Int8 NotesPanelView::ExecuteDrop(const ExecuteDropEvent&, ::sd::Window*, sal_uInt16, SdrLayerID) -{ - return DND_ACTION_NONE; -} - -} // end of namespace sd - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx deleted file mode 100644 index a8902f1eacf4..000000000000 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ /dev/null @@ -1,1448 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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 <NotesPanelViewShell.hxx> -#include <NotesPanelView.hxx> -#include <sal/log.hxx> - -#include <DrawController.hxx> -#include <DrawDocShell.hxx> -#include <DrawViewShell.hxx> -#include <FrameView.hxx> -#include <SpellDialogChildWindow.hxx> -#include <ViewShellBase.hxx> -#include <Window.hxx> -#include <app.hrc> -#include <com/sun/star/linguistic2/XThesaurus.hpp> -#include <drawdoc.hxx> -#include <editeng/editobj.hxx> -#include <editeng/editstat.hxx> -#include <editeng/editund2.hxx> -#include <editeng/eeitem.hxx> -#include <editeng/flditem.hxx> -#include <editeng/outlobj.hxx> -#include <editeng/unolingu.hxx> -#include <framework/FrameworkHelper.hxx> -#include <fubullet.hxx> -#include <fuchar.hxx> -#include <fucushow.hxx> -#include <fuexpand.hxx> -#include <fuinsfil.hxx> -#include <fuolbull.hxx> -#include <fuoltext.hxx> -#include <fuprobjs.hxx> -#include <fuscale.hxx> -#include <fusldlg.hxx> -#include <fusumry.hxx> -#include <futempl.hxx> -#include <futhes.hxx> -#include <memory> -#include <sdabstdlg.hxx> -#include <sdpage.hxx> -#include <sdresid.hxx> -#include <sfx2/bindings.hxx> -#include <sfx2/devtools/DevelopmentToolChildWindow.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/infobar.hxx> -#include <sfx2/objface.hxx> -#include <sfx2/request.hxx> -#include <sfx2/sidebar/SidebarChildWindow.hxx> -#include <sfx2/tplpitem.hxx> -#include <sfx2/viewfrm.hxx> -#include <sfx2/zoomitem.hxx> -#include <slideshow.hxx> -#include <sot/formats.hxx> -#include <stlsheet.hxx> -#include <strings.hrc> -#include <svl/cjkoptions.hxx> -#include <svl/srchitem.hxx> -#include <svl/stritem.hxx> -#include <svl/whiter.hxx> -#include <svtools/cliplistener.hxx> -#include <svx/hlnkitem.hxx> -#include <svx/hyperdlg.hxx> -#include <svx/svdoutl.hxx> -#include <svx/svxids.hrc> -#include <svx/zoomslideritem.hxx> -#include <unotools/useroptions.hxx> -#include <vcl/EnumContext.hxx> -#include <vcl/commandevent.hxx> -#include <zoomlist.hxx> - -#include <TextObjectBar.hxx> - -#include <memory> - -#define ShellClass_NotesPanelViewShell -using namespace sd; -#include <sdslots.hxx> - -namespace sd -{ -#define MIN_ZOOM 10 // minimum zoom factor -#define MAX_ZOOM 1000 // maximum zoom factor - -/** - * Declare SFX-Slotmap and standard interface - */ -SFX_IMPL_INTERFACE(NotesPanelViewShell, SfxShell) - -void NotesPanelViewShell::InitInterface_Impl() -{ - GetStaticInterface()->RegisterPopupMenu("drawtext"); - - GetStaticInterface()->RegisterChildWindow(SvxHlinkDlgWrapper::GetChildWindowId()); - GetStaticInterface()->RegisterChildWindow(::sd::SpellDialogChildWindow::GetChildWindowId()); - GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG); - GetStaticInterface()->RegisterChildWindow( - sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); - GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId()); -} - -/** - * Default constructor, windows must not center themselves automatically - */ -NotesPanelViewShell::NotesPanelViewShell(SfxViewFrame* /*pFrame*/, ViewShellBase& rViewShellBase, - vcl::Window* pParentWindow, FrameView* pFrameViewArgument) - : ViewShell(pParentWindow, rViewShellBase) -{ - if (pFrameViewArgument != nullptr) - mpFrameView = pFrameViewArgument; - else - mpFrameView = new FrameView(GetDoc()); - - mpFrameView->Connect(); - - Construct(); - - SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::DrawText)); - - doShow(); - mpHorizontalScrollBar->Hide(); -} - -NotesPanelViewShell::~NotesPanelViewShell() -{ - DisposeFunctions(); - mpFrameView->Disconnect(); - // if ( mxClipEvtLstnr.is() ) - // { - // mxClipEvtLstnr->RemoveListener( GetActiveWindow() ); - // mxClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting - // } -} - -void NotesPanelViewShell::Construct() -{ - meShellType = ST_NOTESPANEL; - - Size aSize(29700, 21000); - Point aWinPos(0, 0); - Point aViewOrigin(0, 0); - GetActiveWindow()->SetMinZoomAutoCalc(false); - GetActiveWindow()->SetMinZoom(MIN_ZOOM); - GetActiveWindow()->SetMaxZoom(MAX_ZOOM); - InitWindows(aViewOrigin, aSize, aWinPos); - - mpNotesPanelView = std::make_unique<NotesPanelView>(*GetDocSh(), GetActiveWindow(), *this); - mpView = mpNotesPanelView.get(); - - SetPool(&GetDoc()->GetPool()); - SetZoom(70); - - // Apply settings of FrameView - ReadFrameViewData(mpFrameView); - - SetName("NotesPanelViewShell"); - // TODO: Help ID - // GetActiveWindow()->SetHelpId(HID_SDNOTESPANEL); -} - -void NotesPanelViewShell::Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin) -{ - if (mpNotesPanelView) - mpNotesPanelView->Paint(rRect, pWin); -} - -bool NotesPanelViewShell::PrepareClose(bool bUI) -{ - if (!ViewShell::PrepareClose(bUI)) - return false; - - return true; -} - -void NotesPanelViewShell::VirtHScrollHdl(ScrollAdaptor* /*pHScroll*/) -{ - // no horizontal scroll - return; -} - -void NotesPanelViewShell::UpdateScrollBars() -{ - if (!mpVerticalScrollBar) - return; - - OutlinerView* pOutlinerView = mpNotesPanelView->GetOutlinerView(); - const SdOutliner& rOutliner = mpNotesPanelView->GetOutliner(); - - int nVUpper = rOutliner.GetTextHeight(); - int nVCurrentDocPos = pOutlinerView->GetVisArea().Top(); - const Size aOut(pOutlinerView->GetOutputArea().GetSize()); - int nVStepIncrement = aOut.Height() * 2 / 10; - int nVPageIncrement = aOut.Height() * 8 / 10; - int nVPageSize = aOut.Height(); - - nVPageSize = std::min(nVPageSize, nVUpper); - - mpVerticalScrollBar->SetRange({ 0, nVUpper }); - mpVerticalScrollBar->SetVisibleSize(nVPageSize); - mpVerticalScrollBar->SetThumbPos(nVCurrentDocPos); - mpVerticalScrollBar->SetLineSize(nVStepIncrement); - mpVerticalScrollBar->SetPageSize(nVPageIncrement); - - // TODO: This is a workaround for the view going blank when overflow the current view with text. - // The extra faulty draw call still happens.. Should get rid of that before removing this. - VirtVScrollHdl(mpVerticalScrollBar); -} - -void NotesPanelViewShell::VirtVScrollHdl(ScrollAdaptor* /*pVScroll*/) -{ - OutlinerView* pOutlinerView = mpNotesPanelView->GetOutlinerView(); - - if (pOutlinerView) - { - pOutlinerView->SetVisArea({ Point(0, mpVerticalScrollBar->GetThumbPos()), - pOutlinerView->GetVisArea().GetSize() }); - pOutlinerView->GetEditView().Invalidate(); - - auto currentDocPos = pOutlinerView->GetVisArea().Top(); - auto nDiff = currentDocPos - mpVerticalScrollBar->GetThumbPos(); - pOutlinerView->Scroll(0, nDiff); - } -} - -void NotesPanelViewShell::VisAreaChanged(const ::tools::Rectangle& rRect) -{ - ViewShell::VisAreaChanged(rRect); - GetViewShellBase().GetDrawController()->FireVisAreaChanged(rRect); -} - -void NotesPanelViewShell::ArrangeGUIElements() -{ - // Retrieve the current size (thickness) of the scroll bars. That is - // the width of the vertical and the height of the horizontal scroll - // bar. - int nScrollBarSize = GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize(); - maScrBarWH = Size(nScrollBarSize, nScrollBarSize); - - ViewShell::ArrangeGUIElements(); - - ::sd::Window* pWindow = mpContentWindow.get(); - if (pWindow == nullptr) - return; - - pWindow->SetMinZoomAutoCalc(false); - mpNotesPanelView->onResize(); -} - -SdPage* NotesPanelViewShell::GetActualPage() { return getCurrentPage(); } - -SdPage* NotesPanelViewShell::getCurrentPage() const -{ - SdPage* pCurrentPage = nullptr; - - std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell) - pCurrentPage = pMainViewShell->GetActualPage(); - - if (!pCurrentPage) - return nullptr; - - switch (pCurrentPage->GetPageKind()) - { - case PageKind::Standard: - return GetDoc()->GetSdPage((pCurrentPage->GetPageNum() - 1) >> 1, PageKind::Notes); - case PageKind::Notes: - return pCurrentPage; - default: - case PageKind::Handout: - return nullptr; - } -} - -css::uno::Reference<css::drawing::XDrawSubController> NotesPanelViewShell::CreateSubController() -{ - // SubController appears is only relevant for MainViewShell - // NotesPanel isn't meant as a MainViewShell - return {}; -} - -void NotesPanelViewShell::ReadFrameViewData(FrameView* /*pView*/) -{ - DrawController& rController(*GetViewShellBase().GetDrawController()); - rController.FireSelectionChangeListener(); -} - -void NotesPanelViewShell::WriteFrameViewData() {} - -/** - * Activate(): during the first invocation the fields get updated - */ -void NotesPanelViewShell::Activate(bool bIsMDIActivate) -{ - if (!mbInitialized) - { - mbInitialized = true; - SfxRequest aRequest(SID_EDIT_OUTLINER, SfxCallMode::SLOT, GetDoc()->GetItemPool()); - FuPermanent(aRequest); - } - - ViewShell::Activate(bIsMDIActivate); - SfxShell::BroadcastContextForActivation(true); - - if (bIsMDIActivate) - { - OutlinerView* pOutlinerView = mpNotesPanelView->GetOutlinerView(); - ::Outliner* pOutl = pOutlinerView->GetOutliner(); - pOutl->UpdateFields(); - } -} - -/** - * SfxRequests for permanent functions - */ -void NotesPanelViewShell::FuPermanent(SfxRequest& rReq) -{ - if (HasCurrentFunction()) - { - DeactivateCurrentFunction(true); - } - - switch (rReq.GetSlot()) - { - case SID_EDIT_OUTLINER: - { - ::Outliner& rOutl = mpNotesPanelView->GetOutliner(); - rOutl.GetUndoManager().Clear(); - rOutl.UpdateFields(); - - SetCurrentFunction(FuSimpleOutlinerText::Create( - this, GetActiveWindow(), mpNotesPanelView.get(), GetDoc(), rReq)); - - rReq.Done(); - } - break; - - default: - break; - } - - if (HasOldFunction()) - { - GetOldFunction()->Deactivate(); - SetOldFunction(nullptr); - } - - if (HasCurrentFunction()) - { - GetCurrentFunction()->Activate(); - SetOldFunction(GetCurrentFunction()); - } -} - -/** - * Zoom with zoom factor. Inform OutlinerView - */ -void NotesPanelViewShell::SetZoom(::tools::Long nZoom) -{ - ViewShell::SetZoom(nZoom); - - ::sd::Window* pWindow = mpContentWindow.get(); - if (pWindow) - mpNotesPanelView->onResize(); - - GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM); - GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOMSLIDER); -} - -/** - * Zoom with zoom rectangle. Inform OutlinerView - */ -void NotesPanelViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect) -{ - ViewShell::SetZoomRect(rZoomRect); - - ::sd::Window* pWindow = mpContentWindow.get(); - if (pWindow) - mpNotesPanelView->onResize(); - - GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM); - GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOMSLIDER); -} - -void NotesPanelViewShell::ExecCtrl(SfxRequest& rReq) -{ - sal_uInt16 nSlot = rReq.GetSlot(); - switch (nSlot) - { - case SID_MAIL_SCROLLBODY_PAGEDOWN: - { - ExecReq(rReq); - break; - } - - case SID_OPT_LOCALE_CHANGED: - { - mpNotesPanelView->GetOutliner().UpdateFields(); - rReq.Done(); - break; - } - - default: - break; - } -} - -void NotesPanelViewShell::GetCtrlState(SfxItemSet& rSet) -{ - if (SfxItemState::DEFAULT == rSet.GetItemState(SID_HYPERLINK_GETLINK)) - { - SvxHyperlinkItem aHLinkItem; - - OutlinerView* pOLV = mpNotesPanelView->GetOutlinerView(); - if (pOLV) - { - const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection(); - if (pFieldItem) - { - ESelection aSel = pOLV->GetSelection(); - if (abs(aSel.nEndPos - aSel.nStartPos) == 1) - { - const SvxFieldData* pField = pFieldItem->GetField(); - if (auto pUrlField = dynamic_cast<const SvxURLField*>(pField)) - { - aHLinkItem.SetName(pUrlField->GetRepresentation()); - aHLinkItem.SetURL(pUrlField->GetURL()); - aHLinkItem.SetTargetFrame(pUrlField->GetTargetFrame()); - } - } - } - } - rSet.Put(aHLinkItem); - } - rSet.Put(SfxBoolItem(SID_READONLY_MODE, GetDocSh()->IsReadOnly())); - - if (SfxItemState::DEFAULT == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN)) - rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, true)); - - if (!(SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_HALFWIDTH) - || SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_FULLWIDTH) - || SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_HIRAGANA) - || SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_KATAKANA))) - return; - - if (!SvtCJKOptions::IsChangeCaseMapEnabled()) - { - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_HALFWIDTH, false); - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_FULLWIDTH, false); - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_HIRAGANA, false); - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_KATAKANA, false); - rSet.DisableItem(SID_TRANSLITERATE_HALFWIDTH); - rSet.DisableItem(SID_TRANSLITERATE_FULLWIDTH); - rSet.DisableItem(SID_TRANSLITERATE_HIRAGANA); - rSet.DisableItem(SID_TRANSLITERATE_KATAKANA); - } - else - { - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_HALFWIDTH, true); - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_FULLWIDTH, true); - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_HIRAGANA, true); - GetViewFrame()->GetBindings().SetVisibleState(SID_TRANSLITERATE_KATAKANA, true); - } -} - -void NotesPanelViewShell::GetAttrState(SfxItemSet& rSet) -{ - SfxWhichIter aIter(rSet); - sal_uInt16 nWhich = aIter.FirstWhich(); - SfxAllItemSet aAllSet(*rSet.GetPool()); - - while (nWhich) - { - sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich) ? GetPool().GetSlotId(nWhich) : nWhich; - - switch (nSlotId) - { - case SID_STYLE_FAMILY2: - case SID_STYLE_FAMILY3: - { - rSet.DisableItem(nWhich); - } - break; - - case SID_STYLE_FAMILY5: - { - SfxStyleSheet* pStyleSheet = mpNotesPanelView->GetOutlinerView()->GetStyleSheet(); - - if (pStyleSheet) - { - pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); - - if (pStyleSheet) - { - SfxTemplateItem aItem(nWhich, pStyleSheet->GetName()); - aAllSet.Put(aItem); - } - } - - if (!pStyleSheet) - { - SfxTemplateItem aItem(nWhich, OUString()); - aAllSet.Put(aItem); - } - } - break; - - case SID_STYLE_EDIT: - { - std::unique_ptr<SfxUInt16Item> pFamilyItem; - GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); - if (pFamilyItem - && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) - == SfxStyleFamily::Pseudo) - { - rSet.DisableItem(nWhich); - } - } - break; - - case SID_STYLE_UPDATE_BY_EXAMPLE: - { - OutlinerView* pOV = mpNotesPanelView->GetOutlinerView(); - ESelection aESel(pOV->GetSelection()); - - if (aESel.nStartPara != aESel.nEndPara || aESel.nStartPos != aESel.nEndPos) - // spanned selection, i.e. StyleSheet and/or - // attribution not necessarily unique - rSet.DisableItem(nWhich); - } - break; - - case SID_STYLE_NEW: - case SID_STYLE_DELETE: - case SID_STYLE_HIDE: - case SID_STYLE_SHOW: - case SID_STYLE_NEW_BY_EXAMPLE: - case SID_STYLE_WATERCAN: - { - rSet.DisableItem(nWhich); - } - break; - - default: - break; - } - - nWhich = aIter.NextWhich(); - } - - rSet.Put(aAllSet, false); - TextObjectBar::GetAttrStateImpl(this, mpView, rSet, nullptr); -} - -void NotesPanelViewShell::GetState(SfxItemSet& rSet) -{ - // Iterate over all requested items in the set. - SfxWhichIter aIter(rSet); - sal_uInt16 nWhich = aIter.FirstWhich(); - while (nWhich) - { - switch (nWhich) - { - case SID_SEARCH_ITEM: - case SID_SEARCH_OPTIONS: - // Call common (old) implementation in the document shell. - GetDocSh()->GetState(rSet); - break; - default: - SAL_WARN("sd", - "NotesPanelViewShell::GetState(): can not handle which id " << nWhich); - break; - } - nWhich = aIter.NextWhich(); - } -} - -void NotesPanelViewShell::GetCharState(SfxItemSet& rSet) -{ - TextObjectBar::GetCharStateImpl(this, mpView, rSet); -} - -void NotesPanelViewShell::ExecStatusBar(SfxRequest& /*rReq*/) {} - -void NotesPanelViewShell::GetStatusBarState(SfxItemSet& rSet) -{ - // Zoom-Item - if (SfxItemState::DEFAULT == rSet.GetItemState(SID_ATTR_ZOOM)) - { - sal_uInt16 nZoom = static_cast<sal_uInt16>(GetActiveWindow()->GetZoom()); - - std::unique_ptr<SvxZoomItem> pZoomItem(new SvxZoomItem(SvxZoomType::PERCENT, nZoom)); - - // limit area - SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL; - nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL; - nZoomValues &= ~SvxZoomEnableFlags::WHOLEPAGE; - nZoomValues &= ~SvxZoomEnableFlags::PAGEWIDTH; - - pZoomItem->SetValueSet(nZoomValues); - rSet.Put(std::move(pZoomItem)); - } - - if (SfxItemState::DEFAULT == rSet.GetItemState(SID_ATTR_ZOOMSLIDER)) - { - if (GetDocSh()->IsUIActive() || !GetActiveWindow()) - { - rSet.DisableItem(SID_ATTR_ZOOMSLIDER); - } - else - { - sd::Window* pActiveWindow = GetActiveWindow(); - SvxZoomSliderItem aZoomItem(static_cast<sal_uInt16>(pActiveWindow->GetZoom()), - static_cast<sal_uInt16>(pActiveWindow->GetMinZoom()), - static_cast<sal_uInt16>(pActiveWindow->GetMaxZoom())); - aZoomItem.AddSnappingPoint(100); - rSet.Put(aZoomItem); - } - } - - // TODO: page view and layout strings - // rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) ); - // rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) ); -} - -void NotesPanelViewShell::FuTemporary(SfxRequest& rReq) -{ - DeactivateCurrentFunction(); - - OutlinerView* pOutlinerView = mpNotesPanelView->GetOutlinerView(); - sal_uInt16 nSId = rReq.GetSlot(); - - switch (nSId) - { - case SID_ATTR_ZOOM: - { - const SfxItemSet* pArgs = rReq.GetArgs(); - - if (pArgs) - { - SvxZoomType eZT = pArgs->Get(SID_ATTR_ZOOM).GetType(); - switch (eZT) - { - case SvxZoomType::PERCENT: - SetZoom(static_cast<::tools::Long>(pArgs->Get(SID_ATTR_ZOOM).GetValue())); - Invalidate(SID_ATTR_ZOOM); - Invalidate(SID_ATTR_ZOOMSLIDER); - break; - default: - break; - } - rReq.Done(); - } - else - { - // open the zoom dialog here - SetCurrentFunction(FuScale::Create(this, GetActiveWindow(), mpNotesPanelView.get(), - GetDoc(), rReq)); - } - Cancel(); - } - break; - - case SID_ATTR_ZOOMSLIDER: - { - const SfxItemSet* pArgs = rReq.GetArgs(); - - const SfxUInt16Item* pScale - = (pArgs && pArgs->Count() == 1) ? rReq.GetArg(SID_ATTR_ZOOMSLIDER) : nullptr; - if (pScale && CHECK_RANGE(5, pScale->GetValue(), 3000)) - { - SetZoom(pScale->GetValue()); - - SfxBindings& rBindings = GetViewFrame()->GetBindings(); - rBindings.Invalidate(SID_ATTR_ZOOM); - rBindings.Invalidate(SID_ZOOM_IN); - rBindings.Invalidate(SID_ZOOM_OUT); - rBindings.Invalidate(SID_ATTR_ZOOMSLIDER); - } - - Cancel(); - rReq.Done(); - break; - } - - case SID_ZOOM_IN: - { - SetZoom(std::min<::tools::Long>(GetActiveWindow()->GetZoom() * 2, - GetActiveWindow()->GetMaxZoom())); - ::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( - ::tools::Rectangle(Point(0, 0), GetActiveWindow()->GetOutputSizePixel())); - mpZoomList->InsertZoomRect(aVisAreaWin); - Invalidate(SID_ATTR_ZOOM); - Invalidate(SID_ZOOM_IN); - Invalidate(SID_ZOOM_OUT); - Invalidate(SID_ATTR_ZOOMSLIDER); - Cancel(); - rReq.Done(); - } - break; - - case SID_SIZE_REAL: - { - SetZoom(100); - ::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( - ::tools::Rectangle(Point(0, 0), GetActiveWindow()->GetOutputSizePixel())); - mpZoomList->InsertZoomRect(aVisAreaWin); - Invalidate(SID_ATTR_ZOOM); - Invalidate(SID_ATTR_ZOOMSLIDER); - Cancel(); - rReq.Done(); - } - break; - - case SID_ZOOM_OUT: - { - SetZoom(std::max<::tools::Long>(GetActiveWindow()->GetZoom() / 2, - GetActiveWindow()->GetMinZoom())); - ::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( - ::tools::Rectangle(Point(0, 0), GetActiveWindow()->GetOutputSizePixel())); - mpZoomList->InsertZoomRect(aVisAreaWin); - Invalidate(SID_ATTR_ZOOM); - Invalidate(SID_ZOOM_OUT); - Invalidate(SID_ZOOM_IN); - Invalidate(SID_ATTR_ZOOMSLIDER); - Cancel(); - rReq.Done(); - } - break; - - case SID_SELECTALL: - { - ::Outliner& rOutl = mpNotesPanelView->GetOutliner(); - sal_Int32 nParaCount = rOutl.GetParagraphCount(); - if (nParaCount > 0) - { - pOutlinerView->SelectRange(0, nParaCount); - } - Cancel(); - } - break; - - case SID_PRESENTATION: - case SID_PRESENTATION_CURRENT_SLIDE: - case SID_REHEARSE_TIMINGS: - { - slideshowhelp::ShowSlideShow(rReq, *GetDoc()); - Cancel(); - rReq.Done(); - } - break; - - case SID_STYLE_EDIT: - case SID_STYLE_UPDATE_BY_EXAMPLE: - { - if (rReq.GetArgs()) - { - SetCurrentFunction(FuTemplate::Create(this, GetActiveWindow(), - mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - - rReq.Ignore(); - } - break; - - case SID_PRESENTATION_DLG: - { - SetCurrentFunction(FuSlideShowDlg::Create(this, GetActiveWindow(), - mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_REMOTE_DLG: - { -#ifdef ENABLE_SDREMOTE - SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(GetFrameWeld())); - pDlg->Execute(); -#endif - } - break; - - case SID_CUSTOMSHOW_DLG: - { - SetCurrentFunction(FuCustomShowDlg::Create(this, GetActiveWindow(), - mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_PHOTOALBUM: - { - SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - vcl::Window* pWin = GetActiveWindow(); - ScopedVclPtr<VclAbstractDialog> pDlg( - pFact->CreateSdPhotoAlbumDialog(pWin ? pWin->GetFrameWeld() : nullptr, GetDoc())); - - pDlg->Execute(); - - Cancel(); - rReq.Ignore(); - } - break; - } - - if (HasCurrentFunction()) - GetCurrentFunction()->Activate(); - - Invalidate(SID_CUT); - Invalidate(SID_COPY); - Invalidate(SID_PASTE); - Invalidate(SID_PASTE_UNFORMATTED); -} - -void NotesPanelViewShell::FuTemporaryModify(SfxRequest& rReq) -{ - DeactivateCurrentFunction(); - - OutlinerView* pOutlinerView = mpNotesPanelView->GetOutlinerView(); - - sal_uInt16 nSId = rReq.GetSlot(); - switch (nSId) - { - case SID_HYPERLINK_SETLINK: - { - const SfxItemSet* pReqArgs = rReq.GetArgs(); - - if (pReqArgs) - { - const SvxHyperlinkItem* pHLItem = &pReqArgs->Get(SID_HYPERLINK_SETLINK); - - SvxFieldItem aURLItem( - SvxURLField(pHLItem->GetURL(), pHLItem->GetName(), SvxURLFormat::Repr), - EE_FEATURE_FIELD); - ESelection aSel(pOutlinerView->GetSelection()); - pOutlinerView->InsertField(aURLItem); - if (aSel.nStartPos <= aSel.nEndPos) - aSel.nEndPos = aSel.nStartPos + 1; - else - aSel.nStartPos = aSel.nEndPos + 1; - pOutlinerView->SetSelection(aSel); - } - - Cancel(); - rReq.Ignore(); - } - break; - - case FN_INSERT_SOFT_HYPHEN: - case FN_INSERT_HARDHYPHEN: - case FN_INSERT_HARD_SPACE: - case FN_INSERT_NNBSP: - case SID_INSERT_RLM: - case SID_INSERT_LRM: - case SID_INSERT_WJ: - case SID_INSERT_ZWSP: - case SID_CHARMAP: - { - SetCurrentFunction( - FuBullet::Create(this, GetActiveWindow(), mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_OUTLINE_BULLET: - case FN_SVX_SET_BULLET: - case FN_SVX_SET_NUMBER: - { - SetCurrentFunction(FuBulletAndPosition::Create(this, GetActiveWindow(), - mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_THESAURUS: - { - SetCurrentFunction(FuThesaurus::Create(this, GetActiveWindow(), mpNotesPanelView.get(), - GetDoc(), rReq)); - Cancel(); - rReq.Ignore(); - } - break; - - case SID_CHAR_DLG_EFFECT: - case SID_CHAR_DLG: - { - SetCurrentFunction( - FuChar::Create(this, GetActiveWindow(), mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_INSERTFILE: - { - SetCurrentFunction(FuInsertFile::Create(this, GetActiveWindow(), mpNotesPanelView.get(), - GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_PRESENTATIONOBJECT: - { - SetCurrentFunction(FuPresentationObjects::Create( - this, GetActiveWindow(), mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_SET_DEFAULT: - { - pOutlinerView->RemoveAttribs(true); // sal_True = also paragraph attributes - Cancel(); - rReq.Done(); - } - break; - - case SID_SUMMARY_PAGE: - { - SetCurrentFunction(FuSummaryPage::Create(this, GetActiveWindow(), - mpNotesPanelView.get(), GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_EXPAND_PAGE: - { - SetCurrentFunction(FuExpandPage::Create(this, GetActiveWindow(), mpNotesPanelView.get(), - GetDoc(), rReq)); - Cancel(); - } - break; - - case SID_INSERT_FLD_DATE_FIX: - case SID_INSERT_FLD_DATE_VAR: - case SID_INSERT_FLD_TIME_FIX: - case SID_INSERT_FLD_TIME_VAR: - case SID_INSERT_FLD_AUTHOR: - case SID_INSERT_FLD_PAGE: - case SID_INSERT_FLD_PAGE_TITLE: - case SID_INSERT_FLD_PAGES: - case SID_INSERT_FLD_FILE: - { - std::unique_ptr<SvxFieldItem> pFieldItem; - - switch (nSId) - { - case SID_INSERT_FLD_DATE_FIX: - pFieldItem.reset(new SvxFieldItem( - SvxDateField(Date(Date::SYSTEM), SvxDateType::Fix), EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_DATE_VAR: - pFieldItem.reset(new SvxFieldItem(SvxDateField(), EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_TIME_FIX: - pFieldItem.reset(new SvxFieldItem( - SvxExtTimeField(::tools::Time(::tools::Time::SYSTEM), SvxTimeType::Fix), - EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_TIME_VAR: - pFieldItem.reset(new SvxFieldItem(SvxExtTimeField(), EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_AUTHOR: - { - SvtUserOptions aUserOptions; - pFieldItem.reset(new SvxFieldItem(SvxAuthorField(aUserOptions.GetFirstName(), - aUserOptions.GetLastName(), - aUserOptions.GetID()), - EE_FEATURE_FIELD)); - } - break; - - case SID_INSERT_FLD_PAGE: - pFieldItem.reset(new SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_PAGE_TITLE: - pFieldItem.reset(new SvxFieldItem(SvxPageTitleField(), EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_PAGES: - pFieldItem.reset(new SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD)); - break; - - case SID_INSERT_FLD_FILE: - { - OUString aName; - if (GetDocSh()->HasName()) - aName = GetDocSh()->GetMedium()->GetName(); - pFieldItem.reset(new SvxFieldItem(SvxExtFileField(aName), EE_FEATURE_FIELD)); - } - break; - } - - const SvxFieldItem* pOldFldItem = pOutlinerView->GetFieldAtSelection(); - - if (pOldFldItem - && (nullptr != dynamic_cast<const SvxURLField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxDateField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxTimeField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxExtTimeField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxExtFileField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxAuthorField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxPageField*>(pOldFldItem->GetField()) - || nullptr != dynamic_cast<const SvxPagesField*>(pOldFldItem->GetField()))) - { - // select field, so it gets deleted on Insert - ESelection aSel = pOutlinerView->GetSelection(); - if (aSel.nStartPos == aSel.nEndPos) - aSel.nEndPos++; - pOutlinerView->SetSelection(aSel); - } - - if (pFieldItem) - pOutlinerView->InsertField(*pFieldItem); - - pFieldItem.reset(); - - Cancel(); - rReq.Ignore(); - } - break; - - case SID_MODIFY_FIELD: - { - const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection(); - - if (pFldItem - && (nullptr != dynamic_cast<const SvxDateField*>(pFldItem->GetField()) - || nullptr != dynamic_cast<const SvxAuthorField*>(pFldItem->GetField()) - || nullptr != dynamic_cast<const SvxExtFileField*>(pFldItem->GetField()) - || nullptr != dynamic_cast<const SvxExtTimeField*>(pFldItem->GetField()))) - { - // Dialog... - SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - vcl::Window* pWin = GetActiveWindow(); - ScopedVclPtr<AbstractSdModifyFieldDlg> pDlg(pFact->CreateSdModifyFieldDlg( - pWin ? pWin->GetFrameWeld() : nullptr, pFldItem->GetField(), - pOutlinerView->GetAttribs())); - if (pDlg->Execute() == RET_OK) - { - std::unique_ptr<SvxFieldData> pField(pDlg->GetField()); - if (pField) - { - SvxFieldItem aFieldItem(*pField, EE_FEATURE_FIELD); - //pOLV->DeleteSelected(); <-- unfortunately missing! - // select field, so it gets deleted on Insert - ESelection aSel = pOutlinerView->GetSelection(); - bool bSel = true; - if (aSel.nStartPos == aSel.nEndPos) - { - bSel = false; - aSel.nEndPos++; - } - pOutlinerView->SetSelection(aSel); - - pOutlinerView->InsertField(aFieldItem); - - // reset selection to original state - if (!bSel) - aSel.nEndPos--; - pOutlinerView->SetSelection(aSel); - - pField.reset(); - } - - SfxItemSet aSet(pDlg->GetItemSet()); - if (aSet.Count()) - { - pOutlinerView->SetAttribs(aSet); - - ::Outliner* pOutliner = pOutlinerView->GetOutliner(); - if (pOutliner) - pOutliner->UpdateFields(); - } - } - } - - Cancel(); - rReq.Ignore(); - } - break; - } - - if (HasCurrentFunction()) - GetCurrentFunction()->Activate(); - - Invalidate(SID_CUT); - Invalidate(SID_COPY); - Invalidate(SID_PASTE); - Invalidate(SID_PASTE_UNFORMATTED); -} - -void NotesPanelViewShell::FuSupport(SfxRequest& rReq) -{ - if (rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily( - static_cast<SfxStyleFamily>(rReq.GetArgs()->Get(SID_STYLE_FAMILY).GetValue())); - - bool bPreviewState = false; - sal_uInt16 nSlot = rReq.GetSlot(); - - switch (nSlot) - { - case SID_CUT: - { - if (HasCurrentFunction()) - { - GetCurrentFunction()->DoCut(); - } - else if (mpNotesPanelView) - { - mpNotesPanelView->DoCut(); - } - rReq.Done(); - bPreviewState = true; - } - break; - -e ... etc. - the rest is truncated