[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 18 10:42:44 UTC 2021


 sc/source/core/tool/interpr1.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit f69b4226579e8ead5e2501262af927d8c08ea1cf
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jul 17 19:15:20 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Jul 18 12:42:09 2021 +0200

    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 at redhat.com>

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);


More information about the Libreoffice-commits mailing list