From 184be2d1352c5d3f3aa1e276d26c463c6e49b302 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 31 Mar 2019 00:06:17 +0300 Subject: tdf#120703 PVS: remove redundant static casts V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I54976062dc3f62eaaa79f89eff54454f0b24ac2c Reviewed-on: https://gerrit.libreoffice.org/69989 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- unotools/source/ucbhelper/ucblockbytes.cxx | 4 ++-- unotools/source/ucbhelper/ucbstreamhelper.cxx | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'unotools') diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 1633bd294626..61e02c87072e 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1278,9 +1278,9 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo xLockBytes->SetSynchronMode(); Reference< XActiveDataControl > xSink; if ( eOpenMode & StreamMode::WRITE ) - xSink = static_cast(new UcbStreamer_Impl( xLockBytes.get() )); + xSink = new UcbStreamer_Impl(xLockBytes.get()); else - xSink = static_cast(new UcbDataSink_Impl( xLockBytes.get() )); + xSink = new UcbDataSink_Impl(xLockBytes.get()); if ( rProps.getLength() ) { diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx index 4cb749306149..94d884564146 100644 --- a/unotools/source/ucbhelper/ucbstreamhelper.cxx +++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx @@ -144,8 +144,7 @@ std::unique_ptr UcbStreamHelper::CreateStream( const OUString& rFileNa // create a specialized interaction handler to manages Web certificates and Web credentials when needed Reference< XInteractionHandler > xIH( css::task::InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), nullptr ) ); - Reference < XInteractionHandler > xIHScoped( static_cast< XInteractionHandler *> ( - new comphelper::SimpleFileAccessInteraction( xIH ) ) ); + Reference xIHScoped(new comphelper::SimpleFileAccessInteraction(xIH)); return lcl_CreateStream( rFileName, eOpenMode, xIHScoped, true /* bEnsureFileExists */ ); } @@ -157,8 +156,7 @@ std::unique_ptr UcbStreamHelper::CreateStream( const OUString& rFileNa // create a specialized interaction handler to manages Web certificates and Web credentials when needed Reference< XInteractionHandler > xIH( css::task::InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), nullptr ) ); - Reference < XInteractionHandler > xIHScoped( static_cast< XInteractionHandler *> ( - new comphelper::SimpleFileAccessInteraction( xIH ) ) ); + Reference xIHScoped(new comphelper::SimpleFileAccessInteraction(xIH)); return lcl_CreateStream( rFileName, eOpenMode, xIHScoped,!bFileExists ); } -- cgit