From f69b4226579e8ead5e2501262af927d8c08ea1cf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 17 Jul 2021 19:15:20 +0100 Subject: cid#1487495 Division or modulo by zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sc/source/core/tool/interpr1.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc') 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(mrDoc.GetColWidth( aCellPos.Col(), aCellPos.Tab() ) / nZeroWidth); -- cgit