diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-17 11:49:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-17 15:19:59 +0100 |
commit | 0c1e9111d02649e77513a1d108146c9c055adb3a (patch) | |
tree | 57ef9f3ecf966b543a8cb152a715c785e7add77f /vcl/generic/print | |
parent | 98a19ed06585ffff5dd1887e4a203d619259ee8c (diff) |
coverity#704104 Unchecked return value
Change-Id: I4a2c49befe4baea10e36e0d612371fe8c91db401
Diffstat (limited to 'vcl/generic/print')
-rw-r--r-- | vcl/generic/print/text_gfx.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index 769323b09bb1..c97a369f80ea 100644 --- a/vcl/generic/print/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -425,13 +425,18 @@ PrinterGfx::DrawText ( ); } -void PrinterGfx::drawVerticalizedText( +bool PrinterGfx::drawVerticalizedText( const Point& rPoint, const sal_Unicode* pStr, sal_Int16 nLen, const sal_Int32* pDeltaArray ) { + PrintFontManager &rMgr = PrintFontManager::get(); + PrintFontInfo aInfo; + if (!rMgr.getFontInfo(mnFontID, aInfo)) + return false; + sal_Int32* pDelta = (sal_Int32*)alloca( nLen * sizeof(sal_Int32) ); int nTextScale = maVirtualStatus.mnTextWidth ? maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight; @@ -441,10 +446,6 @@ void PrinterGfx::drawVerticalizedText( double fSin = sin( -2.0*M_PI*nNormalAngle/3600 ); double fCos = cos( -2.0*M_PI*nNormalAngle/3600 ); - PrintFontManager &rMgr = PrintFontManager::get(); - PrintFontInfo aInfo; - rMgr.getFontInfo( mnFontID, aInfo ); - bool* pGsubFlags = (bool*)alloca( nLen * sizeof(bool) ); rMgr.hasVerticalSubstitutions( mnFontID, pStr, nLen, pGsubFlags ); @@ -518,6 +519,7 @@ void PrinterGfx::drawVerticalizedText( nLastPos = i; } mnTextAngle = nNormalAngle; + return true; } void |