[Libreoffice-commits] core.git: vcl/inc vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 28 09:58:46 UTC 2021


 vcl/inc/salvtables.hxx        |   17 +++++++++
 vcl/source/app/salvtables.cxx |   79 ++++++++++++++++++------------------------
 2 files changed, 51 insertions(+), 45 deletions(-)

New commits:
commit 10926dd227d366b25bf79cffcbf8628355be250c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jun 16 20:01:32 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jul 28 11:58:04 2021 +0200

    Move SalInstancePopover decl to header file
    
    Change-Id: I58d021d3e4a3f5d4b8b805380526c1d32b782674
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117345
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119563
    Tested-by: Jenkins

diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 74d8179ea356..3d5dc97a3a31 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1884,4 +1884,21 @@ public:
     virtual ~SalInstanceMenuButton() override;
 };
 
+class SalInstancePopover : public SalInstanceContainer, public virtual weld::Popover
+{
+private:
+    VclPtr<DockingWindow> m_xPopover;
+
+    DECL_LINK(PopupModeEndHdl, FloatingWindow*, void);
+
+public:
+    SalInstancePopover(DockingWindow* pPopover, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+
+    ~SalInstancePopover();
+
+    virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) override;
+
+    virtual void popdown() 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 2dd874c97843..3abcd7ad5ecb 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6638,54 +6638,43 @@ IMPL_LINK(SalInstanceEntryTreeView, AutocompleteHdl, Edit&, rEdit, void)
     }
 }
 
-namespace
-{
-class SalInstancePopover : public SalInstanceContainer, public virtual weld::Popover
+SalInstancePopover::SalInstancePopover(DockingWindow* pPopover, SalInstanceBuilder* pBuilder,
+                                       bool bTakeOwnership)
+    : SalInstanceContainer(pPopover, pBuilder, bTakeOwnership)
+    , m_xPopover(pPopover)
 {
-private:
-    VclPtr<DockingWindow> m_xPopover;
-
-    DECL_LINK(PopupModeEndHdl, FloatingWindow*, void);
-
-public:
-    SalInstancePopover(DockingWindow* pPopover, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
-        : SalInstanceContainer(pPopover, pBuilder, bTakeOwnership)
-        , m_xPopover(pPopover)
-    {
-    }
-
-    ~SalInstancePopover() { signal_closed(); }
-
-    virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) override
-    {
-        SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pParent);
-        assert(pVclWidget);
-        vcl::Window* pWidget = pVclWidget->getWidget();
-
-        tools::Rectangle aRect;
-        Point aPt = pWidget->OutputToScreenPixel(rRect.TopLeft());
-        aRect.SetLeft(aPt.X());
-        aRect.SetTop(aPt.Y());
-        aPt = pWidget->OutputToScreenPixel(rRect.BottomRight());
-        aRect.SetRight(aPt.X());
-        aRect.SetBottom(aPt.Y());
+}
 
-        FloatWinPopupFlags nFlags = FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus
-                                    | FloatWinPopupFlags::NoMouseUpClose;
-        m_xPopover->EnableDocking();
-        DockingManager* pDockingManager = vcl::Window::GetDockingManager();
-        pDockingManager->SetPopupModeEndHdl(m_xPopover,
-                                            LINK(this, SalInstancePopover, PopupModeEndHdl));
-        pDockingManager->StartPopupMode(m_xPopover, aRect, nFlags);
-    }
+SalInstancePopover::~SalInstancePopover() { signal_closed(); }
 
-    virtual void popdown() override
-    {
-        vcl::Window::GetDockingManager()->EndPopupMode(m_xPopover);
-        m_xPopover->EnableDocking(false);
-        signal_closed();
-    }
-};
+void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect)
+{
+    SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pParent);
+    assert(pVclWidget);
+    vcl::Window* pWidget = pVclWidget->getWidget();
+
+    tools::Rectangle aRect;
+    Point aPt = pWidget->OutputToScreenPixel(rRect.TopLeft());
+    aRect.SetLeft(aPt.X());
+    aRect.SetTop(aPt.Y());
+    aPt = pWidget->OutputToScreenPixel(rRect.BottomRight());
+    aRect.SetRight(aPt.X());
+    aRect.SetBottom(aPt.Y());
+
+    FloatWinPopupFlags nFlags = FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus
+                                | FloatWinPopupFlags::NoMouseUpClose;
+    m_xPopover->EnableDocking();
+    DockingManager* pDockingManager = vcl::Window::GetDockingManager();
+    pDockingManager->SetPopupModeEndHdl(m_xPopover,
+                                        LINK(this, SalInstancePopover, PopupModeEndHdl));
+    pDockingManager->StartPopupMode(m_xPopover, aRect, nFlags);
+}
+
+void SalInstancePopover::popdown()
+{
+    vcl::Window::GetDockingManager()->EndPopupMode(m_xPopover);
+    m_xPopover->EnableDocking(false);
+    signal_closed();
 }
 
 IMPL_LINK_NOARG(SalInstancePopover, PopupModeEndHdl, FloatingWindow*, void) { signal_closed(); }


More information about the Libreoffice-commits mailing list