sd/sdi/NotesPanelView.sdi | 5 +++++ sd/source/ui/view/NotesPanelViewShell.cxx | 10 ++++++++++ sd/source/ui/view/sdview3.cxx | 13 +++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-)
New commits: commit 3edd54cd912c739ecfdf166437db627fa03c1cc7 Author: Sarper Akdemir <sarper.akde...@allotropia.de> AuthorDate: Wed Apr 9 12:48:41 2025 +0200 Commit: Sarper Akdemir <sarper.akde...@allotropia.de> CommitDate: Wed Apr 9 16:53:53 2025 +0200 tdf#166068: support paste-special slot for notes pane start handling the paste special slot: supporting at least RICHTEXT, HTML, HTML_SIMPLE, EDITENGINE_ODF_TEXT_FLAT which should be trivial to handle for the notes area. Change-Id: If508e81f81b213d829efef59220196b18252dec4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183917 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akde...@allotropia.de> diff --git a/sd/sdi/NotesPanelView.sdi b/sd/sdi/NotesPanelView.sdi index 933ef9922401..8fb46d84a527 100644 --- a/sd/sdi/NotesPanelView.sdi +++ b/sd/sdi/NotesPanelView.sdi @@ -28,6 +28,11 @@ interface NotesPanelView ExecMethod = FuSupport ; StateMethod = GetMenuState ; ] + SID_PASTE_SPECIAL // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] SID_DELETE // ole : no, status : ? [ ExecMethod = FuSupport ; diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx index 9936a9cb81b1..aa4c893360fc 100644 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ b/sd/source/ui/view/NotesPanelViewShell.cxx @@ -30,6 +30,7 @@ #include <editeng/unolingu.hxx> #include <framework/FrameworkHelper.hxx> #include <fubullet.hxx> +#include <fuinsert.hxx> #include <fuchar.hxx> #include <fucushow.hxx> #include <fuexpand.hxx> @@ -812,6 +813,15 @@ void NotesPanelViewShell::FuTemporary(SfxRequest& rReq) rReq.Ignore(); } break; + + case SID_PASTE_SPECIAL: + { + SetCurrentFunction(FuInsertClipboard::Create(this, GetActiveWindow(), + mpNotesPanelView.get(), GetDoc(), rReq)); + Cancel(); + rReq.Ignore(); + } + break; } if (HasCurrentFunction()) diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index e2add2287a6c..1c3050fb753c 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -59,6 +59,7 @@ #include <sdmod.hxx> #include <sdresid.hxx> #include <strings.hrc> +#include <NotesPanelViewShell.hxx> #include <SlideSorterViewShell.hxx> #include <unomodel.hxx> #include <ViewClipboard.hxx> @@ -1437,7 +1438,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ::tools::Rectangle aRect(pOLV->GetOutputArea()); Point aPos(pOLV->GetWindow()->PixelToLogic(maDropPos)); - if (aRect.Contains(aPos) || (!bDrag && IsTextEdit())) + if (aRect.Contains(aPos) || (!bDrag && IsTextEdit()) + || dynamic_cast<sd::NotesPanelViewShell*>(mpViewSh)) { pOLV->Read(*xStm, EETextFormat::Html, mpDocSh->GetHeaderAttributes()); bReturn = true; @@ -1465,7 +1467,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ::tools::Rectangle aRect( pOLV->GetOutputArea() ); Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) ); - if( aRect.Contains( aPos ) || ( !bDrag && IsTextEdit() ) ) + if (aRect.Contains(aPos) || (!bDrag && IsTextEdit()) + || dynamic_cast<sd::NotesPanelViewShell*>(mpViewSh)) { // mba: clipboard always must contain absolute URLs (could be from alien source) pOLV->Read( *xStm, EETextFormat::Xml, mpDocSh->GetHeaderAttributes() ); @@ -1497,7 +1500,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ::tools::Rectangle aRect(pOLV->GetOutputArea()); Point aPos(pOLV->GetWindow()->PixelToLogic(maDropPos)); - if (aRect.Contains(aPos) || (!bDrag && IsTextEdit())) + if (aRect.Contains(aPos) || (!bDrag && IsTextEdit()) + || dynamic_cast<sd::NotesPanelViewShell*>(mpViewSh)) { // mba: clipboard always must contain absolute URLs (could be from alien source) pOLV->Read(*pHtmlStream, EETextFormat::Html, mpDocSh->GetHeaderAttributes()); @@ -1532,7 +1536,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ::tools::Rectangle aRect( pOLV->GetOutputArea() ); Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) ); - if( aRect.Contains( aPos ) || ( !bDrag && IsTextEdit() ) ) + if (aRect.Contains(aPos) || (!bDrag && IsTextEdit()) + || dynamic_cast<sd::NotesPanelViewShell*>(mpViewSh)) { // mba: clipboard always must contain absolute URLs (could be from alien source) pOLV->Read( *xStm, EETextFormat::Rtf, mpDocSh->GetHeaderAttributes() );