diff options
author | Rafael Lima <rafael.palma.lima@gmail.com> | 2023-12-07 21:37:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-08 10:39:34 +0100 |
commit | 99f91d64c57f4e2bfe47fe4d0870b92c269fa875 (patch) | |
tree | d2c8f9a7bf2e88bff9bbb268ac6a2092cf9d1e30 /sw | |
parent | 13595f6220095d120e13ccb6fbfac1de4c803fe7 (diff) |
tdf#156379 Fix Line count width in the Properties dialog
In Writer, the "Lines" property in File - Properties - Statistics does not have enough width to handle numbers with 4 digits or more.
This patch fixes the issue by adjusting the label width when it is updated.
Change-Id: I1a56da106f7c80ffbbaa8bdfb93932a3974b1ee0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160367
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/dialog/docstdlg.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 48e4642281ea..70a653dcbefe 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -120,7 +120,11 @@ IMPL_LINK_NOARG(SwDocStatPage, UpdateHdl, weld::Button&, void) SwDocShell* pDocShell = static_cast<SwDocShell*>( SfxObjectShell::Current()); SwFEShell* pFEShell = pDocShell ? pDocShell->GetFEShell() : nullptr; if (pFEShell) - m_xLineNo->set_label(OUString::number(pFEShell->GetLineCount())); + { + OUString sLineCount = OUString::number(pFEShell->GetLineCount()); + m_xLineNo->set_label(sLineCount); + m_xLineNo->set_size_request(m_xLineNo->get_approximate_digit_width() * sLineCount.getLength(), -1); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |