summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-12 15:43:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-12 20:54:15 +0200
commit0b05a04f978688aedce90e259a31873de82a2d2a (patch)
treec825911468c0647cace4a2a266f832ff8be757ba /svx
parentbcea211b66910ee6cf6a51e4baa950b3f897e310 (diff)
clarify what WantMouseEvent is for
and add tristate machine support that we also need WantMouseEvent is if the first click in a browse cell that activates it should be passed to the control that appears on click as if it was itself clicked on primarily for the the CheckBoxController to toggle it immediately. Rework to explicitly toggle the checkbox in that implementation rather than rely on passing fake mouse click/release/tracking events. seeing as the main dbaccess table design view doesn't auto-launch its listboxes on clicking in a cell, but the sub create index dialog does, drop the auto-launch in the index dialog to match the main table design rathern than add a feature to weld::ComboBox to auto-launch the popup for that one solitary case Change-Id: Ie3d3f2ecf55d3d5b0b02b85ca09a6ca64bb800e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98603 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridcell.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 67137720d18b..a813e7710a99 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1696,11 +1696,10 @@ void DbCheckBox::PaintFieldToCell(OutputDevice& rDev, const tools::Rectangle& rR
CheckBoxControl* pControl = static_cast<CheckBoxControl*>(m_pPainter.get());
lcl_setCheckBoxState( _rxField, pControl );
- auto nWidth = pControl->GetBox().get_preferred_size().Width();
- auto nHeight = pControl->GetBox().get_preferred_size().Height();
- tools::Rectangle aRect(Point(rRect.Left() + ((rRect.GetWidth() - nWidth) / 2),
- rRect.Top() + ((rRect.GetHeight() - nHeight) / 2)),
- Size(nWidth, nHeight));
+ Size aBoxSize = pControl->GetBox().get_preferred_size();
+ tools::Rectangle aRect(Point(rRect.Left() + ((rRect.GetWidth() - aBoxSize.Width()) / 2),
+ rRect.Top() + ((rRect.GetHeight() - aBoxSize.Height()) / 2)),
+ aBoxSize);
DbCellControl::PaintFieldToCell(rDev, aRect, _rxField, xFormatter);
}