summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-05 10:04:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-08-05 13:39:37 +0200
commit28ddcd59fab3c4994a5e4e94f05e21ad94664a76 (patch)
treed9e19a826864c37437ab5ae09feef6d225ecee98
parent423c177d58e04af027379159b856c9b817d56488 (diff)
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@redhat.com>
-rw-r--r--include/vcl/layout.hxx23
-rw-r--r--vcl/source/window/layout.cxx22
2 files changed, 24 insertions, 21 deletions
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))