[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/inc vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 4 12:02:27 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |    5 +++--
 vcl/jsdialog/jsdialogbuilder.cxx     |   27 ++++++++++++++-------------
 2 files changed, 17 insertions(+), 15 deletions(-)

New commits:
commit 9197a43ac2e247c9688e9372d0446871876cbb14
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 29 09:03:14 2020 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Feb 4 13:01:49 2021 +0100

    jsdialog: direct updates for treeview
    
    We should use only weld:: interfaces methods
    to detect moment of control's updates as all
    the modifications goes through weld:: API.
    Let's use higher abstraction layer and not use
    vcl implementation details.
    
    this reverts partially: 32bfa0e1c7e859aedc3988d5bfdf86f5d7bab98a
    
    Change-Id: I2dd25c08dae3f5a95d077e2715788d636be47fe4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108433
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109605
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index eec95e714d64..61447cdeaf2f 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -389,8 +389,6 @@ public:
 
 class JSTreeView : public JSWidget<SalInstanceTreeView, ::SvTabListBox>
 {
-    DECL_LINK(on_window_event, VclWindowEvent&, void);
-
 public:
     JSTreeView(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
                ::SvTabListBox* pTextView, SalInstanceBuilder* pBuilder, bool bTakeOwnership,
@@ -415,6 +413,9 @@ public:
     virtual void set_text(int row, const OUString& rText, int col = -1) override;
     virtual void set_text(const weld::TreeIter& rIter, const OUString& rStr, int col = -1) override;
 
+    virtual void expand_row(const weld::TreeIter& rIter) override;
+    virtual void collapse_row(const weld::TreeIter& rIter) override;
+
     void drag_start();
     void drag_end();
 };
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 9829ca49d9ae..2282342239a3 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1044,8 +1044,6 @@ JSTreeView::JSTreeView(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window>
     : JSWidget<SalInstanceTreeView, ::SvTabListBox>(aNotifierWindow, aContentWindow, pTreeView,
                                                     pBuilder, bTakeOwnership, sTypeOfJSON)
 {
-    if (aNotifierWindow && aNotifierWindow->IsDisableIdleNotify())
-        pTreeView->AddEventListener(LINK(this, JSTreeView, on_window_event));
 }
 
 void JSTreeView::set_toggle(int pos, TriState eState, int col)
@@ -1060,7 +1058,7 @@ void JSTreeView::set_toggle(int pos, TriState eState, int col)
         SalInstanceTreeView::set_toggle(pEntry, eState, col);
         signal_toggled(iter_col(SalInstanceTreeIter(pEntry), col));
 
-        notifyDialogState();
+        sendUpdate(m_xTreeView);
     }
 }
 
@@ -1106,7 +1104,7 @@ void JSTreeView::drag_end()
 
         m_xDropTarget->fire_drop(aEvent);
 
-        notifyDialogState();
+        sendUpdate(m_xTreeView);
     }
 
     g_DragSource = nullptr;
@@ -1120,28 +1118,31 @@ void JSTreeView::insert(const weld::TreeIter* pParent, int pos, const OUString*
     SalInstanceTreeView::insert(pParent, pos, pStr, pId, pIconName, pImageSurface, pExpanderName,
                                 bChildrenOnDemand, pRet);
 
-    notifyDialogState();
+    sendUpdate(m_xTreeView);
 }
 
 void JSTreeView::set_text(int row, const OUString& rText, int col)
 {
     SalInstanceTreeView::set_text(row, rText, col);
-    notifyDialogState();
+    sendUpdate(m_xTreeView);
 }
 
 void JSTreeView::set_text(const weld::TreeIter& rIter, const OUString& rStr, int col)
 {
     SalInstanceTreeView::set_text(rIter, rStr, col);
-    notifyDialogState();
+    sendUpdate(m_xTreeView);
 }
 
-IMPL_LINK(JSTreeView, on_window_event, VclWindowEvent&, rEvent, void)
+void JSTreeView::expand_row(const weld::TreeIter& rIter)
 {
-    if (rEvent.GetId() == VclEventId::WindowPaint && get_visible() && m_xTreeView->IsDirtyModel())
-    {
-        sendUpdate(m_xTreeView);
-        m_xTreeView->SetDirtyModel(false);
-    }
+    SalInstanceTreeView::expand_row(rIter);
+    sendUpdate(m_xTreeView);
+}
+
+void JSTreeView::collapse_row(const weld::TreeIter& rIter)
+{
+    SalInstanceTreeView::collapse_row(rIter);
+    sendUpdate(m_xTreeView);
 }
 
 JSExpander::JSExpander(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,


More information about the Libreoffice-commits mailing list