From 70d054a3da47362adf81442c399bc5bd3cfe43c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Wed, 27 Nov 2024 16:25:54 +0100 Subject: [PATCH] lok: jsdialog: enable font name box after save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we save - we block UI. In the lok we disable that for some cases like in commit e005690e9c648ce516c1ed60da6341c7215bf2c9 lok: avoid sending jsdialog messages during background save. But we also use save file to generate previews of shapes what happens on eg. resize in Online. Then we trigger disable and enable cycle for frames - and we end with FontNameBox enabled! That was causing the JSDialog combobox still being locked - because frame unlock was using direct VCL API, not weld:: one in the InterimItemWindow. Let's fix that with proper StateChanged handling. So now it is functional. But still I think there is some error in the logic - as after save we should beg the "before save" state of control not "always enabled". But it's different problem. Change-Id: Ia8e5c8c864156271b5f68d482234e83eb57b0deb (cherry picked from commit cbe229ec219e56ce1bb5dd9598f9052a98504249) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177489 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- svx/source/tbxctrls/tbcontrl.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index b554aff1993c..056821829c32 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -443,6 +443,13 @@ public: virtual Reference< css::accessibility::XAccessible > CreateAccessible() override; + virtual void StateChanged(StateChangedType nStateChange) override + { + if (nStateChange == StateChangedType::Enable) + m_xWidget->set_sensitive(IsEnabled()); + InterimItemWindow::StateChanged(nStateChange); + } + virtual void set_sensitive(bool bSensitive) override { m_xWidget->set_sensitive(bSensitive);