summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 11:36:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 13:51:29 +0200
commitdb17a874af37350b3270932175854ee674447bc1 (patch)
treefecc983fb75d3a4072cc7bd344fc824d548deb0d /dbaccess
parentdd8a400bbbb1b8d5592a870f2036a4df3d005a7d (diff)
convert std::map::insert to std::map::emplace II
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx5
-rw-r--r--dbaccess/source/core/dataaccess/definitioncontainer.cxx3
-rw-r--r--dbaccess/source/core/misc/DatabaseDataProvider.cxx2
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx4
5 files changed, 9 insertions, 12 deletions
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index f0dd27ebd7c5..f5e74a4c1b7f 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -646,11 +646,10 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _s
Sequence<Any> aArgs(1);
Reference<XConnection> xMy(this);
aArgs[0] <<= NamedValue("ActiveConnection",makeAny(xMy));
- aFind = m_aSupportServices.insert(
- TSupportServices::value_type(
+ aFind = m_aSupportServices.emplace(
_sServiceSpecifier,
m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceSpecifier, aArgs, m_aContext)
- )).first;
+ ).first;
}
return aFind->second;
}
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index c70e8d193714..131c183b6d06 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -104,8 +104,7 @@ ODefinitionContainer::ODefinitionContainer( const Reference< XComponentContext
++aDefinition
)
m_aDocuments.push_back(
- m_aDocumentMap.insert(
- Documents::value_type( aDefinition->first, Documents::mapped_type() ) ).first );
+ m_aDocumentMap.emplace(aDefinition->first, Documents::mapped_type() ).first );
}
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index d3a823b93a80..780db27d2a96 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -740,7 +740,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
const sal_Int32 columnIndex = col - aColumns.begin();
const OUString sRangeName = OUString::number( columnIndex );
- m_aNumberFormats.insert( std::map< OUString, uno::Any >::value_type( sRangeName, aNumberFormat ) );
+ m_aNumberFormats.emplace( sRangeName, aNumberFormat );
}
std::vector< OUString > aRowLabels;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 7152811bb81f..5ca003866e32 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1008,7 +1008,7 @@ void OCopyTableWizard::insertColumn(sal_Int32 _nPos,OFieldDescription* _pField)
}
m_aDestVec.insert(m_aDestVec.begin() + _nPos,
- m_vDestColumns.insert(ODatabaseExport::TColumns::value_type(_pField->GetName(),_pField)).first);
+ m_vDestColumns.emplace(_pField->GetName(),_pField).first);
m_mNameMapping[_pField->GetName()] = _pField->GetName();
}
}
@@ -1021,8 +1021,7 @@ void OCopyTableWizard::replaceColumn(sal_Int32 _nPos,OFieldDescription* _pField,
m_vDestColumns.erase(_sOldName);
OSL_ENSURE( m_vDestColumns.find(_pField->GetName()) == m_vDestColumns.end(),"Column with that name already exist!");
- m_aDestVec[_nPos] =
- m_vDestColumns.insert(ODatabaseExport::TColumns::value_type(_pField->GetName(),_pField)).first;
+ m_aDestVec[_nPos] = m_vDestColumns.emplace(_pField->GetName(),_pField).first;
}
}
@@ -1066,7 +1065,7 @@ void OCopyTableWizard::loadData( const ICopyTableSourceObject& _rSourceObject,
pTypeInfo = m_pTypeInfo;
pActFieldDescr->FillFromTypeInfo(pTypeInfo,true,false);
- _rColVector.push_back(_rColumns.insert(ODatabaseExport::TColumns::value_type(pActFieldDescr->GetName(),pActFieldDescr)).first);
+ _rColVector.push_back(_rColumns.emplace(pActFieldDescr->GetName(),pActFieldDescr).first);
}
// determine which columns belong to the primary key
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index e67123ae18aa..63be1bcc2569 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1022,7 +1022,7 @@ namespace
std::map<OTableWindow*,sal_Int32>::const_iterator aCountEnd = aConnectionCount.end();
for(;aCountIter != aCountEnd;++aCountIter)
{
- aMulti.insert(std::multimap<sal_Int32 , OTableWindow*>::value_type(aCountIter->second,aCountIter->first));
+ aMulti.emplace(aCountIter->second,aCountIter->first);
}
const bool bUseEscape = ::dbtools::getBooleanDataSourceSetting( _xConnection, PROPERTY_OUTERJOINESCAPE );
@@ -1161,7 +1161,7 @@ namespace
}
if ( aGroupByNames.find(sGroupByPart) == aGroupByNames.end() )
{
- aGroupByNames.insert(std::map< OUString,bool>::value_type(sGroupByPart,true));
+ aGroupByNames.emplace(sGroupByPart,true);
aGroupByStr += sGroupByPart + ",";
}
}