sd/source/ui/view/sdview3.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
New commits: commit 543fea4c360b18cea0ccdd13f03f7a3fe05ae4bb Author: Sarper Akdemir <sarper.akde...@allotropia.de> AuthorDate: Wed Apr 9 11:11:21 2025 +0200 Commit: Sarper Akdemir <sarper.akde...@allotropia.de> CommitDate: Wed Apr 9 14:02:16 2025 +0200 related tdf#166068: sd: make paste-special html paste into current textedit fix HTML paste-special option creating a new text object even if paste-special was used in a text-edit context. insert the text into the current text edit context instead of creating a seperate object. this is the current behavior for RTF & Flat XML Format paste options- so it is was a bug for html paste option. Change-Id: Ief9a19997a619b9f0b9c7855561de3f00de2df68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183913 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akde...@allotropia.de> diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index fa3d7c3d2e8a..e2add2287a6c 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -1430,8 +1430,24 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } else { - // mba: clipboard always must contain absolute URLs (could be from alien source) - bReturn = SdrView::Paste( *xStm, EETextFormat::Html, maDropPos, pPage, nPasteOptions ); + OutlinerView* pOLV = GetTextEditOutlinerView(); + + if (pOLV) + { + ::tools::Rectangle aRect(pOLV->GetOutputArea()); + Point aPos(pOLV->GetWindow()->PixelToLogic(maDropPos)); + + if (aRect.Contains(aPos) || (!bDrag && IsTextEdit())) + { + pOLV->Read(*xStm, EETextFormat::Html, mpDocSh->GetHeaderAttributes()); + bReturn = true; + } + } + + if( !bReturn ) + // mba: clipboard always must contain absolute URLs (could be from alien source) + bReturn = SdrView::Paste(*xStm, EETextFormat::Html, maDropPos, pPage, + nPasteOptions); } } }