From 3269f4fa5477104fbea363937ec84dfab2f914d9 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Tue, 25 Feb 2020 09:50:48 +0100 Subject: tdf#131000 fix stuck combo box property editor If you create a combo box control with a lot of entries, like a large cell range in Calc, LO will take a long time to render that cell content into the small, line-height MultiLineEdit (MLE). This doesn't happen for master, because it contains commit 1efeb17837c22499f00299c033ae59ba3910f7d7 ("weld Property Browser"), which changed the whole dialog and is much too large for a backport. A debugger shows LO is stuck in TextEngine:: CreateLines, which is part of the MLE resize call stack. Checking the master patch, it also replaces the MLE with a mere Edit. And since editing now always happens in the popup, no functionality is lost. So this patch just does just that MLE => Edit replacement for old releases. This results in a much faster visible / usable property editor. For the attached test document with 4000 entries, resize time goes down to 5s instead of minutes. Fun fact: since you can't actually edit that entry in the example bug document, because its content depends on Cell data, all the "work" is basically mood. Change-Id: I7583e0ed1a70765c9f3bd7ff730e920a833bf30b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89417 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens --- extensions/source/propctrlr/standardcontrol.cxx | 3 +-- extensions/source/propctrlr/standardcontrol.hxx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 7d79231e1ecd..776b691e0fb1 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -934,11 +934,10 @@ namespace pcr { SetCompoundControl( true ); - m_pImplEdit = VclPtr::Create( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) ); + m_pImplEdit = VclPtr::Create( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) ); SetSubEdit( m_pImplEdit ); m_pImplEdit->Show(); - if ( _nStyle & WB_DROPDOWN ) { m_pDropdownButton = VclPtr::Create( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP); m_pDropdownButton->SetSymbol(SymbolType::SPIN_DOWN); diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index f78c225e1175..ca79424345a5 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -343,7 +343,7 @@ namespace pcr class DropDownEditControl final : public Edit { VclPtr m_pFloatingEdit; - VclPtr m_pImplEdit; + VclPtr m_pImplEdit; VclPtr m_pDropdownButton; MultiLineOperationMode m_nOperationMode; bool m_bDropdown : 1; -- cgit