Kaydet (Commit) 3c2f3f48 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#735598 : Division by zero

Change-Id: I288b46a933d8a301823deed8fccae9764b74e840
üst 2a77e7a3
......@@ -895,7 +895,9 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
// nLinepPage is not correct if there's a line break
sal_uInt16 nLinespPage = (sal_uInt16) (aPaperSz.Height()/nLineHeight);
sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pPrinter->GetTextWidth( "X" ) );
long nXTextWidth = pPrinter->GetTextWidth( "X" );
sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / nXTextWidth > 1 ? nXTextWidth : 1);
sal_uLong nParas = GetEditEngine()->GetParagraphCount();
sal_uInt16 nPages = (sal_uInt16) (nParas/nLinespPage+1 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment