From 84568fa10a0aaff14b87f725604704f1907dc2e3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 24 Jan 2017 11:26:57 +0000 Subject: coverity#1399021 Unchecked dynamic_cast Change-Id: I3befc9be20f8d414ec786f1a94f1f85ce94fb44b --- svx/source/unodraw/UnoGraphicExporter.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'svx') diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 0be647033ae8..3e0e40f4fced 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -687,17 +687,16 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, } } - std::unique_ptr< SdrView > pLocalView; - if( dynamic_cast( mpDoc ) ) + std::unique_ptr xLocalView; + if (FmFormModel* pFormModel = dynamic_cast(mpDoc)) { - pLocalView.reset( new FmFormView( dynamic_cast( mpDoc ), aVDev ) ); + xLocalView.reset(new FmFormView(pFormModel, aVDev) ); } else { - pLocalView.reset( new SdrView( mpDoc, aVDev ) ); + xLocalView.reset(new SdrView(mpDoc, aVDev)); } - ScopedVclPtr pVDev(CreatePageVDev( pPage, nWidthPix, nHeightPix )); if( pVDev ) -- cgit