summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 20:08:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-20 07:56:19 +0200
commit84abf28e05fc55be867028f3d3a59220ca2669f0 (patch)
treeebf1c6c90f89b4aa9a5a6b516ec89121026bfe03 /package
parentdefdd8bebe40b48d8abc4d893ac9a82b550c5d19 (diff)
loplugin:referencecasting in oox..pyuno
Change-Id: Ie920c154aef3074016704c632b15d99110b219aa Reviewed-on: https://gerrit.libreoffice.org/75974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/qa/cppunit/test_package.cxx2
-rw-r--r--package/source/xstor/owriteablestream.cxx13
2 files changed, 5 insertions, 10 deletions
diff --git a/package/qa/cppunit/test_package.cxx b/package/qa/cppunit/test_package.cxx
index acd2b5c795a6..ec65d7a88351 100644
--- a/package/qa/cppunit/test_package.cxx
+++ b/package/qa/cppunit/test_package.cxx
@@ -70,7 +70,7 @@ namespace
CPPUNIT_ASSERT(xZip.is());
- mxNA = uno::Reference<container::XNameAccess>(xZip, uno::UNO_QUERY);
+ mxNA = xZip;
CPPUNIT_ASSERT(mxNA.is());
}
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 3c26f052b665..041363cb5142 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -1320,12 +1320,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre
else
m_pAntiImpl = new OWriteStream( this, xStream, bHierarchyAccess );
- uno::Reference< io::XStream > xWriteStream( static_cast< ::cppu::OWeakObject* >( m_pAntiImpl ),
- uno::UNO_QUERY );
-
- SAL_WARN_IF( !xWriteStream.is(), "package.xstor", "OWriteStream MUST implement XStream && XComponent interfaces!" );
-
- return xWriteStream;
+ return m_pAntiImpl;
}
throw lang::IllegalArgumentException(); // TODO
@@ -1380,7 +1375,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io:
{
uno::Reference < io::XStream > xTempFile;
if ( !xTargetStream.is() )
- xTempFile.set( io::TempFile::create(m_xContext), uno::UNO_QUERY );
+ xTempFile = io::TempFile::create(m_xContext);
else
xTempFile = xTargetStream;
@@ -2069,7 +2064,7 @@ uno::Reference< io::XInputStream > SAL_CALL OWriteStream::getInputStream()
if ( !m_bInitOnDemand && ( m_bInStreamDisconnected || !m_xInStream.is() ) )
return uno::Reference< io::XInputStream >();
- return uno::Reference< io::XInputStream >( static_cast< io::XInputStream* >( this ), uno::UNO_QUERY );
+ return this;
}
uno::Reference< io::XOutputStream > SAL_CALL OWriteStream::getOutputStream()
@@ -2095,7 +2090,7 @@ uno::Reference< io::XOutputStream > SAL_CALL OWriteStream::getOutputStream()
if ( !m_xOutStream.is() )
return uno::Reference< io::XOutputStream >();
- return uno::Reference< io::XOutputStream >( static_cast< io::XOutputStream* >( this ), uno::UNO_QUERY );
+ return this;
}
void SAL_CALL OWriteStream::writeBytes( const uno::Sequence< sal_Int8 >& aData )