[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 18 19:06:02 UTC 2021


 sw/source/uibase/docvw/edtwin.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit d7b9b9e8e02aefd61669e07543fc370b0c58207f
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: Fri Jun 18 21:05:14 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/+/117420
    Tested-by: Jenkins
    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 446d2faa5405..6bca7e62ee4c 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;
 


More information about the Libreoffice-commits mailing list