[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/inc vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 15 08:08:32 UTC 2020
vcl/inc/jsdialog/jsdialogbuilder.hxx | 17 ++++++++++++++
vcl/inc/salvtables.hxx | 2 -
vcl/jsdialog/jsdialogbuilder.cxx | 42 ++++++++++++++++++++++++++++++++++-
3 files changed, 59 insertions(+), 2 deletions(-)
New commits:
commit 10eb738689fbd9b49a59ae0cd446e42d51061b35
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 4 16:05:10 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri May 15 10:08:01 2020 +0200
jsdialog: refresh on notebook changes
Change-Id: I81159d043add3d8bdd1b81f26f642f99c1430f73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94183
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 24b1ef7808c1..0104756b7b55 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -37,6 +37,8 @@ public:
bool bTakeOwnership = false) override;
virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id,
bool bTakeOwnership = false) override;
+ virtual std::unique_ptr<weld::Notebook> weld_notebook(const OString& id,
+ bool bTakeOwnership = false) override;
};
template <class BaseInstanceClass, class VclClass>
@@ -113,4 +115,19 @@ public:
virtual void set_entry_text(const OUString& rText) override;
};
+class VCL_DLLPUBLIC JSNotebook : public JSWidget<SalInstanceNotebook, ::TabControl>
+{
+public:
+ JSNotebook(VclPtr<vcl::Window> aOwnedToplevel, ::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 append_page(const OString& rIdent, const OUString& rLabel) override;
+};
+
#endif
\ No newline at end of file
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 977f8e343c99..0fb282d385c7 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -700,7 +700,7 @@ class SalInstanceNotebook : public SalInstanceContainer, public virtual weld::No
{
private:
VclPtr<TabControl> m_xNotebook;
- mutable std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages;
+ mutable std::vector<std::shared_ptr<SalInstanceContainer>> m_aPages;
std::vector<VclPtr<TabPage>> m_aAddedPages;
std::vector<VclPtr<VclGrid>> m_aAddedGrids;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 2d104e424bd9..64f78c295bed 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -68,7 +68,7 @@ std::unique_ptr<weld::Label> JSInstanceBuilder::weld_label(const OString& id, bo
std::unique_ptr<weld::Button> JSInstanceBuilder::weld_button(const OString& id, bool bTakeOwnership)
{
::Button* pButton = m_xBuilder->get<::Button>(id);
- return pButton ? o3tl::make_unique<JSButton>(m_aOwnedToplevel, pButton, this, bTakeOwnership)
+ return pButton ? std::make_unique<JSButton>(m_aOwnedToplevel, pButton, this, bTakeOwnership)
: nullptr;
}
@@ -91,6 +91,15 @@ std::unique_ptr<weld::ComboBox> JSInstanceBuilder::weld_combo_box(const OString&
: nullptr;
}
+std::unique_ptr<weld::Notebook> JSInstanceBuilder::weld_notebook(const OString& id,
+ bool bTakeOwnership)
+{
+ TabControl* pNotebook = m_xBuilder->get<TabControl>(id);
+ return pNotebook
+ ? std::make_unique<JSNotebook>(m_aOwnedToplevel, pNotebook, this, bTakeOwnership)
+ : nullptr;
+}
+
JSLabel::JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
: JSWidget<SalInstanceLabel, FixedText>(aOwnedToplevel, pLabel, pBuilder, bTakeOwnership)
@@ -166,3 +175,34 @@ void JSComboBox::set_entry_text(const OUString& rText)
SalInstanceComboBoxWithEdit::set_entry_text(rText);
notifyDialogState();
}
+
+JSNotebook::JSNotebook(VclPtr<vcl::Window> aOwnedToplevel, ::TabControl* pControl,
+ SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+ : JSWidget<SalInstanceNotebook, ::TabControl>(aOwnedToplevel, pControl, pBuilder,
+ bTakeOwnership)
+{
+}
+
+void JSNotebook::set_current_page(int nPage)
+{
+ SalInstanceNotebook::set_current_page(nPage);
+ notifyDialogState();
+}
+
+void JSNotebook::set_current_page(const OString& rIdent)
+{
+ SalInstanceNotebook::set_current_page(rIdent);
+ notifyDialogState();
+}
+
+void JSNotebook::remove_page(const OString& rIdent)
+{
+ SalInstanceNotebook::remove_page(rIdent);
+ notifyDialogState();
+}
+
+void JSNotebook::append_page(const OString& rIdent, const OUString& rLabel)
+{
+ SalInstanceNotebook::append_page(rIdent, rLabel);
+ notifyDialogState();
+}
More information about the Libreoffice-commits
mailing list