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

New commits:
commit 8365076e896238d1dc870910f5fd6234d0931f7b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Feb 23 15:46:18 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Feb 23 20:19:12 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/+/111410
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index c20f6287fe8d..2307d0bf01f4 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();
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to