summaryrefslogtreecommitdiff
path: root/stoc/source/corereflection/crcomp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-28 14:43:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-29 19:22:23 +0200
commitd32dfd9e955cdc893aa21ab8e870d217d1628ad3 (patch)
tree58662c8f4274fd4eb44177912d63b68516b1aae2 /stoc/source/corereflection/crcomp.cxx
parent307ee1357cf2c4acd2f3e5a90285e8cb7c4c14e2 (diff)
std::unique->std::optional
rather than having a pointer to a pointer (which is what Sequence is) Change-Id: Ieb7b9995f6a25022fe2401adc3c38124edb83506 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116376 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc/source/corereflection/crcomp.cxx')
-rw-r--r--stoc/source/corereflection/crcomp.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx
index ae15991ad017..51cf4a6f02e4 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -302,7 +302,7 @@ Sequence< Reference< XIdlClass > > CompoundIdlClassImpl::getSuperclasses()
Reference< XIdlField > CompoundIdlClassImpl::getField( const OUString & rName )
{
- if (! _pFields)
+ if (! m_xFields)
getFields(); // init fields
const OUString2Field::const_iterator iFind( _aName2Field.find( rName ) );
@@ -315,16 +315,15 @@ Reference< XIdlField > CompoundIdlClassImpl::getField( const OUString & rName )
Sequence< Reference< XIdlField > > CompoundIdlClassImpl::getFields()
{
::osl::MutexGuard aGuard( getMutexAccess() );
- if (! _pFields)
+ if (! m_xFields)
{
sal_Int32 nAll = 0;
typelib_CompoundTypeDescription * pCompTypeDescr = getTypeDescr();
for ( ; pCompTypeDescr; pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription )
nAll += pCompTypeDescr->nMembers;
- Sequence< Reference< XIdlField > > * pFields =
- new Sequence< Reference< XIdlField > >( nAll );
- Reference< XIdlField > * pSeq = pFields->getArray();
+ Sequence< Reference< XIdlField > > aFields( nAll );
+ Reference< XIdlField > * pSeq = aFields.getArray();
for ( pCompTypeDescr = getTypeDescr(); pCompTypeDescr;
pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription )
@@ -348,9 +347,9 @@ Sequence< Reference< XIdlField > > CompoundIdlClassImpl::getFields()
}
}
- _pFields.reset( pFields );
+ m_xFields = std::move( aFields );
}
- return *_pFields;
+ return *m_xFields;
}
}