summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-23 15:46:18 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-24 13:47:56 +0100
commit782f5369e2966e6e54dd71a3c4e1e62927029031 (patch)
tree9f13f90a3ff110da65163c4647a23f438683dcc1
parent608151c7de0f0661783daceecd9250bdcf497b59 (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/+/111416 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-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 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();
}