From 458c60950330daaf1c42d5edd3ac4a80fb321fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 23 Jul 2017 19:09:15 +0100 Subject: [PATCH] coverity#1415610 avoid Unchecked dynamic_cast Change-Id: Id37e121d3f0de9067fdce8462db7162f3e80d1ac --- svtools/source/filter/exportdialog.cxx | 7 +++---- svtools/source/filter/exportdialog.hxx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 06f790ba4fca..bd5254c0449f 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -419,7 +419,6 @@ void ExportDialog::GetGraphicStream() if ( mxGraphic.is() ) { - SvMemoryStream* pTempStream = dynamic_cast( mpTempStream ); Graphic aGraphic( mxGraphic ); if ( aGraphic.GetType() == GraphicType::Bitmap ) @@ -440,9 +439,9 @@ void ExportDialog::GetGraphicStream() const sal_uInt16 nFilter = rFilter.GetExportFormatNumberForShortName( maExt ); if ( rFilter.IsExportPixelFormat( nFilter ) ) { - pTempStream->SetResizeOffset(1024); - pTempStream->SetStreamSize(1024); - rFilter.ExportGraphic( aGraphic, "", *pTempStream, nFilter, &aNewFilterData ); + mpTempStream->SetResizeOffset(1024); + mpTempStream->SetStreamSize(1024); + rFilter.ExportGraphic( aGraphic, "", *mpTempStream, nFilter, &aNewFilterData ); if ( mnFormat == FORMAT_JPG ) { diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx index efa386c0ebd6..538a30d3e4bc 100644 --- a/svtools/source/filter/exportdialog.hxx +++ b/svtools/source/filter/exportdialog.hxx @@ -118,7 +118,7 @@ private: sal_Int16 mnFormat; sal_Int32 mnMaxFilesizeForRealtimePreview; - SvStream* mpTempStream; + SvMemoryStream* mpTempStream; Bitmap maBitmap; css::awt::Size maOriginalSize; // the original graphic size in 1/100mm