core.git: Branch 'distro/collabora/co-24.04' - include/vcl vcl/inc vcl/jsdialog vcl/source

2024-08-05 Thread Jaume Pujantell (via logerrit)
 include/vcl/toolkit/treelistbox.hxx  |1 +
 vcl/inc/jsdialog/jsdialogbuilder.hxx |5 +
 vcl/jsdialog/jsdialogbuilder.cxx |   20 
 vcl/source/treelist/svtabbx.cxx  |1 +
 vcl/source/treelist/treelistbox.cxx  |   12 
 5 files changed, 39 insertions(+)

New commits:
commit 2815d11bb608a933e14b799cc802825423426d28
Author: Jaume Pujantell 
AuthorDate: Tue Jul 30 16:45:31 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Aug 6 08:25:51 2024 +0200

cool#9704 calc jsdialog autofilter send disabled entry information

Added the code necessary to disable already filtered entries on
jsdialog autofilter, like it is done on desktop UI.

Change-Id: I095b7fe0054efcaff2717d05a2ab7bd1d8248b29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171246
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index ecbd489fd853..007c119c5257 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -561,6 +561,7 @@ public:
 
 voidSetCheckButtonState( SvTreeListEntry*, SvButtonState );
 SvButtonState   GetCheckButtonState( SvTreeListEntry* ) const;
+bool GetCheckButtonEnabled(SvTreeListEntry* pEntry) const;
 
 voidSetEntryText(SvTreeListEntry*, const OUString& );
 voidSetExpandedEntryBmp( SvTreeListEntry* _pEntry, const 
Image& _rImage );
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 58f8d431d258..0008f9f5fda9 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -771,6 +771,11 @@ public:
 virtual void set_toggle(int pos, TriState eState, int col = -1) override;
 virtual void set_toggle(const weld::TreeIter& rIter, TriState bOn, int col 
= -1) override;
 
+using SalInstanceTreeView::set_sensitive;
+/// pos is used differently here, it defines how many steps of iterator we 
need to perform to take entry
+virtual void set_sensitive(int pos, bool bSensitive, int col = -1) 
override;
+virtual void set_sensitive(const weld::TreeIter& rIter, bool bSensitive, 
int col = -1) override;
+
 using SalInstanceTreeView::select;
 /// pos is used differently here, it defines how many steps of iterator we 
need to perform to take entry
 virtual void select(int pos) override;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 7a38aff47873..d68a52b7e441 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -2060,6 +2060,26 @@ void JSTreeView::set_toggle(const weld::TreeIter& rIter, 
TriState bOn, int col)
 sendUpdate();
 }
 
+void JSTreeView::set_sensitive(int pos, bool bSensitive, int col)
+{
+SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, 0);
+
+while (pEntry && pos--)
+pEntry = m_xTreeView->Next(pEntry);
+
+if (pEntry)
+{
+SalInstanceTreeView::set_sensitive(pEntry, bSensitive, col);
+sendUpdate();
+}
+}
+
+void JSTreeView::set_sensitive(const weld::TreeIter& rIter, bool bSensitive, 
int col)
+{
+SalInstanceTreeView::set_sensitive(rIter, bSensitive, col);
+sendUpdate();
+}
+
 void JSTreeView::select(int pos)
 {
 assert(m_xTreeView->IsUpdateMode() && "don't select when frozen");
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index feb4f0b2011f..658584650e15 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -161,6 +161,7 @@ static void lcl_DumpEntryAndSiblings(tools::JsonWriter& 
rJsonWriter,
 rJsonWriter.put("state", false);
 else if (eCheckState == SvButtonState::Checked)
 rJsonWriter.put("state", true);
+rJsonWriter.put("enabled", 
pTabListBox->GetCheckButtonEnabled(pEntry));
 }
 
 if (pTabListBox->IsSelected(pEntry))
diff --git a/vcl/source/treelist/treelistbox.cxx 
b/vcl/source/treelist/treelistbox.cxx
index 6dd915e23996..67292505671f 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -1707,6 +1707,18 @@ SvButtonState SvTreeListBox::GetCheckButtonState( 
SvTreeListEntry* pEntry ) cons
 return eState;
 }
 
