Kaydet (Commit) 0f2e6f1f authored tarafından Armin Le Grand's avatar Armin Le Grand

cid#1357164 correct CovertyScan possible DIVIDE_BY_ZERO

Also covers cid#1357165, exclude possibility that value equals
zero at the same place negative values get excluded

Change-Id: If3fd6143fb13f0d29f5fba304f9f337f7a7aa74c
Reviewed-on: https://gerrit.libreoffice.org/23592Reviewed-by: 's avatarArmin Le Grand <Armin.Le.Grand@cib.de>
Tested-by: 's avatarArmin Le Grand <Armin.Le.Grand@cib.de>
üst 07aa8697
...@@ -120,7 +120,7 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, vcl::Window& rWin) ...@@ -120,7 +120,7 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, vcl::Window& rWin)
nFreeSpaceX = rRect.GetWidth(); nFreeSpaceX = rRect.GetWidth();
} }
if(nFreeSpaceX < 0) if(nFreeSpaceX <= 0)
{ {
SAL_WARN("sd", "The given Rectangle contains values that lead to numerical overflows (!)"); SAL_WARN("sd", "The given Rectangle contains values that lead to numerical overflows (!)");
} }
...@@ -165,7 +165,7 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, vcl::Window& rWin) ...@@ -165,7 +165,7 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, vcl::Window& rWin)
nFreeSpaceY = rRect.GetHeight(); nFreeSpaceY = rRect.GetHeight();
} }
if(nFreeSpaceY < 0) if(nFreeSpaceY <= 0)
{ {
SAL_WARN("sd", "The given Rectangle contains values that lead to numerical overflows (!)"); SAL_WARN("sd", "The given Rectangle contains values that lead to numerical overflows (!)");
} }
......
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