summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-05-02 11:37:18 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2022-05-04 16:36:07 +0200
commita082f1570d3faf9d65944339244bcf3b4bb3e3e9 (patch)
tree090af07398b3e7ad4454a53b83701ae9322d2999
parenttdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden (diff)
downloadcore-a082f1570d3faf9d65944339244bcf3b4bb3e3e9.tar.gz
core-a082f1570d3faf9d65944339244bcf3b4bb3e3e9.zip
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> (cherry picked from commit fae937b6859517bd9fe8e400cad3c84561ff98ab) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133716 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-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 7f35ea7633b6..40221ff38c63 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());
}