[Libreoffice-commits] core.git: svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 12 14:01:10 UTC 2020
svx/source/fmcomp/gridcell.cxx | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 5c98c6a046ad6dd869f617f116aa110b4ff5cecd
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jul 11 21:02:39 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Jul 12 16:00:31 2020 +0200
center check/radio buttons
Change-Id: Icae25573c09861e44a42c54daaeeebfec706bd37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98595
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index f9e02176e525..d5633c10f4e3 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1698,8 +1698,16 @@ void DbCheckBox::PaintFieldToCell(OutputDevice& rDev, const tools::Rectangle& rR
const Reference< css::sdb::XColumn >& _rxField,
const Reference< XNumberFormatter >& xFormatter)
{
- lcl_setCheckBoxState( _rxField, static_cast<CheckBoxControl*>(m_pPainter.get()) );
- DbCellControl::PaintFieldToCell( rDev, rRect, _rxField, xFormatter );
+ 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));
+
+ DbCellControl::PaintFieldToCell(rDev, aRect, _rxField, xFormatter);
}
More information about the Libreoffice-commits
mailing list