[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/jsdialog vcl/source
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 23 08:35:46 UTC 2021
vcl/inc/jsdialog/jsdialogbuilder.hxx | 7 +++++++
vcl/inc/salvtables.hxx | 11 +++++++++++
vcl/jsdialog/jsdialogbuilder.cxx | 18 ++++++++++++++++++
vcl/source/app/salvtables.cxx | 31 +++++++++++++------------------
4 files changed, 49 insertions(+), 18 deletions(-)
New commits:
commit 6e6f8aab1eba3ce29516cc929e033c21fd1bf28e
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Aug 20 18:47:52 2021 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Aug 23 10:35:21 2021 +0200
jsdialog: weld Box
Change-Id: Ideb7b7ce8d7bf2e8494f053b13d662e19060b256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120792
Tested-by: Jenkins
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 8bfa06d0742b..55aa57d71888 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -274,6 +274,7 @@ public:
virtual std::unique_ptr<weld::Frame> weld_frame(const OString& id) override;
virtual std::unique_ptr<weld::MenuButton> weld_menu_button(const OString& id) override;
virtual std::unique_ptr<weld::Popover> weld_popover(const OString& id) override;
+ virtual std::unique_ptr<weld::Box> weld_box(const OString& id) override;
static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
VclMessageType eMessageType,
@@ -678,4 +679,10 @@ public:
bool bTakeOwnership);
};
+class JSBox : public JSWidget<SalInstanceBox, VclBox>
+{
+public:
+ JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 6f63067b6186..c54ea3491f8a 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1034,6 +1034,18 @@ std::unique_ptr<weld::Popover> JSInstanceBuilder::weld_popover(const OString& id
return pWeldWidget;
}
+std::unique_ptr<weld::Box> JSInstanceBuilder::weld_box(const OString& id)
+{
+ VclBox* pContainer = m_xBuilder->get<VclBox>(id);
+ auto pWeldWidget
+ = pContainer ? std::make_unique<JSBox>(this, pContainer, this, false) : nullptr;
+
+ if (pWeldWidget)
+ RememberWidget(id, pWeldWidget.get());
+
+ return pWeldWidget;
+}
+
weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent,
VclMessageType eMessageType,
VclButtonsType eButtonType,
@@ -1653,4 +1665,10 @@ JSPopover::JSPopover(JSDialogSender* pSender, DockingWindow* pDockingWindow,
{
}
+JSBox::JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder,
+ bool bTakeOwnership)
+ : JSWidget<SalInstanceBox, VclBox>(pSender, pBox, pBuilder, bTakeOwnership)
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
commit 63249db11f3caff233231d7201c2ea825dc1022e
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Aug 20 18:33:49 2021 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Aug 23 10:35:11 2021 +0200
Move SalInstanceBox decl to header
Change-Id: I945fdbb17caf417990d3531175328099f1a6c93f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120791
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 8c3e1a8aee5b..8c11e17c2ba2 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1901,4 +1901,15 @@ public:
virtual void popdown() override;
};
+class SalInstanceBox : public SalInstanceContainer, public virtual weld::Box
+{
+private:
+ VclPtr<VclBox> m_xBox;
+
+public:
+ SalInstanceBox(VclBox* pContainer, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+ virtual void reorder_child(weld::Widget* pWidget, int nNewPosition) override;
+ virtual void sort_native_button_order() override;
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index da17b8facb40..61eacb855af4 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1330,28 +1330,23 @@ void SalInstanceWidget::draw(OutputDevice& rOutput, const Point& rPos, const Siz
m_xWidget->SetSizePixel(aOrigSize);
}
-namespace
+SalInstanceBox::SalInstanceBox(VclBox* pContainer, SalInstanceBuilder* pBuilder,
+ bool bTakeOwnership)
+ : SalInstanceContainer(pContainer, pBuilder, bTakeOwnership)
+ , m_xBox(pContainer)
{
-class SalInstanceBox : public SalInstanceContainer, public virtual weld::Box
+}
+void SalInstanceBox::reorder_child(weld::Widget* pWidget, int nNewPosition)
{
-private:
- VclPtr<VclBox> m_xBox;
+ SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pWidget);
+ assert(pVclWidget);
+ pVclWidget->getWidget()->reorderWithinParent(nNewPosition);
+}
-public:
- SalInstanceBox(VclBox* pContainer, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
- : SalInstanceContainer(pContainer, pBuilder, bTakeOwnership)
- , m_xBox(pContainer)
- {
- }
- virtual void reorder_child(weld::Widget* pWidget, int nNewPosition) override
- {
- SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pWidget);
- assert(pVclWidget);
- pVclWidget->getWidget()->reorderWithinParent(nNewPosition);
- }
- virtual void sort_native_button_order() override { ::sort_native_button_order(*m_xBox); }
-};
+void SalInstanceBox::sort_native_button_order() { ::sort_native_button_order(*m_xBox); }
+namespace
+{
void CollectChildren(const vcl::Window& rCurrent, const basegfx::B2IPoint& rTopLeft,
weld::ScreenShotCollection& rControlDataCollection)
{
More information about the Libreoffice-commits
mailing list