diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-23 11:36:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-23 12:42:19 +0200 |
commit | 7bed47db29783677aa69aa2a54ab1f6ca8e810f6 (patch) | |
tree | 698729ab62d8fb827541d2309d17bb2b4e7a3d6b /dbaccess/source/ui/querydesign/QueryDesignView.cxx | |
parent | ff93e4977cb1e23f355d248a77e8d0e56bb0f4b9 (diff) |
loplugin:makeshared in dbaccess
Change-Id: If4208532d2905410a07b846afee46fba2fe1e549
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92748
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui/querydesign/QueryDesignView.cxx')
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 748eabb13f55..1ba9ca585e5d 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -132,25 +132,24 @@ namespace if ( !pConn ) { - OQueryTableConnectionData* pInfoData = new OQueryTableConnectionData(); - TTableConnectionData::value_type aInfoData(pInfoData); - pInfoData->InitFromDrag(_aDragLeft, _aDragRight); - pInfoData->SetJoinType(_eJoinType); + auto xInfoData = std::make_shared<OQueryTableConnectionData>(); + xInfoData->InitFromDrag(_aDragLeft, _aDragRight); + xInfoData->SetJoinType(_eJoinType); if ( _bNatural ) { - aInfoData->ResetConnLines(); - pInfoData->setNatural(_bNatural); + xInfoData->ResetConnLines(); + xInfoData->setNatural(_bNatural); try { - Reference<XNameAccess> xReferencedTableColumns(aInfoData->getReferencedTable()->getColumns()); - Sequence< OUString> aSeq = aInfoData->getReferencingTable()->getColumns()->getElementNames(); + Reference<XNameAccess> xReferencedTableColumns(xInfoData->getReferencedTable()->getColumns()); + Sequence< OUString> aSeq = xInfoData->getReferencingTable()->getColumns()->getElementNames(); const OUString* pIter = aSeq.getConstArray(); const OUString* pEnd = pIter + aSeq.getLength(); for(;pIter != pEnd;++pIter) { if ( xReferencedTableColumns->hasByName(*pIter) ) - aInfoData->AppendConnLine(*pIter,*pIter); + xInfoData->AppendConnLine(*pIter,*pIter); } } catch( const Exception& ) @@ -159,9 +158,9 @@ namespace } } - ScopedVclPtrInstance< OQueryTableConnection > aInfo(pTableView, aInfoData); + ScopedVclPtrInstance< OQueryTableConnection > aInfo(pTableView, xInfoData); // Because OQueryTableConnection never takes ownership of the data passed to it, but only remembers the pointer, - // this pointer to a local variable is not critical, as aInfoData and aInfo have the same lifetime + // this pointer to a local variable is not critical, as xInfoData and aInfo have the same lifetime pTableView->NotifyTabConnection( *aInfo ); } else |