summaryrefslogtreecommitdiff
path: root/sw/source/core/text/inftxt.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-06 11:50:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-06 16:35:45 +0000
commit056a9a8b49fc081b092026a16ff4bf63d47052f6 (patch)
tree05b06ae08efb19243ef7be09690d35e32c7cb2ce /sw/source/core/text/inftxt.cxx
parent5d81ffe587f8d54efc077facdd61214a5329a322 (diff)
coverity#1190349 Division or modulo by zero
Change-Id: Ia32e9197d0b5d5a02187d11f05bcf2dcae5ccb76
Diffstat (limited to 'sw/source/core/text/inftxt.cxx')
-rw-r--r--sw/source/core/text/inftxt.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index a797fb5ce008..e3d19f58a0a8 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -833,19 +833,13 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
// The maximum width depends on the current orientation
const sal_uInt16 nDir = m_pFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
- SwTwips nMaxWidth = 0;
- switch ( nDir )
+ SwTwips nMaxWidth;
+ if (nDir == 900 || nDir == 2700)
+ nMaxWidth = rRect.Height();
+ else
{
- case 0 :
+ assert(nDir == 0); //Unknown direction set at font
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