summaryrefslogtreecommitdiff
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-25 21:31:54 +0100
commit5ff60569f998d9afe9273ec4223d91f6d549e51a (patch)
treed9cf5b7d9f2f119114536e5f3890c6a6abf0a528
parent2f26a9c9242b8443f0fb987822404027053a98ff (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/+/111417 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 0b64c9518ef2..48ecc0be056a 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -737,7 +737,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();
}