summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-17 11:49:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-17 15:19:59 +0100
commit0c1e9111d02649e77513a1d108146c9c055adb3a (patch)
tree57ef9f3ecf966b543a8cb152a715c785e7add77f
parent98a19ed06585ffff5dd1887e4a203d619259ee8c (diff)
coverity#704104 Unchecked return value
Change-Id: I4a2c49befe4baea10e36e0d612371fe8c91db401
-rw-r--r--vcl/generic/print/text_gfx.cxx12
-rw-r--r--vcl/inc/generic/printergfx.hxx2
2 files changed, 8 insertions, 6 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
diff --git a/vcl/inc/generic/printergfx.hxx b/vcl/inc/generic/printergfx.hxx
index c797ea4a5812..a0e2683ce6b2 100644
--- a/vcl/inc/generic/printergfx.hxx
+++ b/vcl/inc/generic/printergfx.hxx
@@ -304,7 +304,7 @@ public:
void writeResources( osl::File* pFile, std::list< OString >& rSuppliedFonts );
PrintFontManager& GetFontMgr () { return mrFontMgr; }
- void drawVerticalizedText (const Point& rPoint,
+ bool drawVerticalizedText (const Point& rPoint,
const sal_Unicode* pStr,
sal_Int16 nLen,
const sal_Int32* pDeltaArray );