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/+/117420
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 446d2fa..6bca7e6 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;