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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 5 11:40:13 UTC 2021


 include/vcl/layout.hxx       |   23 ++---------------------
 vcl/source/window/layout.cxx |   22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 21 deletions(-)

New commits:
commit 28ddcd59fab3c4994a5e4e94f05e21ad94664a76
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Aug 5 10:04:26 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Aug 5 13:39:37 2021 +0200

    move RequestHelp into layout.cxx
    
    Change-Id: I6b0642a77ffd247f9a77d5a4bdd0b593025a7797
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120066
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index eb07ba5b33c4..7f3f37a479fa 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -13,7 +13,6 @@
 #include <config_options.h>
 #include <vcl/dllapi.h>
 #include <vcl/ctrl.hxx>
-#include <vcl/help.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
 #include <vcl/settings.hxx>
@@ -24,6 +23,7 @@
 #include <vcl/commandevent.hxx>
 #include <set>
 
+class HelpEvent;
 class ScrollBar;
 class ScrollBarBox;
 class Splitter;
@@ -686,26 +686,7 @@ private:
             return;
         Control::Command(rEvent);
     }
-    virtual void RequestHelp(const HelpEvent& rHelpEvent) override
-    {
-        if (rHelpEvent.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON))
-        {
-            Point aPos(ScreenToOutputPixel(rHelpEvent.GetMousePosPixel()));
-            tools::Rectangle aHelpArea(aPos.X(), aPos.Y());
-            OUString sHelpTip = m_aQueryTooltipHdl.Call(aHelpArea);
-            if (sHelpTip.isEmpty())
-                return;
-            Point aPt = OutputToScreenPixel(aHelpArea.TopLeft());
-            aHelpArea.SetLeft(aPt.X());
-            aHelpArea.SetTop(aPt.Y());
-            aPt = OutputToScreenPixel(aHelpArea.BottomRight());
-            aHelpArea.SetRight(aPt.X());
-            aHelpArea.SetBottom(aPt.Y());
-            // tdf#125369 recover newline support of tdf#101779
-            QuickHelpFlags eHelpWinStyle = sHelpTip.indexOf('\n') != -1 ? QuickHelpFlags::TipStyleBalloon : QuickHelpFlags::NONE;
-            Help::ShowQuickHelp(this, aHelpArea, sHelpTip, eHelpWinStyle);
-        }
-    }
+    virtual void RequestHelp(const HelpEvent& rHelpEvent) override;
     virtual void StartDrag(sal_Int8 nAction, const Point& rPosPixel) override;
     virtual FactoryFunction GetUITestFactory() const override;
 
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 3f70e767e344..6ce711bea1aa 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -17,6 +17,7 @@
 #include <vcl/toolkit/button.hxx>
 #include <vcl/cvtgrf.hxx>
 #include <vcl/decoview.hxx>
+#include <vcl/help.hxx>
 #include <vcl/toolkit/dialog.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/scrbar.hxx>
@@ -2888,6 +2889,27 @@ bool isLayoutEnabled(const vcl::Window *pWindow)
     return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(GetWindowType::Next);
 }
 
+void VclDrawingArea::RequestHelp(const HelpEvent& rHelpEvent)
+{
+    if (rHelpEvent.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON))
+    {
+        Point aPos(ScreenToOutputPixel(rHelpEvent.GetMousePosPixel()));
+        tools::Rectangle aHelpArea(aPos.X(), aPos.Y());
+        OUString sHelpTip = m_aQueryTooltipHdl.Call(aHelpArea);
+        if (sHelpTip.isEmpty())
+            return;
+        Point aPt = OutputToScreenPixel(aHelpArea.TopLeft());
+        aHelpArea.SetLeft(aPt.X());
+        aHelpArea.SetTop(aPt.Y());
+        aPt = OutputToScreenPixel(aHelpArea.BottomRight());
+        aHelpArea.SetRight(aPt.X());
+        aHelpArea.SetBottom(aPt.Y());
+        // tdf#125369 recover newline support of tdf#101779
+        QuickHelpFlags eHelpWinStyle = sHelpTip.indexOf('\n') != -1 ? QuickHelpFlags::TipStyleBalloon : QuickHelpFlags::NONE;
+        Help::ShowQuickHelp(this, aHelpArea, sHelpTip, eHelpWinStyle);
+    }
+}
+
 void VclDrawingArea::StartDrag(sal_Int8, const Point&)
 {
     if (m_aStartDragHdl.Call(this))


More information about the Libreoffice-commits mailing list