basctl/source/accessibility/accessibledialogcontrolshape.cxx | 11 ++++------- basctl/source/accessibility/accessibledialogwindow.cxx | 11 ++++------- basctl/source/dlged/dlged.cxx | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-)
New commits: commit 73cfa4945d1d429688a104240cf3268d3ce06029 Author: Noel <noel.gran...@collabora.co.uk> AuthorDate: Mon Feb 22 19:43:49 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Feb 23 07:31:06 2021 +0100 loplugin:refcounting in basctl Change-Id: I22ddaee2b97af75c710df78542c27dca0730d0bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111352 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx index 949c8fa86c69..f885ff4bda1b 100644 --- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx +++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx @@ -393,9 +393,7 @@ Reference< XAccessibleRelationSet > AccessibleDialogControlShape::getAccessibleR { OExternalLockGuard aGuard( this ); - utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper; - Reference< XAccessibleRelationSet > xSet = pRelationSetHelper; - return xSet; + return new utl::AccessibleRelationSetHelper; } @@ -403,8 +401,7 @@ Reference< XAccessibleStateSet > AccessibleDialogControlShape::getAccessibleStat { OExternalLockGuard aGuard( this ); - utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper; - Reference< XAccessibleStateSet > xSet = pStateSetHelper; + rtl::Reference<utl::AccessibleStateSetHelper> pStateSetHelper = new utl::AccessibleStateSetHelper; if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) { @@ -415,7 +412,7 @@ Reference< XAccessibleStateSet > AccessibleDialogControlShape::getAccessibleStat pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); } - return xSet; + return pStateSetHelper; } @@ -506,7 +503,7 @@ Reference< awt::XFont > AccessibleDialogControlShape::getFont( ) aFont = pWindow->GetControlFont(); else aFont = pWindow->GetFont(); - VCLXFont* pVCLXFont = new VCLXFont; + rtl::Reference<VCLXFont> pVCLXFont = new VCLXFont; pVCLXFont->Init( *xDev, aFont ); xFont = pVCLXFont; } diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index eeb43b4f0c8b..0b641c8aca5e 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -668,9 +668,7 @@ Reference< XAccessibleRelationSet > AccessibleDialogWindow::getAccessibleRelatio { OExternalLockGuard aGuard( this ); - utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper; - Reference< XAccessibleRelationSet > xSet = pRelationSetHelper; - return xSet; + return new utl::AccessibleRelationSetHelper; } @@ -678,8 +676,7 @@ Reference< XAccessibleStateSet > AccessibleDialogWindow::getAccessibleStateSet( { OExternalLockGuard aGuard( this ); - utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper; - Reference< XAccessibleStateSet > xSet = pStateSetHelper; + rtl::Reference<utl::AccessibleStateSetHelper> pStateSetHelper = new utl::AccessibleStateSetHelper; if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) { @@ -690,7 +687,7 @@ Reference< XAccessibleStateSet > AccessibleDialogWindow::getAccessibleStateSet( pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); } - return xSet; + return pStateSetHelper; } @@ -801,7 +798,7 @@ Reference< awt::XFont > AccessibleDialogWindow::getFont( ) aFont = m_pDialogWindow->GetControlFont(); else aFont = m_pDialogWindow->GetFont(); - VCLXFont* pVCLXFont = new VCLXFont; + rtl::Reference<VCLXFont> pVCLXFont = new VCLXFont; pVCLXFont->Init( *xDev, aFont ); xFont = pVCLXFont; } diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index f99dab40d4c3..d74d375357ce 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -748,7 +748,7 @@ void DlgEditor::Copy() {} } - DlgEdTransferableImpl* pTrans = nullptr; + rtl::Reference<DlgEdTransferableImpl> pTrans; if( xStringResourcePersistence.is() ) { // With resource, support old and new format _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits