summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-23 15:46:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-23 20:19:12 +0100
commit8365076e896238d1dc870910f5fd6234d0931f7b (patch)
tree4387a77d2d8736c64a58b8202e1cec073ec09003 /extensions
parent288e8e9c291160916d26a559ff01a176fa9b9bec (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx11
1 files changed, 10 insertions, 1 deletions
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();
}