From 782f5369e2966e6e54dd71a3c4e1e62927029031 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 23 Feb 2021 15:46:18 +0000 Subject: 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 --- extensions/source/propctrlr/standardcontrol.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); } -- cgit