Author: pfg Date: Tue Dec 1 22:53:35 2015 New Revision: 1717552 URL: http://svn.apache.org/viewvc?rev=1717552&view=rev Log: Prevent division by zero
CID: 735658, 735659 Modified: openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx Modified: openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx?rev=1717552&r1=1717551&r2=1717552&view=diff ============================================================================== --- openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx (original) +++ openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx Tue Dec 1 22:53:35 2015 @@ -8929,9 +8929,9 @@ static double calcAngle( const Rectangle double fX = (double)aPoint.X(); double fY = (double)-aPoint.Y(); - if( rRect.GetWidth() > rRect.GetHeight() ) + if((rRect.GetWidth() > rRect.GetHeight()) && (rRect.GetHeight() != 0 )) fY = fY*((double)rRect.GetWidth()/(double)rRect.GetHeight()); - else if( rRect.GetHeight() > rRect.GetWidth() ) + else if((rRect.GetHeight() > rRect.GetWidth()) && (rRect.GetWidth() != 0)) fX = fX*((double)rRect.GetHeight()/(double)rRect.GetWidth()); return atan2( fY, fX ); }