From b35f8f82b8e29f5877879f360b22bd291e21a3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 29 Jul 2020 16:40:36 +0100 Subject: [PATCH] center the filter checkbox like the normal one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7954430640fe9788c650f5fe7b103426731204cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99716 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/fmcomp/gridcell.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(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(m_pWindow.get())->get_widget().get_active_text(), nStyle); break;