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.akdemir@allotropia.de>
This commit is contained in:
Sarper Akdemir
2025-04-09 16:53:53 +02:00
parent af3f54e7b1
commit 3edd54cd91
3 changed files with 24 additions and 4 deletions
+5
View File
@@ -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 ;
+10
View File
@@ -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())
+9 -4
View File
@@ -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() );