diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
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); } |