[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - extensions/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 24 12:49:17 UTC 2021


 extensions/source/propctrlr/standardcontrol.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 782f5369e2966e6e54dd71a3c4e1e62927029031
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 23 15:46:18 2021 +0000
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Feb 24 13:47:56 2021 +0100

    tdf#139070 format entry view of multilines with final formatting
    
    so during editing of a multiline the singleline entry shows what
    it will show when editing is finished, so we suppress the default
    behaviour of gtk to show a newline symbol and the default
    behaviour of vcl to strip newlines
    
    Change-Id: Id7d384efc8b737c463f1bd44ca61376f342edb25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111416
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index c5b03aa270e5..26219f8a79af 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -741,7 +741,16 @@ namespace pcr
 
     IMPL_LINK_NOARG(OMultilineEditControl, TextViewModifiedHdl, weld::TextView&, void)
     {
-        m_xEntry->set_text(m_xTextView->get_text());
+        // tdf#139070 during editing update the entry to look like how it will
+        // look once editing is finished so that the default behaviour of vcl
+        // to strip newlines and the default behaviour of gtk to show a newline
+        // symbol is suppressed
+        OUString sText = m_xTextView->get_text();
+        auto aSeq = lcl_convertMultiLineToList(sText);
+        if (aSeq.getLength() > 1)
+            m_xEntry->set_text(lcl_convertListToDisplayText(aSeq));
+        else
+            m_xEntry->set_text(sText);
         CheckEntryTextViewMisMatch();
         setModified();
     }


More information about the Libreoffice-commits mailing list