diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-29 16:40:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-29 21:29:51 +0200 |
commit | b35f8f82b8e29f5877879f360b22bd291e21a3cc (patch) | |
tree | 5ea60c733f0828306879ec787cc50aa8e0d66bc5 /svx | |
parent | d314ee8ffc3060927f119d83358e062da7f3d604 (diff) |
center the filter checkbox like the normal one
Change-Id: I7954430640fe9788c650f5fe7b103426731204cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99716
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 326188c81463..21323cd9ad48 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -2630,8 +2630,17 @@ void DbFilterField::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect) switch (m_nControlClass) { case FormComponentType::CHECKBOX: - DbCellControl::PaintCell( rDev, rRect ); + { + // center the checkbox within the space available + CheckBoxControl* pControl = static_cast<CheckBoxControl*>(m_pPainter.get()); + 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::PaintCell(rDev, aRect); break; + } case FormComponentType::LISTBOX: rDev.DrawText(rRect, static_cast<ListBoxControl*>(m_pWindow.get())->get_widget().get_active_text(), nStyle); break; |