From 89732e5bbf659694c63a2eb16019a23c7a64ba64 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 30 Sep 2021 12:45:33 +0200 Subject: [PATCH] Extended loplugin:referencecasting/redundantcast (clang-cl): embeddedobj Change-Id: I345b6535df2df4770191dc1aae0ca024b747a50a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122887 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- embeddedobj/source/msole/olepersist.cxx | 3 +-- embeddedobj/source/msole/xdialogcreator.cxx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index 0ef23a096af4..7811566b7965 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -966,8 +966,7 @@ void OleEmbeddedObject::CreateOleComponent_Impl( m_pOleComponent = pOleComponent ? pOleComponent : new OleComponent( m_xContext, this ); if ( !m_xClosePreventer.is() ) - m_xClosePreventer.set( static_cast< ::cppu::OWeakObject* >( new OClosePreventer ), - uno::UNO_QUERY ); + m_xClosePreventer = new OClosePreventer; m_pOleComponent->addCloseListener( m_xClosePreventer ); } diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx index d5ecdf587909..b6bae52f1e49 100644 --- a/embeddedobj/source/msole/xdialogcreator.cxx +++ b/embeddedobj/source/msole/xdialogcreator.cxx @@ -307,8 +307,7 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceInitF 2 ); uno::Reference< embed::XEmbeddedObject > xResult( - static_cast< ::cppu::OWeakObject* > ( new OleEmbeddedObject( m_xContext ) ), - uno::UNO_QUERY ); + new OleEmbeddedObject( m_xContext ) ); uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY_THROW ); xPersist->setPersistentEntry( xStorage,