Kaydet (Commit) 0cb6cb06 authored tarafından David Tardon's avatar David Tardon

coverity#735655 avoid division by 0

Change-Id: I5eeb4cbcaa19bdf9bcafc3830447468dd8dc5c8c
üst ecbc1865
...@@ -456,7 +456,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa ...@@ -456,7 +456,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
else else
{ {
long nTextHeight = pDev->GetTextHeight(); long nTextHeight = pDev->GetTextHeight();
sal_uInt16 nLines = (sal_uInt16)(aSize.Height() / nTextHeight); sal_uInt16 nLines = ( nTextHeight > 0 ) ? (sal_uInt16)(aSize.Height() / nTextHeight) : 1;
Rectangle aClip( aPos, aSize ); Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip ); pDev->IntersectClipRegion( aClip );
......
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