summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-31 15:12:21 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2024-01-03 10:36:48 +0100
commit15e5f503c2c7e84eb424d265ed472cc2c5b1dc69 (patch)
tree1bfe576174121f32c15c5343d7ad7adfa0753e20 /sw
parentdedcfc8d8935ce9d733c3551b7add1af2b7d730d (diff)
cid#1559993 Division or modulo by float zero
Change-Id: I071d576fc998022c76364778423e0346f69cb051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161500 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 7cf623ae1771f448ab4f82c175156a7e776fa964) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161425 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index b0b92a6ae1a7..1277545c6e12 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -67,9 +67,10 @@ void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat&
setValue(*m_xDocCjkcharsFT, rDoc.nAsianWord, rLocaleData);
setValue(*m_xDocComments, rCurrent.nComments, rLocaleData);
- if (m_xStandardizedPagesLabelFT->get_visible())
+ const sal_Int64 nCharsPerStandardizedPage = m_xStandardizedPagesLabelFT->get_visible() ?
+ officecfg::Office::Writer::WordCount::StandardizedPageSize::get() : 0;
+ if (nCharsPerStandardizedPage)
{
- sal_Int64 nCharsPerStandardizedPage = officecfg::Office::Writer::WordCount::StandardizedPageSize::get();
setDoubleValue(*m_xCurrentStandardizedPagesFT,
static_cast<double>(rCurrent.nChar) / nCharsPerStandardizedPage);
setDoubleValue(*m_xDocStandardizedPagesFT,