diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-17 19:15:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-07-18 12:42:09 +0200 |
commit | f69b4226579e8ead5e2501262af927d8c08ea1cf (patch) | |
tree | af4a786f94a12ddd4fdfb1cf7bd48c0769b41ced /sc | |
parent | e6af563b99b415b3188e3e11956c24d68e27930e (diff) |
cid#1487495 Division or modulo by zero
the width of zero isn't going to end up as 0 in any real world situation
Change-Id: I28eca0b495b139c4b2d70497a9c15898547d85fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119114
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 94923f75c255..f0bcf7b913fa 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2372,6 +2372,7 @@ void ScInterpreter::ScCell() mrDoc.GetDefPattern()->GetFont( aDefFont, SC_AUTOCOL_BLACK, pPrinter ); pPrinter->SetFont( aDefFont ); tools::Long nZeroWidth = pPrinter->GetTextWidth( OUString( '0' ) ); + assert(nZeroWidth != 0); pPrinter->SetFont( aOldFont ); pPrinter->SetMapMode( aOldMode ); int nZeroCount = static_cast<int>(mrDoc.GetColWidth( aCellPos.Col(), aCellPos.Tab() ) / nZeroWidth); |