diff options
-rw-r--r-- | sw/source/core/crsr/FormFieldButton.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/inc/FormFieldButton.hxx | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/core/crsr/FormFieldButton.cxx b/sw/source/core/crsr/FormFieldButton.cxx index 43d8ff6e07e9..65412b3f558b 100644 --- a/sw/source/core/crsr/FormFieldButton.cxx +++ b/sw/source/core/crsr/FormFieldButton.cxx @@ -56,19 +56,18 @@ void FormFieldButton::CalcPosAndSize(const SwRect& rPortionPaintArea) } } -void FormFieldButton::MouseButtonUp(const MouseEvent&) +void FormFieldButton::MouseButtonDown(const MouseEvent&) { assert(GetParent()); - Point aPixPos = GetPosPixel(); - aPixPos.AdjustY(GetSizePixel().Height()); - // sets m_pFieldPopup InitPopup(); m_pFieldPopup->SetPopupModeEndHdl(LINK(this, DropDownFormFieldButton, FieldPopupModeEndHdl)); - tools::Rectangle aRect(GetParent()->OutputToScreenPixel(aPixPos), Size(0, 0)); + Size aSize = GetSizePixel(); + Point aPos(GetParent()->OutputToScreenPixel(GetPosPixel())); + tools::Rectangle aRect(aPos, aSize); m_pFieldPopup->StartPopupMode(aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus); Invalidate(); } diff --git a/sw/source/core/inc/FormFieldButton.hxx b/sw/source/core/inc/FormFieldButton.hxx index 265d0bafb713..93a7079651fb 100644 --- a/sw/source/core/inc/FormFieldButton.hxx +++ b/sw/source/core/inc/FormFieldButton.hxx @@ -32,7 +32,7 @@ public: void CalcPosAndSize(const SwRect& rPortionPaintArea); - virtual void MouseButtonUp(const MouseEvent& rMEvt) override; + virtual void MouseButtonDown(const MouseEvent& rMEvt) override; DECL_LINK(FieldPopupModeEndHdl, FloatingWindow*, void); virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; |