summaryrefslogtreecommitdiff
path: root/sw/source/core/text
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-05-02 11:37:18 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-05-02 18:56:15 +0200
commitfae937b6859517bd9fe8e400cad3c84561ff98ab (patch)
treef18cbd2b9b9e57973f85f0ae738f9041f56dfe1c /sw/source/core/text
parent7fd1b0aa2ba741103a7d9ac835514ebbeae3bcff (diff)
sw: avoid one more EXCEPTION_INT_DIVIDE_BY_ZERO
Seen in https://crashreport.libreoffice.org/stats/signature/SwTextFrame::PaintExtraData(SwRect%20const%20&) Change-Id: Ie6924254dca73360d384987834460a6f813e0d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133691 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/text')
-rw-r--r--sw/source/core/text/frmpaint.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 95ecf6cd54ff..8637faca988c 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -82,9 +82,14 @@ public:
sal_Int16 eHor, bool bLnNm );
SwFont* GetFont() const { return m_pFnt.get(); }
void IncLineNr() { ++m_nLineNr; }
- bool HasNumber() const { return !( m_nLineNr % m_rLineInf.GetCountBy() ); }
+ bool HasNumber() const {
+ if( m_rLineInf.GetCountBy() == 0 )
+ return false;
+ return !( m_nLineNr % m_rLineInf.GetCountBy() );
+ }
bool HasDivider() const {
- if( !m_nDivider ) return false;
+ if( !m_nDivider || m_rLineInf.GetDividerCountBy() == 0 )
+ return false;
return !(m_nLineNr % m_rLineInf.GetDividerCountBy());
}