diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-18 15:46:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-19 22:18:11 +0200 |
commit | f3adb19b4e4f4e26aee50ce1d7cbc7a916253c04 (patch) | |
tree | dc492d6b08e46b0450814b8b7861fec623b61f61 | |
parent | 9799f798d8f84f352aa46e4e923e05e74c68f586 (diff) |
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/+/117421
Tested-by: Jenkins
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index bb0e735ec66f..b5e8ec1a6099 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -6434,8 +6434,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() ) @@ -6467,6 +6471,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; @@ -6502,6 +6510,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; |