include/vcl/layout.hxx               |    1 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   22 ----------------
 vcl/jsdialog/jsdialogbuilder.cxx     |   40 -----------------------------
 vcl/source/window/layout.cxx         |   47 +++++++++++++++++++++++++++++++++++
 4 files changed, 48 insertions(+), 62 deletions(-)

New commits:
commit 8f0a337afd8cf40a74e6668b4441903a1b49f4ae
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Mar 9 15:43:15 2023 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Mar 21 09:35:41 2023 +0000

    jsdialog: dump properties of scrolled window
    
    Change-Id: Id6d072e951efec4c1de7641c94017c82840fa50b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148609
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149190
    Tested-by: Jenkins

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 2296f8097a4a..f5090b24eac2 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -498,6 +498,7 @@ public:
     //to override it
     void setUserManagedScrolling(bool bUserManagedScrolling) { 
m_bUserManagedScrolling = bUserManagedScrolling;}
     void doSetAllocation(const Size &rAllocation, bool bRetryOnFailure);
+    virtual void DumpAsPropertyTree(::tools::JsonWriter& rJsonWriter) override;
 private:
     virtual Size calculateRequisition() const override;
     virtual void setAllocation(const Size &rAllocation) override;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 039cb2690a9d..c77a4a0d30e1 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2167,6 +2167,53 @@ void VclScrolledWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::R
                 nBorderWidth << " is larger than expected " << m_nBorderWidth);
 }
 
+namespace {
+void lcl_dumpScrollbar(::tools::JsonWriter& rJsonWriter, ScrollBar& rScrollBar)
+{
+    rJsonWriter.put("lower", rScrollBar.GetRangeMin());
+    rJsonWriter.put("upper", rScrollBar.GetRangeMax());
+    rJsonWriter.put("step_increment", rScrollBar.GetLineSize());
+    rJsonWriter.put("page_increment", rScrollBar.GetPageSize());
+    rJsonWriter.put("value", rScrollBar.GetThumbPos());
+    rJsonWriter.put("page_size", rScrollBar.GetVisibleSize());
+}
+};
+
+void VclScrolledWindow::DumpAsPropertyTree(::tools::JsonWriter& rJsonWriter)
+{
+    VclBin::DumpAsPropertyTree(rJsonWriter);
+
+    {
+        auto aVertical = rJsonWriter.startNode("vertical");
+
+        ScrollBar& rScrollBar = getVertScrollBar();
+        lcl_dumpScrollbar(rJsonWriter, rScrollBar);
+
+        WinBits nWinBits = GetStyle();
+        if (nWinBits & WB_VSCROLL)
+            rJsonWriter.put("policy", "always");
+        else if (nWinBits & WB_AUTOVSCROLL)
+            rJsonWriter.put("policy", "auto");
+        else
+            rJsonWriter.put("policy", "never");
+    }
+
+    {
+        auto aHorizontal = rJsonWriter.startNode("horizontal");
+
+        ScrollBar& rScrollBar = getHorzScrollBar();
+        lcl_dumpScrollbar(rJsonWriter, rScrollBar);
+
+        WinBits nWinBits = GetStyle();
+        if (nWinBits & WB_HSCROLL)
+            rJsonWriter.put("policy", "always");
+        else if (nWinBits & WB_AUTOHSCROLL)
+            rJsonWriter.put("policy", "auto");
+        else
+            rJsonWriter.put("policy", "never");
+    }
+}
+
 void VclViewport::setAllocation(const Size &rAllocation)
 {
     vcl::Window *pChild = get_child();
commit 103e656e4f9e073354dc6a683889fd3fb922ecf2
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Mar 7 13:09:20 2023 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Mar 21 09:35:30 2023 +0000

    jsdialog: don't send full updates on tab change
    
    All tabs are now sent with the first full message.
    So client can switch between tabs by showing another
    tabpage content. We don't need to send structure again.
    
    Change-Id: I0f3dfc8be4816fba5813a83b41722407631edb73
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148421
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149189
    Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 0864c3d7ab8a..19458a938c02 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -575,34 +575,12 @@ public:
 
 class JSNotebook final : public JSWidget<SalInstanceNotebook, ::TabControl>
 {
-    Link<const OString&, bool> m_aLeavePageOverridenHdl;
-    Link<const OString&, void> m_aEnterPageOverridenHdl;
-
-    DECL_LINK(LeaveHdl, const OString&, bool);
-    DECL_LINK(EnterHdl, const OString&, bool);
-
 public:
     JSNotebook(JSDialogSender* pSender, ::TabControl* pControl, 
SalInstanceBuilder* pBuilder,
                bool bTakeOwnership);
 
-    virtual void set_current_page(int nPage) override;
-
-    virtual void set_current_page(const OString& rIdent) override;
-
     virtual void remove_page(const OString& rIdent) override;
-
     virtual void insert_page(const OString& rIdent, const OUString& rLabel, 
int nPos) override;
-
-    void connect_leave_page(const Link<const OString&, bool>& rLink)
-    {
-        m_aLeavePageHdl = LINK(this, JSNotebook, LeaveHdl);
-        m_aLeavePageOverridenHdl = rLink;
-    }
-    void connect_enter_page(const Link<const OString&, void>& rLink)
-    {
-        m_aLeavePageHdl = LINK(this, JSNotebook, EnterHdl);
-        m_aEnterPageOverridenHdl = rLink;
-    }
 };
 
 class JSSpinButton final : public JSWidget<SalInstanceSpinButton, 
::FormattedField>
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 190f1e0770c7..2d73c26613da 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1502,52 +1502,12 @@ void JSComboBox::set_active(int pos)
 
 bool JSComboBox::changed_by_direct_pick() const { return true; }
 
-IMPL_LINK(JSNotebook, LeaveHdl, const OString&, rPage, bool)
-{
-    m_aLeavePageOverridenHdl.Call(rPage);
-    sendFullUpdate();
-    return true;
-}
-
-IMPL_LINK(JSNotebook, EnterHdl, const OString&, rPage, bool)
-{
-    m_aEnterPageOverridenHdl.Call(rPage);
-    sendFullUpdate();
-    return true;
-}
-
 JSNotebook::JSNotebook(JSDialogSender* pSender, ::TabControl* pControl,
                        SalInstanceBuilder* pBuilder, bool bTakeOwnership)
     : JSWidget<SalInstanceNotebook, ::TabControl>(pSender, pControl, pBuilder, 
bTakeOwnership)
 {
 }
 
-void JSNotebook::set_current_page(int nPage)
-{
-    bool bForce = false;
-    int nCurrent = get_current_page();
-    if (nCurrent == nPage)
-        bForce = true;
-
-    SalInstanceNotebook::set_current_page(nPage);
-    sendFullUpdate(bForce);
-
-    m_aEnterPageHdl.Call(get_current_page_ident());
-}
-
-void JSNotebook::set_current_page(const OString& rIdent)
-{
-    bool bForce = false;
-    OString sCurrent = get_current_page_ident();
-    if (sCurrent == rIdent)
-        bForce = true;
-
-    SalInstanceNotebook::set_current_page(rIdent);
-    sendFullUpdate(bForce);
-
-    m_aEnterPageHdl.Call(get_current_page_ident());
-}
-
 void JSNotebook::remove_page(const OString& rIdent)
 {
     SalInstanceNotebook::remove_page(rIdent);

Reply via email to