Kaydet (Commit) 056a9a8b authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1190349 Division or modulo by zero

Change-Id: Ia32e9197d0b5d5a02187d11f05bcf2dcae5ccb76
üst 5d81ffe5
...@@ -833,19 +833,13 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP ...@@ -833,19 +833,13 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
// The maximum width depends on the current orientation // The maximum width depends on the current orientation
const sal_uInt16 nDir = m_pFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() ); const sal_uInt16 nDir = m_pFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
SwTwips nMaxWidth = 0; SwTwips nMaxWidth;
switch ( nDir ) if (nDir == 900 || nDir == 2700)
nMaxWidth = rRect.Height();
else
{ {
case 0 : assert(nDir == 0); //Unknown direction set at font
nMaxWidth = rRect.Width(); nMaxWidth = rRect.Width();
break;
case 900 :
case 2700 :
nMaxWidth = rRect.Height();
break;
default:
OSL_FAIL( "Unknown direction set at font" );
break;
} }
// check if char fits into rectangle // check if char fits into rectangle
......
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