Kaydet (Commit) 86d7984c authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1430102 Division by zero

Change-Id: Iae44c89c4af70e3e5b19137ee08ca566c7a04fb7
Reviewed-on: https://gerrit.libreoffice.org/54141Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6cbb674e
......@@ -405,9 +405,11 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField&, rField, void)
}
else//in normal mode
{
if(m_pLinesPerPageNF == &rField)
if (m_pLinesPerPageNF == &rField)
{
long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / m_pLinesPerPageNF->GetValue());
auto nValue = m_pLinesPerPageNF->GetValue();
assert(nValue && "div-by-zero");
long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / nValue);
m_pTextSizeMF->SetValue(m_pTextSizeMF->Normalize(nHeight), FUNIT_TWIP);
m_pRubySizeMF->SetValue(0, FUNIT_TWIP);
SetLinesOrCharsRanges( *m_pLinesRangeFT , m_pLinesPerPageNF->GetMax() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment