Kaydet (Commit) 4a83b67e authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#735652 Division or modulo by zero

and

coverity#735651 Division or modulo by zero

Change-Id: I412308ef3e736b1e9c72d1dd3a8d80d2dce92d67
üst 42019e2f
...@@ -721,9 +721,9 @@ sal_Int32 SwSrcView::PrintSource( ...@@ -721,9 +721,9 @@ sal_Int32 SwSrcView::PrintSource(
aPaperSz.Height() -= (TMARGPRN + BMARGPRN); aPaperSz.Height() -= (TMARGPRN + BMARGPRN);
// nLinepPage is not true, if lines have to be wrapped... // nLinepPage is not true, if lines have to be wrapped...
const long nLinespPage = aPaperSz.Height() / nLineHeight; const long nLinespPage = nLineHeight ? aPaperSz.Height() / nLineHeight : 1;
const sal_Int32 nCharspLine = const long nCharWidth = pOutDev->GetTextWidth("X");
static_cast<sal_Int32>(aPaperSz.Width() / pOutDev->GetTextWidth("X")); const sal_Int32 nCharspLine = nCharWidth ? static_cast<sal_Int32>(aPaperSz.Width() / nCharWidth) : 1;
const sal_uLong nParas = pTextEngine->GetParagraphCount(); const sal_uLong nParas = pTextEngine->GetParagraphCount();
const sal_Int32 nPages = static_cast<sal_Int32>(nParas / nLinespPage + 1 ); const sal_Int32 nPages = static_cast<sal_Int32>(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