summaryrefslogtreecommitdiff
path: root/unotools/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-31 00:06:17 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-31 07:27:24 +0200
commit184be2d1352c5d3f3aa1e276d26c463c6e49b302 (patch)
tree65ee35397f445b264dcb05d0087aed60000f0e75 /unotools/source
parentf42d729e41da918bc496d5feb5861a09737c438a (diff)
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'unotools/source')
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx4
-rw-r--r--unotools/source/ucbhelper/ucbstreamhelper.cxx6
2 files changed, 4 insertions, 6 deletions
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<XActiveDataControl*>(new UcbStreamer_Impl( xLockBytes.get() ));
+ xSink = new UcbStreamer_Impl(xLockBytes.get());
else
- xSink = static_cast<XActiveDataControl*>(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<SvStream> 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<XInteractionHandler> xIHScoped(new comphelper::SimpleFileAccessInteraction(xIH));
return lcl_CreateStream( rFileName, eOpenMode, xIHScoped, true /* bEnsureFileExists */ );
}
@@ -157,8 +156,7 @@ std::unique_ptr<SvStream> 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<XInteractionHandler> xIHScoped(new comphelper::SimpleFileAccessInteraction(xIH));
return lcl_CreateStream( rFileName, eOpenMode, xIHScoped,!bFileExists );
}