diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2023-02-27 13:49:10 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-28 07:15:07 +0000 |
commit | dbd96e1c9a066979cb80ced6268edb148a8fc73b (patch) | |
tree | 9fe962b54cb4f04dc36481560057e10c504e33e2 /basctl | |
parent | d25567e7e2fb96242b9bd4aca44df6f0287c2aa3 (diff) |
tdf#153798 - Basic IDE: align line numbers to the right
Change-Id: I6a8335b51aa7d4b50577aeefb188e3d81ddfee03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147892
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/linenumberwindow.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx index 74ead4923863..9f5e85c72102 100644 --- a/basctl/source/basicide/linenumberwindow.cxx +++ b/basctl/source/basicide/linenumberwindow.cxx @@ -79,7 +79,13 @@ void LineNumberWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Re sal_Int64 y = (nStartLine - 1) * static_cast<sal_Int64>(nLineHeight); rRenderContext.SetTextColor(m_FontColor); for (sal_uInt32 n = nStartLine; n <= nEndLine; ++n, y += nLineHeight) - rRenderContext.DrawText(Point(0, y - m_nCurYOffset), OUString::number(n)); + { + const OUString aLineNumber = OUString::number(n); + // tdf#153798 - align line numbers to the right + rRenderContext.DrawText( + Point(m_nWidth - GetTextWidth(aLineNumber) - m_nBaseWidth / 2, y - m_nCurYOffset), + aLineNumber); + } // Resize the parent after calculating the new width and height values GetParent()->Resize(); |