summaryrefslogtreecommitdiffstats
path: root/basctl/source/basicide/linenumberwindow.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-25 15:55:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-26 09:51:11 +0100
commitca79c018f1e8bd0e1f42e3cef4b4f5893ef2e47f (patch)
treec39795bf83ca2da0664884c36c383f455a3a103d /basctl/source/basicide/linenumberwindow.cxx
parentResolves tdf#127508 - Flat table header in Calc (diff)
downloadcore-ca79c018f1e8bd0e1f42e3cef4b4f5893ef2e47f.tar.gz
core-ca79c018f1e8bd0e1f42e3cef4b4f5893ef2e47f.zip
tdf#130925 use the maximum document line number for the width calculation
not the max line number in the range currently getting rendered Change-Id: I447e4152ef6a1ec327a95a8260d1616940e5d6c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89467 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl/source/basicide/linenumberwindow.cxx')
-rw-r--r--basctl/source/basicide/linenumberwindow.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx
index 79c124117c97..4fa6ebf8f5aa 100644
--- a/basctl/source/basicide/linenumberwindow.cxx
+++ b/basctl/source/basicide/linenumberwindow.cxx
@@ -73,7 +73,8 @@ void LineNumberWindow::Paint( vcl::RenderContext& rRenderContext, const tools::R
// reserve enough for 3 digit minimum, with a bit to spare for comfort
m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2;
- sal_uInt32 i = (nEndLine + 1) / 1000;
+ auto nMaxLineNumber = std::max(nEndLine, txtEngine->GetParagraphCount() + 1);
+ sal_uInt32 i = (nMaxLineNumber + 1) / 1000;
while (i)
{
i /= 10;