core.git: Branch 'feature/cib_contract49' - sd/source
sd/source/ui/dlg/NotesChildWindow.cxx | 66 ++ sd/source/ui/inc/NotesChildWindow.hxx |4 ++ 2 files changed, 70 insertions(+) New commits: commit 9c131e19183fe3ae596b5f9947fc23311b4f66d5 Author: Sarper Akdemir AuthorDate: Tue Apr 16 10:59:50 2024 +0200 Commit: Thorsten Behrens CommitDate: Tue Apr 16 12:03:01 2024 +0200 related tdf#33603: improve clipboard/paste handling for noteseditwindow Similar to sd::View behavior, BeginPasteOrDropHdl & EndPasteOrDropHdl are used to format the pasted content. Specifically for the notes edit window, EndPasteOrDropHdl enforces the default Notes placeholder font size for pasted text. In general for better handling of key inputs - including paste, now NotesEditWindow uses the OutlinerView implementation of PostKeyEvent instead of EditView. Getting it behave more like sd::View. Change-Id: If0591db9c63e43bf702911fcca3e1981d851fd10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166144 Tested-by: allotropia jenkins Reviewed-by: Thorsten Behrens diff --git a/sd/source/ui/dlg/NotesChildWindow.cxx b/sd/source/ui/dlg/NotesChildWindow.cxx index 0ab856da55ef..436c4c5ff1bf 100644 --- a/sd/source/ui/dlg/NotesChildWindow.cxx +++ b/sd/source/ui/dlg/NotesChildWindow.cxx @@ -69,6 +69,9 @@ NotesChildDockingWindow::NotesChildDockingWindow(SfxBindings* _pBindings, mpOutliner = std::make_unique(>GetDocShell()->GetPool(), OutlinerMode::TextObject); +mpOutliner->SetStyleSheetPool( + static_cast(mpViewShellBase->GetDocShell()->GetStyleSheetPool())); + mpOutlinerView = std::make_unique(mpOutliner.get(), nullptr); mpOutliner->InsertView(mpOutlinerView.get()); @@ -132,6 +135,51 @@ IMPL_LINK(NotesEditWindow, EventMultiplexerListener, tools::EventMultiplexerEven } } +IMPL_LINK(NotesEditWindow, EndPasteOrDropHdl, PasteOrDropInfos*, pInfo, void) +{ +/* Style Sheet handling */ +if (!mrParentWindow.GetOutliner() || !mpTextObj) +return; + +SdPage* pPage = static_cast(mpTextObj->getSdrPageFromSdrObject()); +if (!pPage) +return; + +SfxStyleSheet* pStyleSheet = pPage->GetStyleSheetForPresObj(PresObjKind::Notes); +if (!pStyleSheet) +return; + +for (sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++) +{ +SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); +mrParentWindow.GetOutliner()->SetStyleSheet(nPara, pStyleSheet); + +// force the pasted paragraph font height to the notes placeholder default. +SfxItemSet aFontHeightSet(*rItemSet.GetPool(), + WhichRangesContainer(EE_CHAR_START, EE_CHAR_END)); + +for (auto& rWhich : { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL }) +{ +if (auto pFontHeightItem = rItemSet.GetItemIfSet(rWhich)) +aFontHeightSet.Put(*pFontHeightItem); +} + +mrParentWindow.GetOutliner()->SetCharAttribs(nPara, aFontHeightSet); +} +} + +IMPL_LINK(NotesEditWindow, BeginPasteOrDropHdl, PasteOrDropInfos*, pInfo, void) +{ +if (!mrParentWindow.GetOutliner() || !mpTextObj || !mpTextObj->getSdrPageFromSdrObject()) +return; + +// Turn character attributes of the paragraph of the insert position into +// character-level attributes, so they are not lost when OnEndPasteOrDrop() +// sets the paragraph stylesheet. +SfxItemSet aSet(mrParentWindow.GetOutliner()->GetParaAttribs(pInfo->nStartPara)); +mrParentWindow.GetOutliner()->SetCharAttribs(pInfo->nStartPara, aSet); +} + void NotesEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) { Size aSize(pDrawingArea->get_size_request()); @@ -185,6 +233,11 @@ void NotesEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) provideNoteText(); +mrParentWindow.GetOutliner()->SetEndPasteOrDropHdl( +LINK(this, NotesEditWindow, EndPasteOrDropHdl)); +mrParentWindow.GetOutliner()->SetBeginPasteOrDropHdl( +LINK(this, NotesEditWindow, BeginPasteOrDropHdl)); + GetEditEngine()->SetStatusEventHdl(LINK(this, NotesEditWindow, EditStatusHdl)); } @@ -599,6 +652,19 @@ void NotesEditWindow::Notify(SfxBroadcaster&, const SfxHint& rHint) } } +bool NotesEditWindow::KeyInput(const KeyEvent& rKEvt) +{ +bool bDone = false; + +if (::OutlinerView* pOutlinerView = mrParentWindow.GetOutlinerView()) +bDone = pOutlinerView->PostKeyEvent(rKEvt); + +if (!bDone) +bDone = WeldEditView::KeyInput(rKEvt); + +return bDone; +} + IMPL_LINK_NOARG(NotesEditWindow, EditStatusHdl, EditStatus&, void) { Resize(); } IMPL_LINK_NOARG(NotesEditWindow, EditModifiedHdl, LinkParamNone*, void) diff --git a/sd/source/ui/inc/NotesChildWindow.hxx b/sd/source/ui/inc/NotesChildWindow.hxx index 5242595bcb24..c94e35c20a2e 100644 ---
core.git: Branch 'feature/cib_contract49' - sd/source
sd/source/ui/view/NotesPanelViewShell.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 2d2ba2a44bdd6c970571b39573d8dbcf7add0f11 Author: Thorsten Behrens AuthorDate: Sun Apr 7 16:51:20 2024 +0200 Commit: Thorsten Behrens CommitDate: Sun Apr 7 16:51:20 2024 +0200 Fix build for Win x64 This was triggering "warning C4715: 'sd::NotesPanelViewShell::getCurrentPage': not all control paths return a value" otherwise. Change-Id: I96dedd026faa2c5ff2729eb1f93e426ef5746de8 diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx index a3b38e62f621..a8902f1eacf4 100644 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ b/sd/source/ui/view/NotesPanelViewShell.cxx @@ -272,6 +272,7 @@ SdPage* NotesPanelViewShell::getCurrentPage() const return GetDoc()->GetSdPage((pCurrentPage->GetPageNum() - 1) >> 1, PageKind::Notes); case PageKind::Notes: return pCurrentPage; +default: case PageKind::Handout: return nullptr; }
core.git: Branch 'feature/cib_contract49' - sd/source
sd/source/ui/dlg/present.cxx |4 sd/source/ui/slideshow/slideshow.cxx |9 + 2 files changed, 1 insertion(+), 12 deletions(-) New commits: commit dec271194f9b2b0647f075f014af7dbd2da4036a Author: Thorsten Behrens AuthorDate: Thu Apr 4 21:19:02 2024 +0200 Commit: Thorsten Behrens CommitDate: Sun Apr 7 00:18:26 2024 +0200 IASS: make live slideshow non-experimental Change-Id: I36fb6eae8f77f02fa1a9bcf96a7c074d78ba86c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165804 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index 4f97a76fa8fe..401f7ba27250 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -24,8 +24,6 @@ #include #include -#include - #include #include #include @@ -155,8 +153,6 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxI m_xLbConsole->set_active(PresenterConsoleMode::Windowed); m_xCbxInteractiveMode->set_active( static_cast( rOutAttrs.Get( ATTR_PRESENT_INTERACTIVE ) ).GetValue() ); -if (!officecfg::Office::Common::Misc::ExperimentalMode::get()) -m_xCbxInteractiveMode->set_visible(false); InitMonitorSettings(); diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 5f6620ee346a..d8f73dfcf2fd 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -39,8 +39,6 @@ #include #include -#include - #include #include #include @@ -242,12 +240,7 @@ bool SlideShow::IsInteractiveSlideshow(const ViewShellBase* pViewShellBase) bool SlideShow::IsInteractiveSlideshow() const { -// allow override with ENV_VAR for practical dev reasons -static bool g_bEnable_Interactive_Slideshow(getenv("ENABLE_INTERACTIVE_SLIDESHOW")); -if (g_bEnable_Interactive_Slideshow) -return true; - -return officecfg::Office::Common::Misc::ExperimentalMode::get() && mpDoc->getPresentationSettings().mbInteractive; +return mpDoc->getPresentationSettings().mbInteractive; } void SlideShow::CreateController( ViewShell* pViewSh, ::sd::View* pView, vcl::Window* pParentWindow )
core.git: Branch 'feature/cib_contract49' - sd/source
sd/source/ui/app/sdmod1.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 1946c8d4858f1d288596c506b58dabea1578fc7b Author: Thorsten Behrens AuthorDate: Sun Mar 10 16:18:22 2024 +0100 Commit: Thorsten Behrens CommitDate: Sun Mar 10 16:20:16 2024 +0100 related tdf#33603: switch-on notes panel in default config This is a bit of a hack, since currently SID_NOTES_WINDOW is a plain bool item, with no hooking-up into the Impress framework. So lets toggle initial state (which gets saved into /org.openoffice.Office.Views/Windows/simpress/27417 after first run) into 'visible'. Change-Id: I672b537ef78474cc9514503f9a613d12ebe92436 diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 197977498189..0794a2e8f760 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -35,10 +35,12 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -506,6 +508,13 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest const & rReq ) // tdf#127946 pass in argument for dialog parent SfxUnoFrameItem aDocFrame(SID_FILLFRAME, pFrame->GetFrameInterface()); pDispatcher->ExecuteList(SID_TIPOFTHEDAY, SfxCallMode::SLOT, {}, { }); + +// hack: toggle notes area default-on if no config found +SvtViewOptions aNotesAreaWinOpt( +EViewType::Window, "simpress/" + OUString::number(SID_NOTES_WINDOW)); +css::uno::Sequence < css::beans::NamedValue > aSeq = aNotesAreaWinOpt.GetUserData(); +if ( !aSeq.hasElements() ) +pDispatcher->Execute(SID_NOTES_WINDOW, SfxCallMode::ASYNCHRON); } } }
core.git: Branch 'feature/cib_contract49' - sd/source
sd/source/ui/view/drvwshrg.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit c56c426a369cd94ccf0de68d5036c666dc1a2e95 Author: Sarper Akdemir AuthorDate: Thu Feb 22 17:45:54 2024 +0300 Commit: Thorsten Behrens CommitDate: Tue Feb 27 13:35:02 2024 +0100 related tdf#33603: do not register NotesChildWindow for Draw Draw doesn't need the notes panel introduced in c4c1ca58bb587a56a30c7f4817c346054ce37f2a, so don't register that for it's shell (GraphicViewShell). Change-Id: I062a54e806058f352721b89d7c10cece8612 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163775 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx index 9871db2e2de7..2b1c3459a9fd 100644 --- a/sd/source/ui/view/drvwshrg.cxx +++ b/sd/source/ui/view/drvwshrg.cxx @@ -105,7 +105,6 @@ void GraphicViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow( sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId()); - GetStaticInterface()->RegisterChildWindow(::sd::NotesChildWindow::GetChildWindowId()); } } // end of namespace sd