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>
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 48e4642..70a653d 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: */