summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-29 09:53:28 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-09-30 11:08:46 +0200
commit8082ff4ab592a63b3546f26b0e9a522fc7e4f8ba (patch)
treecf1d8240f6666ee99ec8f2a45d02ce1f775af341 /svx
parentbd4f890462701f9ab39f78429704d13c971fc776 (diff)
Related: tdf#144139 use the classic size calculation
Change-Id: Iac3f9fb9fd6f92f8b17b1f2822dbc9743528cea9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122800 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridcell.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 1fadc6709cfe..3e5796bb5fb6 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1718,10 +1718,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();