[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - extensions/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 6 08:00:53 UTC 2021


 extensions/source/propctrlr/usercontrol.cxx |    9 ++++++---
 extensions/source/propctrlr/usercontrol.hxx |    7 ++++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 2481c7f308e0a30108fa7a8eedb05e34c457e0d9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Apr 1 17:31:58 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Apr 6 10:00:19 2021 +0200

    tdf#141084 don't notify that the control has changed content until focus-out
    
    while also keeping tdf#140239 working too
    
    Change-Id: I42833f6a4d2440781cf3f2297b78c6e313b3d239
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113474
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit d0628bd6813de2685f4367118dc0f9ca036d1eaf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113477
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx
index f26287029f86..86fdb30445d0 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -238,9 +238,7 @@ namespace pcr
         bool bSuccess = rValue >>= sURL;
         if (bSuccess && GraphicObject::isGraphicObjectUniqueIdURL(sURL))
             sURL = pControlWindow->GetPlaceHolder();
-        // tdf#140239 leave current cursor valid if the contents won't change
-        if (sURL != pControlWindow->GetURL())
-            pControlWindow->set_entry_text(sURL);
+        pControlWindow->set_entry_text(sURL);
     }
 
     Any SAL_CALL OFileUrlControl::getValue()
@@ -256,6 +254,11 @@ namespace pcr
         return ::cppu::UnoType<OUString>::get();
     }
 
+    IMPL_LINK_NOARG(OFileUrlControl, URLModifiedHdl, weld::ComboBox&, void)
+    {
+        editChanged();
+    }
+
 } // namespace pcr
 
 
diff --git a/extensions/source/propctrlr/usercontrol.hxx b/extensions/source/propctrlr/usercontrol.hxx
index b72fcbd8048d..7104f09cb0ad 100644
--- a/extensions/source/propctrlr/usercontrol.hxx
+++ b/extensions/source/propctrlr/usercontrol.hxx
@@ -119,6 +119,8 @@ namespace pcr
     typedef CommonBehaviourControl<css::inspection::XPropertyControl, SvtURLBox> OFileUrlControl_Base;
     class OFileUrlControl : public OFileUrlControl_Base
     {
+    private:
+        DECL_LINK(URLModifiedHdl, weld::ComboBox&, void);
     public:
         OFileUrlControl(std::unique_ptr<SvtURLBox> xWidget, std::unique_ptr<weld::Builder> xBuilder, bool bReadOnly);
 
@@ -130,7 +132,10 @@ namespace pcr
         virtual void SetModifyHandler() override
         {
             OFileUrlControl_Base::SetModifyHandler();
-            getTypedControlWindow()->connect_changed(LINK(this, CommonBehaviourControlHelper, ModifiedHdl));
+            SvtURLBox* pControlWindow = getTypedControlWindow();
+            // tdf#140239 and tdf#141084 don't notify that the control has changed content until focus-out
+            pControlWindow->connect_focus_out(LINK(this, CommonBehaviourControlHelper, LoseFocusHdl));
+            pControlWindow->connect_changed(LINK(this, OFileUrlControl, URLModifiedHdl));
         }
 
         virtual weld::Widget* getWidget() override { return getTypedControlWindow()->getWidget(); }


More information about the Libreoffice-commits mailing list