diff options
-rw-r--r-- | include/vcl/layout.hxx | 23 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 22 |
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)) |