[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 3 13:24:39 UTC 2020


 sw/source/core/crsr/FormFieldButton.cxx |   11 ++++++++---
 sw/source/core/inc/FormFieldButton.hxx  |    9 +++------
 2 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit a16d2f95783839d54b3c0b2d4c88f96ad3afa404
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 3 11:13:54 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 3 14:23:58 2020 +0100

    inherit FormFieldButton from Control
    
    instead of MenuButton, it overrides the parts of MenuButton that
    make it a MenuButton
    
    Change-Id: Id2317ec09dd0f8084efe341b1091787c36d51f12
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107157
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/crsr/FormFieldButton.cxx b/sw/source/core/crsr/FormFieldButton.cxx
index 65412b3f558b..8ae84826a3f9 100644
--- a/sw/source/core/crsr/FormFieldButton.cxx
+++ b/sw/source/core/crsr/FormFieldButton.cxx
@@ -15,11 +15,16 @@
 #include <vcl/event.hxx>
 
 FormFieldButton::FormFieldButton(SwEditWin* pEditWin, sw::mark::Fieldmark& rFieldmark)
-    : MenuButton(pEditWin, WB_DIALOGCONTROL)
+    : Control(pEditWin, WB_DIALOGCONTROL)
     , m_rFieldmark(rFieldmark)
 {
     assert(GetParent());
     assert(dynamic_cast<SwEditWin*>(GetParent()));
+
+    SetBackground();
+    EnableChildTransparentMode();
+    SetParentClipMode(ParentClipMode::NoClip);
+    SetPaintTransparent(true);
 }
 
 FormFieldButton::~FormFieldButton() { disposeOnce(); }
@@ -27,7 +32,7 @@ FormFieldButton::~FormFieldButton() { disposeOnce(); }
 void FormFieldButton::dispose()
 {
     m_pFieldPopup.disposeAndClear();
-    MenuButton::dispose();
+    Control::dispose();
 }
 
 void FormFieldButton::CalcPosAndSize(const SwRect& rPortionPaintArea)
@@ -137,7 +142,7 @@ void FormFieldButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
 WindowHitTest FormFieldButton::ImplHitTest(const Point& rFramePos)
 {
     // We need to check whether the position hits the button (the frame should be mouse transparent)
-    WindowHitTest aResult = MenuButton::ImplHitTest(rFramePos);
+    WindowHitTest aResult = Control::ImplHitTest(rFramePos);
     if (aResult != WindowHitTest::Inside)
         return aResult;
     else
diff --git a/sw/source/core/inc/FormFieldButton.hxx b/sw/source/core/inc/FormFieldButton.hxx
index 93a7079651fb..4dec3b752d13 100644
--- a/sw/source/core/inc/FormFieldButton.hxx
+++ b/sw/source/core/inc/FormFieldButton.hxx
@@ -7,10 +7,9 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SW_SOURCE_CORE_TEXT_FORMEFIELDBUTTO_HXX
-#define INCLUDED_SW_SOURCE_CORE_TEXT_FORMEFIELDBUTTO_HXX
+#pragma once
 
-#include <vcl/menubtn.hxx>
+#include <vcl/ctrl.hxx>
 #include <swrect.hxx>
 
 class SwEditWin;
@@ -23,7 +22,7 @@ class Fieldmark;
 /**
  * This button is shown when the cursor is on a form field with drop-down capability.
  */
-class FormFieldButton : public MenuButton
+class FormFieldButton : public Control
 {
 public:
     FormFieldButton(SwEditWin* pEditWin, sw::mark::Fieldmark& rFieldMark);
@@ -48,6 +47,4 @@ protected:
     VclPtr<FloatingWindow> m_pFieldPopup;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list