summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/QueryTableView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/querydesign/QueryTableView.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 67d2c8e3df31..79534d2f1ae7 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -130,8 +130,7 @@ namespace
// we found a table in our view where we can insert some connections
// the key columns have a property called RelatedColumn
// build OQueryTableConnectionData
- OQueryTableConnectionData* pNewConnData = new OQueryTableConnectionData( _rSource.GetData(), _rDest.GetData() );
- TTableConnectionData::value_type aNewConnData(pNewConnData);
+ auto xNewConnData = std::make_shared<OQueryTableConnectionData>( _rSource.GetData(), _rDest.GetData() );
OUString sRelatedColumn;
@@ -151,7 +150,7 @@ namespace
{
sal_Int32 nFindIndex = ::comphelper::findValue(_rSource.GetOriginalColumns()->getElementNames(),rElement);
if(nFindIndex != -1)
- pNewConnData->SetFieldIndex(JTCS_FROM,nFindIndex+1);
+ xNewConnData->SetFieldIndex(JTCS_FROM,nFindIndex+1);
else
OSL_FAIL("Column not found!");
}
@@ -161,14 +160,14 @@ namespace
{
sal_Int32 nFindIndex = ::comphelper::findValue(xRefColumns->getElementNames(),sRelatedColumn);
if(nFindIndex != -1)
- pNewConnData->SetFieldIndex(JTCS_TO,nFindIndex+1);
+ xNewConnData->SetFieldIndex(JTCS_TO,nFindIndex+1);
else
OSL_FAIL("Column not found!");
}
- pNewConnData->AppendConnLine(rElement,sRelatedColumn);
+ xNewConnData->AppendConnLine(rElement,sRelatedColumn);
// now add the Conn itself
- ScopedVclPtrInstance< OQueryTableConnection > aNewConn(_pView, aNewConnData);
+ ScopedVclPtrInstance< OQueryTableConnection > aNewConn(_pView, xNewConnData);
// referring to the local variable is not important, as NotifyQueryTabConn creates a new copy
// to add me (if not existent)
_pView->NotifyTabConnection(*aNewConn, false);
@@ -320,11 +319,11 @@ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn,
}
}
-OTableWindowData* OQueryTableView::CreateImpl(const OUString& _rComposedName
+std::shared_ptr<OTableWindowData> OQueryTableView::CreateImpl(const OUString& _rComposedName
,const OUString& _sTableName
,const OUString& _rWinName)
{
- return new OQueryTableWindowData( _rComposedName, _sTableName,_rWinName );
+ return std::make_shared<OQueryTableWindowData>( _rComposedName, _sTableName,_rWinName );
}
void OQueryTableView::AddTabWin(const OUString& _rTableName, const OUString& _rAliasName, bool bNewTable)
@@ -543,8 +542,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
if ( !pConn )
{
// new data object
- OQueryTableConnectionData* pNewConnectionData = new OQueryTableConnectionData(pSourceWin->GetData(), pDestWin->GetData());
- TTableConnectionData::value_type aNewConnectionData(pNewConnectionData);
+ auto xNewConnectionData = std::make_shared<OQueryTableConnectionData>(pSourceWin->GetData(), pDestWin->GetData());
sal_uInt32 nSourceFieldIndex, nDestFieldIndex;
@@ -555,12 +553,12 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
nDestFieldIndex = jxdDest.pListBox->GetModel()->GetAbsPos(jxdDest.pEntry);
// ... and set them
- pNewConnectionData->SetFieldIndex(JTCS_FROM, nSourceFieldIndex);
- pNewConnectionData->SetFieldIndex(JTCS_TO, nDestFieldIndex);
+ xNewConnectionData->SetFieldIndex(JTCS_FROM, nSourceFieldIndex);
+ xNewConnectionData->SetFieldIndex(JTCS_TO, nDestFieldIndex);
- pNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName );
+ xNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName );
- ScopedVclPtrInstance< OQueryTableConnection > aNewConnection(this, aNewConnectionData);
+ ScopedVclPtrInstance< OQueryTableConnection > aNewConnection(this, xNewConnectionData);
NotifyTabConnection(*aNewConnection);
// As usual with NotifyTabConnection, using a local variable is fine because a copy is made
}