+bool SvTreeListBox::GetCheckButtonEnabled(SvTreeListEntry* pEntry) const
+{
+if (pEntry && (nTreeFlags & SvTreeFlags::CHKBTN))
+{
+SvLBoxButton* pItem
+= 
static_cast(pEntry->GetFirstItem(SvLBoxItemType::Button));
+if (pItem)
+return pItem->isEnable();
+}
+return false;
+}
+
 void SvTreeListBox::CheckButtonHdl()
 {
 if ( pCheckButtonData )


core.git: Branch 'distro/collabora/co-24.04' - include/vcl vcl/inc vcl/jsdialog vcl/source

2024-03-25 Thread Hubert Figuière (via logerrit)
 include/vcl/toolkit/prgsbar.hxx  |3 +++
 include/vcl/wintypes.hxx |3 ++-
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   10 ++
 vcl/inc/salvtables.hxx   |   19 +++
 vcl/jsdialog/jsdialogbuilder.cxx |   25 +
 vcl/source/app/salvtables.cxx|   19 ---
 vcl/source/control/prgsbar.cxx   |8 
 vcl/source/window/window.cxx |1 +
 8 files changed, 68 insertions(+), 20 deletions(-)

New commits:
commit 7586da84124f4aa73fd21081610de78d5d416fe6
Author: Hubert Figuière 
AuthorDate: Fri Mar 22 09:59:54 2024 -0400
Commit: Caolán McNamara 
CommitDate: Mon Mar 25 15:39:27 2024 +0100

vcl: Implement JSLevelBar

This fixes the JSDialog layout of the sheet protection dialog.
This was introduced for 24.02 to provide password strength indication
of the sheet password.

Defined a new WindowType of PROGRESSBAR.
The type property in JSDialog JSON will be "progressbar".

Change-Id: I202528a81706943e1838f3c37fb555f4a1bf889e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165168
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/toolkit/prgsbar.hxx b/include/vcl/toolkit/prgsbar.hxx
index 1fcba74fdaba..bced6fc9e259 100644
--- a/include/vcl/toolkit/prgsbar.hxx
+++ b/include/vcl/toolkit/prgsbar.hxx
@@ -73,6 +73,9 @@ private:
 SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool 
bForeground, bool bBackground );
 SAL_DLLPRIVATE void ImplDrawProgress(vcl::RenderContext& rRenderContext, 
sal_uInt16 nNewPerc);
 
+protected:
+virtual voidDumpAsPropertyTree(tools::JsonWriter&) override;
+
 public:
 ProgressBar( vcl::Window* pParent, WinBits nWinBits, 
BarStyle eBarStyle );
 
diff --git a/include/vcl/wintypes.hxx b/include/vcl/wintypes.hxx
index 644b2405cc2a..c025e83b0afe 100644
--- a/include/vcl/wintypes.hxx
+++ b/include/vcl/wintypes.hxx
@@ -98,7 +98,8 @@ enum class WindowType : sal_uInt16
 RULER,
 HEADERBAR,
 VERTICALTABCONTROL   ,
-LAST = VERTICALTABCONTROL,
+PROGRESSBAR  ,
+LAST = PROGRESSBAR,
 // only used in vclxtoolkit.cxx
 TOOLKIT_FRAMEWINDOW= 0x1000,
 TOOLKIT_SYSTEMCHILDWINDOW  = 0x1001,
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 066dcddfcfc8..3d98e7e61a19 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -311,6 +312,7 @@ public:
 virtual std::unique_ptr weld_box(const OUString& id) override;
 virtual std::unique_ptr weld_widget(const OUString& id) 
override;
 virtual std::unique_ptr weld_image(const OUString& id) 
override;
+virtual std::unique_ptr weld_level_bar(const OUString& id) 
override;
 virtual std::unique_ptr weld_calendar(const OUString& id) 
override;
 
 static weld::MessageDialog*
@@ -889,6 +891,14 @@ public:
 virtual void set_image(const css::uno::Reference& 
rImage) override;
 };
 
+class JSLevelBar : public JSWidget
+{
+public:
+JSLevelBar(JSDialogSender* pSender, ::ProgressBar* pProgressBar, 
SalInstanceBuilder* pBuilder,
+   bool bTakeOwnership);
+virtual void set_percentage(double fPercentage) override;
+};
+
 class JSCalendar : public JSWidget
 {
 public:
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 4074e097a4f4..46aa3da22b71 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2182,6 +2183,24 @@ public:
 virtual ~SalInstanceScrolledWindow() override;
 };
 
+class SalInstanceLevelBar : public SalInstanceWidget, public virtual 
weld::LevelBar
+{
+private:
+VclPtr<::ProgressBar> m_xLevelBar;
+
+public:
+SalInstanceLevelBar(::ProgressBar* pLevelBar, SalInstanceBuilder* 
pBuilder, bool bTakeOwnership)
+: SalInstanceWidget(pLevelBar, pBuilder, bTakeOwnership)
+, m_xLevelBar(pLevelBar)
+{
+}
+
+virtual void set_percentage(double fPercentage) override
+{
+m_xLevelBar->SetValue(static_cast(fPercentage));
+}
+};
+
 class SalInstanceCalendar : public SalInstanceWidget, public virtual 
weld::Calendar
 {
 private:
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 97675b6267c1..1704988084f1 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1269,6 +1269,19 @@ std::unique_ptr 
JSInstanceBuilder::weld_image(const OUString& id)
 return pWeldWidget;
 }
 
+std::unique_ptr JSInstanceBuilder::weld_level_bar(const 
OUString& id)
+{
+::ProgressBar* pLevelBar = m_xBuilder->get<::ProgressBar>(id);
+
+auto pWeldWidget
+= pLevelBar