diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-01 10:42:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-01 17:19:50 +0100 |
commit | 09ebcc26f679a5d04d0b13be6fb2eae02b0b32b1 (patch) | |
tree | 8988a63001e51dc0bae71228827545ac0fa76fda /vcl | |
parent | 088afc6222b8609750a9869840ad3363ae3e923e (diff) |
coverity#708321 Uninitialized pointer field
Change-Id: Ia08d454e89d4af08b6db171611f14a66e890094b
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 36 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.hxx | 7 |
2 files changed, 31 insertions, 12 deletions
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 6439b41fc2d2..a74555ab0360 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -131,6 +131,33 @@ #define PRIVATE_ESCAPE_UNICODE 2 +WMFWriter::WMFWriter() + : pWMF(NULL) + , pVirDev(NULL) + , nMetafileHeaderPos(0) + , nMaxRecordSize(0) + , nActRecordPos(0) + , eSrcRasterOp(ROP_OVERPAINT) + , eSrcTextAlign(ALIGN_BASELINE) + , bSrcIsClipping(false) + , pAttrStack(NULL) + , eSrcHorTextAlign(W_TA_LEFT) + , eDstROP2(ROP_OVERPAINT) + , eDstTextAlign(ALIGN_BASELINE) + , eDstHorTextAlign(W_TA_LEFT) + , bDstIsClipping(false) + , nDstPenHandle(0) + , nDstFontHandle(0) + , nDstBrushHandle(0) + , nNumberOfActions(0) + , nNumberOfBitmaps(0) + , nWrittenActions(0) + , nWrittenBitmaps(0) + , nActBitmapPercent(0) + , bEmbedEMF(false) +{ +} + void WMFWriter::MayCallback() { if ( xStatusIndicator.is() ) @@ -1667,13 +1694,11 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, bEmbedEMF = true; bStatus=true; - pConvert = 0; pVirDev = new VirtualDevice; - pFilterConfigItem = pFConfigItem; - if ( pFilterConfigItem ) + if (pFConfigItem) { - xStatusIndicator = pFilterConfigItem->GetStatusIndicator(); + xStatusIndicator = pFConfigItem->GetStatusIndicator(); if ( xStatusIndicator.is() ) { OUString aMsg; @@ -1693,7 +1718,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, { aTargetMapMode = aSrcMapMode; aTargetSize = rMTF.GetPrefSize(); - nTargetDivisor = CalcSaveTargetMapMode(aTargetMapMode, aTargetSize); + sal_uInt16 nTargetDivisor = CalcSaveTargetMapMode(aTargetMapMode, aTargetSize); aTargetSize.Width() /= nTargetDivisor; aTargetSize.Height() /= nTargetDivisor; } @@ -1776,7 +1801,6 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, } delete pVirDev; - delete pConvert; if ( xStatusIndicator.is() ) xStatusIndicator->end(); diff --git a/vcl/source/filter/wmf/wmfwr.hxx b/vcl/source/filter/wmf/wmfwr.hxx index 293bed2d47aa..5114ecc6a755 100644 --- a/vcl/source/filter/wmf/wmfwr.hxx +++ b/vcl/source/filter/wmf/wmfwr.hxx @@ -54,16 +54,13 @@ private: bool bStatus; sal_uLong nLastPercent; // with which number pCallback was called last time. - FilterConfigItem* pFilterConfigItem; com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator; SvStream* pWMF; VirtualDevice* pVirDev; - StarSymbolToMSMultiFont *pConvert; MapMode aTargetMapMode; Size aTargetSize; - sal_uInt16 nTargetDivisor; sal_uLong nMetafileHeaderPos; sal_uInt32 nMaxRecordSize; // in words @@ -201,9 +198,7 @@ private: sal_uInt16 CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); public: - - WMFWriter() {} - + WMFWriter(); bool WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, bool bPlaceable=true); }; |