summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-18 15:46:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-18 21:00:04 +0200
commit216a43bc1799221d53e1f3a590309aaa63b6c9dd (patch)
tree4f5910d3c93703fa0af53137291ff448c2fd8631 /sw
parentc21398066b6bf630070ed291456f2663e06d94b9 (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/+/117465 Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx13
1 files changed, 12 insertions, 1 deletions
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;