[Libreoffice-commits] core.git: svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 29 10:22:02 UTC 2021


 svx/source/fmcomp/gridcell.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 7d21e2bc4628138bf2617a5c672c0da8d4e9e96f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 29 09:53:28 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 29 12:21:28 2021 +0200

    Related: tdf#144139 use the classic size calculation
    
    Change-Id: Iac3f9fb9fd6f92f8b17b1f2822dbc9743528cea9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122799
    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 e19f3c486871..0fe549bf651b 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1719,10 +1719,16 @@ void DbCheckBox::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect)
             TriState eState = static_cast<CheckBoxControl*>(m_pWindow.get())->GetState();
 
             MapMode aResMapMode(MapUnit::Map100thMM);
+            Size aImageSize = rDev.LogicToPixel(Size(300, 300), aResMapMode);
             Size aBrd1Size = rDev.LogicToPixel(Size(20, 20), aResMapMode);
             Size aBrd2Size = rDev.LogicToPixel(Size(30, 30), aResMapMode);
             int nCheckWidth = rDev.LogicToPixel(Size(20, 20), aResMapMode).Width();
-            tools::Rectangle aStateRect(rRect);
+
+            tools::Rectangle aStateRect;
+            aStateRect.SetLeft(rRect.Left() + ((rRect.GetWidth() - aImageSize.Width()) / 2));
+            aStateRect.SetTop(rRect.Top() + ((rRect.GetHeight() - aImageSize.Height()) / 2));
+            aStateRect.SetRight(aStateRect.Left() + aImageSize.Width() - 1);
+            aStateRect.SetBottom(aStateRect.Top() + aImageSize.Height() - 1);
 
             rDev.Push();
             rDev.SetMapMode();


More information about the Libreoffice-commits mailing list