[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jun 19 20:18:44 UTC 2021
sw/source/uibase/docvw/edtwin.cxx | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
New commits:
commit f3adb19b4e4f4e26aee50ce1d7cbc7a916253c04
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 18 15:46:20 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jun 19 22:18:11 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/+/117421
Tested-by: Jenkins
Tested-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
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;
More information about the Libreoffice-commits
mailing list