sw/source/uibase/docvw/edtwin.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
New commits: commit 216a43bc1799221d53e1f3a590309aaa63b6c9dd Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jun 18 15:46:20 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 18 21:00:04 2021 +0200 tdf#142852 forward surrounding-text requests to an active drawing editengine when present. As we do for related CommandEventId::[StartExtTextInput/EndExtTextInput] Change-Id: Ie5b57c8a8a1a258efc2be079a2674b1ca620dc9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117465 Reviewed-by: Justin Luth <justin_l...@sil.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Justin Luth <justin_l...@sil.org> Tested-by: Jenkins diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index d93c1f08178c..22c1c3f55e1d 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -6397,8 +6397,12 @@ void SwEditWin::SetUseInputLanguage( bool bNew ) OUString SwEditWin::GetSurroundingText() const { - OUString sReturn; SwWrtShell& rSh = m_rView.GetWrtShell(); + + if (rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit()) + return rSh.GetDrawView()->GetTextEditOutlinerView()->GetSurroundingText(); + + OUString sReturn; if( rSh.HasSelection() && !rSh.IsMultiSelection() && rSh.IsSelOnePara() ) rSh.GetSelectedText( sReturn, ParaBreakType::ToOnlyCR ); else if( !rSh.HasSelection() ) @@ -6430,6 +6434,10 @@ OUString SwEditWin::GetSurroundingText() const Selection SwEditWin::GetSurroundingTextSelection() const { SwWrtShell& rSh = m_rView.GetWrtShell(); + + if (rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit()) + return rSh.GetDrawView()->GetTextEditOutlinerView()->GetSurroundingTextSelection(); + if( rSh.HasSelection() ) { OUString sReturn; @@ -6465,6 +6473,9 @@ bool SwEditWin::DeleteSurroundingText(const Selection& rSelection) { SwWrtShell& rSh = m_rView.GetWrtShell(); + if (rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit()) + return rSh.GetDrawView()->GetTextEditOutlinerView()->DeleteSurroundingText(rSelection); + if (rSh.HasSelection()) return false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits