[Libreoffice-commits] core.git: cui/source
Muhammet Kara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jun 9 20:43:07 UTC 2019
cui/source/tabpages/numfmt.cxx | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
New commits:
commit 0d35f8f673ac4e6aa3f1e5f1edc0c6c7a45d2f95
Author: Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Sun Jun 9 22:17:32 2019 +0300
Commit: Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Sun Jun 9 22:41:58 2019 +0200
Fix logic error and simplify. Related: tdf#122120
To bring back centering of the preview
on the Format Cells dialog.
Change-Id: I2bf1e1dc5cb722c742713d3b245d2b6714976527
Reviewed-on: https://gerrit.libreoffice.org/73740
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 6f2b605d8be8..282a50460693 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -167,16 +167,13 @@ void SvxNumberPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools::
aTmpStr = aTmpStr.replaceAt(mnPos, 0, OUString(mnChar));
}
}
- long nX;
- if (mnPos != -1)
- nX = 0;
- else
+
+ long nX = 0;
+ if (mnPos == -1 && nLeadSpace > 0) //tdf#122120 if it won't fit anyway, then left align it
{
- //tdf#122120 if it won't fit anyway, then left align it
- if (nLeadSpace > 0)
- nX = nLeadSpace;
- nX = 0;
+ nX = nLeadSpace;
}
+
Point aPosText = Point(nX, (aSzWnd.Height() - GetTextHeight()) / 2);
rRenderContext.DrawText(aPosText, aTmpStr);
rRenderContext.Pop();
More information about the Libreoffice-commits
mailing list