diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-22 19:43:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-23 07:31:06 +0100 |
commit | 73cfa4945d1d429688a104240cf3268d3ce06029 (patch) | |
tree | a14561c53c22c64d850f4414ab1cd25edd161321 | |
parent | 239d3a850dd3bef82c050fd727f4dbd5cf8ae0af (diff) |
loplugin:refcounting in basctl
Change-Id: I22ddaee2b97af75c710df78542c27dca0730d0bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111352
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basctl/source/accessibility/accessibledialogcontrolshape.cxx | 11 | ||||
-rw-r--r-- | basctl/source/accessibility/accessibledialogwindow.cxx | 11 | ||||
-rw-r--r-- | basctl/source/dlged/dlged.cxx | 2 |
3 files changed, 9 insertions, 15 deletions
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 |