diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-01 11:03:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-01 17:19:50 +0100 |
commit | 22f719aa96cfbf8187843fb02c328dc43ea95e3f (patch) | |
tree | 7eb09df0401db11084e6a5b022b67810ec4ed2c3 | |
parent | 09ebcc26f679a5d04d0b13be6fb2eae02b0b32b1 (diff) |
coverity#738861 Uninitialized pointer field
Change-Id: I0c39ea58fd1f85471531490401a7b7e8ca7c2a17
-rw-r--r-- | include/vcl/wmf.hxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/wmf/emfwr.cxx | 5 | ||||
-rw-r--r-- | vcl/source/filter/wmf/emfwr.hxx | 23 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmf.cxx | 5 |
5 files changed, 25 insertions, 12 deletions
diff --git a/include/vcl/wmf.hxx b/include/vcl/wmf.hxx index cdadbbc2949f..750dcc3a5821 100644 --- a/include/vcl/wmf.hxx +++ b/include/vcl/wmf.hxx @@ -61,7 +61,7 @@ VCL_DLLPUBLIC bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, Fil VCL_DLLPUBLIC bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL, bool bPlaceable = true ); -bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL ); +bool ConvertGDIMetaFileToEMF(const GDIMetaFile & rMTF, SvStream & rTargetStream); VCL_DLLPUBLIC bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index e96a55219377..2144a5825762 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1968,7 +1968,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString else if ( aFilterName.equalsIgnoreAsciiCase( EXP_EMF ) ) { // #i119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically - if ( !ConvertGDIMetaFileToEMF( aGraphic.GetGDIMetaFile(), rOStm, &aConfigItem ) ) + if ( !ConvertGDIMetaFileToEMF(aGraphic.GetGDIMetaFile(), rOStm)) nStatus = GRFILTER_FORMATERROR; if( rOStm.GetError() ) diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 3563f0e82306..b25bb20ee72d 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -284,7 +284,7 @@ void EMFWriter::ImplWritePlusFillPolygonRecord( const Polygon& rPoly, const sal_ ImplEndCommentRecord(); } -bool EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConfigItem ) +bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf) { const sal_uLong nHeaderPos = m_rStm.Tell(); @@ -292,10 +292,9 @@ bool EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf maVDev.SetMapMode( rMtf.GetPrefMapMode() ); // don't work with pixel as destination map mode -> higher resolution preferrable maDestMapMode.SetMapUnit( MAP_100TH_MM ); - mpFilterConfigItem = pFilterConfigItem; mpHandlesUsed = new bool[ MAXHANDLES ]; memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( bool ) ); - mnHandleCount = mnLastPercent = mnRecordCount = mnRecordPos = mnRecordPlusPos = 0; + mnHandleCount = mnRecordCount = mnRecordPos = mnRecordPlusPos = 0; mbRecordOpen = mbRecordPlusOpen = false; mbLineChanged = mbFillChanged = mbTextChanged = false; mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID; diff --git a/vcl/source/filter/wmf/emfwr.hxx b/vcl/source/filter/wmf/emfwr.hxx index 62f0b281b7f8..66b28952b8e5 100644 --- a/vcl/source/filter/wmf/emfwr.hxx +++ b/vcl/source/filter/wmf/emfwr.hxx @@ -35,11 +35,9 @@ private: VirtualDevice maVDev; MapMode maDestMapMode; - FilterConfigItem* mpFilterConfigItem; SvStream& m_rStm; bool* mpHandlesUsed; sal_uLong mnHandleCount; - sal_uLong mnLastPercent; sal_uLong mnRecordCount; sal_uLong mnRecordPos; sal_uLong mnRecordPlusPos; @@ -91,9 +89,26 @@ private: public: - EMFWriter(SvStream &rStream) : m_rStm(rStream) {} + EMFWriter(SvStream &rStream) + : m_rStm(rStream) + , mpHandlesUsed(NULL) + , mnHandleCount(0) + , mnRecordCount(0) + , mnRecordPos(0) + , mnRecordPlusPos(0) + , mbRecordOpen(false) + , mbRecordPlusOpen(false) + , mbLineChanged(false) + , mnLineHandle(0) + , mbFillChanged(false) + , mnFillHandle(0) + , mbTextChanged(false) + , mnTextHandle(0) + , mnHorTextAlign(0) + { + } - bool WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL ); + bool WriteEMF(const GDIMetaFile& rMtf); }; #endif // INCLUDED_VCL_SOURCE_FILTER_WMF_EMFWR_HXX diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx index 3efc5c9d51d8..3d932f2c445a 100644 --- a/vcl/source/filter/wmf/wmf.cxx +++ b/vcl/source/filter/wmf/wmf.cxx @@ -102,8 +102,7 @@ bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream return aWMFWriter.WriteWMF( aGdiMetaFile, rTargetStream, pConfigItem, bPlaceable ); } -bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, - FilterConfigItem* pConfigItem ) +bool ConvertGDIMetaFileToEMF(const GDIMetaFile & rMTF, SvStream & rTargetStream) { EMFWriter aEMFWriter(rTargetStream); GDIMetaFile aGdiMetaFile(rMTF); @@ -116,7 +115,7 @@ bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream clipMetafileContentAgainstOwnRegions(aGdiMetaFile); } - return aEMFWriter.WriteEMF( aGdiMetaFile, pConfigItem ); + return aEMFWriter.WriteEMF(aGdiMetaFile); } bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ) |