loplugin:referencecasting in various

Change-Id: Id4e3d9d1bbfd47181299568afec45e996eb1eed5
Reviewed-on: https://gerrit.libreoffice.org/76071
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2019-07-21 14:46:06 +02:00
parent bac57f75cd
commit 01782ecd9f
10 changed files with 10 additions and 13 deletions

View File

@ -353,7 +353,7 @@ Reference< XView > SAL_CALL BaseControl::getView()
{
// Ready for multithreading
MutexGuard aGuard( m_aMutex );
return Reference< XView >( static_cast<OWeakObject*>(this), UNO_QUERY );
return this;
}
// XControl

View File

@ -111,8 +111,7 @@ Reference< XConnectionPoint > SAL_CALL OConnectionPointContainerHelper::queryCon
// Ready for multithreading
MutexGuard aGuard( m_aSharedMutex );
// If this container contains elements, build a connectionpoint-instance.
OConnectionPointHelper* pNewConnectionPoint = new OConnectionPointHelper( m_aSharedMutex, this, aType );
xConnectionPoint.set( static_cast<OWeakObject*>(pNewConnectionPoint), UNO_QUERY );
xConnectionPoint = new OConnectionPointHelper( m_aSharedMutex, this, aType );
}
return xConnectionPoint;

View File

@ -52,8 +52,7 @@ namespace anim
if( xEnumerationAccess.is() )
{
css::uno::Reference< css::container::XEnumeration >
xEnumeration( xEnumerationAccess->createEnumeration(),
css::uno::UNO_QUERY );
xEnumeration = xEnumerationAccess->createEnumeration();
if( xEnumeration.is() )
{

View File

@ -55,7 +55,7 @@ VclStatusListener<T>::VclStatusListener(T* widget, const OUString& aCommand) {
css::uno::Reference<css::frame::XFrame> xFrame(xDesktop->getActiveFrame());
if (!xFrame.is())
xFrame = css::uno::Reference<css::frame::XFrame>(xDesktop, css::uno::UNO_QUERY);
xFrame = xDesktop;
mxFrame = xFrame;

View File

@ -88,7 +88,7 @@ PropertyHelper_Hyphenation& Hyphenator::GetPropHelper_Impl()
{
if (!pPropHelper)
{
Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY );
Reference< XLinguProperties > xPropSet = GetLinguProperties();
pPropHelper.reset( new PropertyHelper_Hyphenation (static_cast<XHyphenator *>(this), xPropSet ) );
pPropHelper->AddAsPropListener(); //! after a reference is established

View File

@ -99,7 +99,7 @@ PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl()
{
if (!m_pPropHelper)
{
Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY );
Reference< XLinguProperties > xPropSet = GetLinguProperties();
m_pPropHelper.reset( new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ) );
m_pPropHelper->AddAsPropListener(); //! after a reference is established

View File

@ -90,7 +90,7 @@ PropertyHelper_Thesaurus& Thesaurus::GetPropHelper_Impl()
{
if (!pPropHelper)
{
Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY );
Reference< XLinguProperties > xPropSet = GetLinguProperties();
pPropHelper = new PropertyHelper_Thesaurus( static_cast<XThesaurus *>(this), xPropSet );
pPropHelper->AddAsPropListener(); //! after a reference is established

View File

@ -930,7 +930,7 @@ LifetimeController::LifetimeController (::sd::ViewShellBase& rBase)
acquire();
mbListeningToViewShellBase = true;
Reference<XComponent> xComponent (rBase.GetController(), UNO_QUERY);
Reference<XComponent> xComponent = rBase.GetController();
if (xComponent.is())
{
xComponent->addEventListener(this);

View File

@ -375,8 +375,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const OUString& aName )
uno::Any aResult;
uno::Reference< io::XStream > xTempFile(
io::TempFile::create(m_xContext), uno::UNO_QUERY );
uno::Reference< io::XStream > xTempFile = io::TempFile::create(m_xContext);
uno::Reference< io::XSeekable > xSeekable( xTempFile, uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xOutputStream = xTempFile->getOutputStream();
uno::Reference< io::XInputStream > xInputStream = xTempFile->getInputStream();

View File

@ -875,7 +875,7 @@ bool ImportContext::importGraphicOrImageProperty(
}
if (xGraphic.is())
{
Reference<beans::XPropertySet> xProps( getControlModel(), UNO_QUERY );
Reference<beans::XPropertySet> xProps = getControlModel();
if (xProps.is())
{
xProps->setPropertyValue("Graphic", makeAny(xGraphic));