diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 08:54:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 09:44:12 +0200 |
commit | 3428bd5fa3626844355f20997ba690fd04297982 (patch) | |
tree | 683256f95828e54edecdd87fbde0ce32a634a834 /dbaccess | |
parent | 9c5c905680f7cb58eb3d0fbf25725a50c17896da (diff) |
clang-tidy modernize-use-emplace in d*
Change-Id: I79ac90faf24b4c741545e411dbaea7826c2df531
Reviewed-on: https://gerrit.libreoffice.org/42150
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
25 files changed, 111 insertions, 114 deletions
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 49a36fdf12e3..6f9b1548026a 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -57,7 +57,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< { if (pTableFilters->indexOf('%') != -1) { - _rOut.push_back(WildCard(pTableFilters->replace('%', '*'))); + _rOut.emplace_back(pTableFilters->replace('%', '*')); } else { @@ -276,7 +276,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< const OUString* name = aNames.getConstArray(); const OUString* nameEnd = name + aNames.getLength(); for ( ; name != nameEnd; ++name ) - aUnfilteredTables.push_back( TableInfo( *name ) ); + aUnfilteredTables.emplace_back( *name ); reFill( lcl_filter( aUnfilteredTables, _rTableFilter, _rTableTypeFilter, m_xMetaData, m_xMasterContainer ) ); @@ -357,7 +357,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< sName = xCurrentRow->getString(3); sType = xCurrentRow->getString(4); - aUnfilteredTables.push_back( TableInfo( sCatalog, sSchema, sName, sType ) ); + aUnfilteredTables.emplace_back( sCatalog, sSchema, sName, sType ); } reFill( lcl_filter( aUnfilteredTables, diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 78eebe9c53cd..03aa81dab5f3 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1892,7 +1892,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi return this->getInsertValue(column); }); aColumnMap.insert(std::make_pair(sName,0)); - aColumns->get().push_back(pColumn); + aColumns->get().emplace_back(pColumn); pColumn->setName(sName); aNames.push_back(sName); m_aDataColumns.push_back(pColumn); @@ -1995,7 +1995,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi [this] (sal_Int32 const column) -> ORowSetValue const& { return this->getInsertValue(column); }); - aColumns->get().push_back(pColumn); + aColumns->get().emplace_back(pColumn); pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,makeAny(rKeyColumns.find(i) != rKeyColumns.end())); @@ -2096,7 +2096,7 @@ Reference< XResultSet > SAL_CALL ORowSet::createResultSet( ) { ORowSetClone* pClone = new ORowSetClone( m_aContext, *this, m_pMutex ); Reference< XResultSet > xRet(pClone); - m_aClones.push_back(WeakReferenceHelper(xRet)); + m_aClones.emplace_back(xRet); return xRet; } return Reference< XResultSet >(); @@ -2826,7 +2826,7 @@ ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowS [this] (sal_Int32 const column) -> ORowSetValue const& { return this->getValue(column); }); - aColumns->get().push_back(pColumn); + aColumns->get().emplace_back(pColumn); pColumn->setName(*pIter); aNames.push_back(*pIter); m_aDataColumns.push_back(pColumn); diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 8767e47b7e65..f51b8f2b0177 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -886,8 +886,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) if ( i > static_cast< sal_Int32>( aSelectColumns->get().size() ) ) { - aSelectColumns->get().push_back( - ::connectivity::parse::OParseColumn::createColumnForResultSet( xResultSetMeta, m_xMetaData, i ,aColumnNames) + aSelectColumns->get().emplace_back(::connectivity::parse::OParseColumn::createColumnForResultSet( xResultSetMeta, m_xMetaData, i ,aColumnNames) ); OSL_ENSURE( aSelectColumns->get().size() == (size_t)i, "OSingleSelectQueryComposer::getColumns: inconsistency!" ); } @@ -984,7 +983,7 @@ bool OSingleSelectQueryComposer::setORCriteria(OSQLParseNode const * pCondition, bResult = setORCriteria(pCondition->getChild(i), _rIterator, rFilters, xFormatter); else { - rFilters.push_back( std::vector < PropertyValue >()); + rFilters.emplace_back(); bResult = setANDCriteria(pCondition->getChild(i), _rIterator, rFilters[rFilters.size() - 1], xFormatter); } } @@ -992,7 +991,7 @@ bool OSingleSelectQueryComposer::setORCriteria(OSQLParseNode const * pCondition, } else { - rFilters.push_back(std::vector < PropertyValue >()); + rFilters.emplace_back(); return setANDCriteria(pCondition, _rIterator, rFilters[rFilters.size() - 1], xFormatter); } } diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx index e9d3af392ae8..00fcc6563ed3 100644 --- a/dbaccess/source/core/api/StaticSet.cxx +++ b/dbaccess/source/core/api/StaticSet.cxx @@ -279,7 +279,7 @@ void OStaticSet::reset(const Reference< XResultSet> &_xDriverSet) } m_aSetIter = m_aSet.end(); m_bEnd = false; - m_aSet.push_back(nullptr); // this is the beforefirst record + m_aSet.emplace_back(nullptr); // this is the beforefirst record } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index f5e74a4c1b7f..95ca9106abac 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -125,7 +125,7 @@ Reference< XStatement > OConnection::createStatement() if ( xMasterStatement.is() ) { xStatement = new OStatement(this, xMasterStatement); - m_aStatements.push_back(WeakReferenceHelper(xStatement)); + m_aStatements.emplace_back(xStatement); } return xStatement; } @@ -141,7 +141,7 @@ Reference< XPreparedStatement > OConnection::prepareStatement(const OUString& s if ( xMasterStatement.is() ) { xStatement = new OPreparedStatement(this, xMasterStatement); - m_aStatements.push_back(WeakReferenceHelper(xStatement)); + m_aStatements.emplace_back(xStatement); } return xStatement; } @@ -156,7 +156,7 @@ Reference< XPreparedStatement > OConnection::prepareCall(const OUString& sql) if ( xMasterStatement.is() ) { xStatement = new OCallableStatement(this, xMasterStatement); - m_aStatements.push_back(WeakReferenceHelper(xStatement)); + m_aStatements.emplace_back(xStatement); } return xStatement; } @@ -516,7 +516,7 @@ Reference< XSQLQueryComposer > OConnection::createQueryComposer() // Reference< XNumberFormatsSupplier > xSupplier = pParent->getNumberFormatsSupplier(); Reference< XSQLQueryComposer > xComposer( new OQueryComposer( this ) ); - m_aComposers.push_back(WeakReferenceHelper(xComposer)); + m_aComposers.emplace_back(xComposer); return xComposer; } @@ -634,7 +634,7 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _s if ( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER == _sServiceSpecifier || _sServiceSpecifier == "com.sun.star.sdb.SingleSelectQueryAnalyzer" ) { xRet = new OSingleSelectQueryComposer( getTables(),this, m_aContext ); - m_aComposers.push_back(WeakReferenceHelper(xRet)); + m_aComposers.emplace_back(xRet); } else { diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 0fb4ff6ce000..c8ecdb5daf4c 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -1146,7 +1146,7 @@ Reference< XConnection > ODatabaseSource::getConnection(const OUString& user, co Reference< XComponent> xComp(xConn,UNO_QUERY); if ( xComp.is() ) xComp->addEventListener( static_cast< XContainerListener* >( this ) ); - m_pImpl->m_aConnections.push_back(css::uno::WeakReference< css::sdbc::XConnection >(xConn)); + m_pImpl->m_aConnections.emplace_back(xConn); } return xConn; diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 780db27d2a96..2f06de097706 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -702,12 +702,12 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor if ( _bHasCategories && aColumns.empty() ) { if ( aRowSetColumnNames.getLength() ) - aColumns.push_back( ColumnDescription( aRowSetColumnNames[0] ) ); + aColumns.emplace_back( aRowSetColumnNames[0] ); else - aColumns.push_back( ColumnDescription( sColumnName ) ); + aColumns.emplace_back( sColumnName ); bFirstColumnIsCategory = true; } - aColumns.push_back( ColumnDescription( sColumnName ) ); + aColumns.emplace_back( sColumnName ); } } if ( aColumns.empty() ) diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index 349c95d2b35d..ae45e55098b9 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -93,7 +93,7 @@ namespace dbmm _out_rControllers.clear(); Reference< XEnumeration > xControllerEnum( _rxDocument->getControllers(), UNO_SET_THROW ); while ( xControllerEnum->hasMoreElements() ) - _out_rControllers.push_back( Reference< XController2 >( xControllerEnum->nextElement(), UNO_QUERY_THROW ) ); + _out_rControllers.emplace_back( xControllerEnum->nextElement(), UNO_QUERY_THROW ); } // MacroMigrationDialog_Data @@ -470,7 +470,7 @@ namespace dbmm throw CloseVetoException(); } - aViews.push_back( ViewDescriptor( xFrame, sViewName ) ); + aViews.emplace_back( xFrame, sViewName ); xFrame->setComponent( nullptr, nullptr ); xController->dispose(); } diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index ebfe416d28e5..af555f5fe2a9 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -987,7 +987,7 @@ namespace dbmm OSL_ENSURE( xCommandProcessor.is(), "lcl_collectHierarchicalElementNames_throw: no container, and no command processor? What *is* it, then?!" ); if ( xCommandProcessor.is() ) { - _out_rDocs.push_back( SubDocument( xCommandProcessor, sElementName, _eType, ++_io_counter ) ); + _out_rDocs.emplace_back( xCommandProcessor, sElementName, _eType, ++_io_counter ); } } } diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx index 1346999440fe..65bd539236b8 100644 --- a/dbaccess/source/ext/macromigration/migrationlog.cxx +++ b/dbaccess/source/ext/macromigration/migrationlog.cxx @@ -144,7 +144,7 @@ namespace dbmm "MigrationLog::movedLibrary: document is not known!" ); DocumentEntry& rDocEntry = m_pData->aDocumentLogs[ _nDocID ]; - rDocEntry.aMovedLibraries.push_back( LibraryEntry( _eScriptType, _rOriginalLibName, _rNewLibName ) ); + rDocEntry.aMovedLibraries.emplace_back( _eScriptType, _rOriginalLibName, _rNewLibName ); } void MigrationLog::finishedDocument( const DocumentID _nDocID ) @@ -191,17 +191,17 @@ namespace dbmm { case ERR_OPENING_SUB_DOCUMENT_FAILED: pAsciiErrorDescription = "opening '#doc#' failed"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_CLOSING_SUB_DOCUMENT_FAILED: pAsciiErrorDescription = "closing '#doc#' failed"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_STORAGE_COMMIT_FAILED: pAsciiErrorDescription = "committing the changes for document '#doc#' failed"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_STORING_DATABASEDOC_FAILED: @@ -214,52 +214,52 @@ namespace dbmm case ERR_UNEXPECTED_LIBSTORAGE_ELEMENT: pAsciiErrorDescription = "unexpected #lib# storage element in document '#doc#', named '#element#'"; - aParameterNames.push_back(OUString("#doc#")); - aParameterNames.push_back(OUString("#libstore#")); - aParameterNames.push_back(OUString("#element#")); + aParameterNames.emplace_back("#doc#"); + aParameterNames.emplace_back("#libstore#"); + aParameterNames.emplace_back("#element#"); break; case ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED: pAsciiErrorDescription = "creating the database document's storage for #scripttype# scripts failed"; - aParameterNames.push_back(OUString("#scripttype#")); + aParameterNames.emplace_back("#scripttype#"); break; case ERR_COMMITTING_SCRIPT_STORAGES_FAILED: pAsciiErrorDescription = "saving the #scripttype# scripts for document '#doc#' failed"; - aParameterNames.push_back(OUString("#scripttype#")); - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#scripttype#"); + aParameterNames.emplace_back("#doc#"); break; case ERR_GENERAL_SCRIPT_MIGRATION_FAILURE: pAsciiErrorDescription = "general error while migrating #scripttype# scripts of document '#doc#'"; - aParameterNames.push_back(OUString("#scripttype#")); - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#scripttype#"); + aParameterNames.emplace_back("#doc#"); break; case ERR_GENERAL_MACRO_MIGRATION_FAILURE: pAsciiErrorDescription = "general error during macro migration of document '#doc#'"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_UNKNOWN_SCRIPT_TYPE: pAsciiErrorDescription = "unknown script type: #type#"; - aParameterNames.push_back(OUString("#type#")); + aParameterNames.emplace_back("#type#"); break; case ERR_UNKNOWN_SCRIPT_LANGUAGE: pAsciiErrorDescription = "unknown script language: #lang#"; - aParameterNames.push_back(OUString("#lang#")); + aParameterNames.emplace_back("#lang#"); break; case ERR_UNKNOWN_SCRIPT_NAME_FORMAT: pAsciiErrorDescription = "unknown script name format: #script#"; - aParameterNames.push_back(OUString("#script#")); + aParameterNames.emplace_back("#script#"); break; case ERR_SCRIPT_TRANSLATION_FAILURE: pAsciiErrorDescription = "analyzing/translating the script URL failed; script type: #type#; script: #code#"; - aParameterNames.push_back(OUString("#type#")); - aParameterNames.push_back(OUString("#code#")); + aParameterNames.emplace_back("#type#"); + aParameterNames.emplace_back("#code#"); break; case ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT: @@ -268,57 +268,57 @@ namespace dbmm case ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED: pAsciiErrorDescription = "adjusting events for document '#doc#' failed"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_ADJUSTING_DIALOG_EVENTS_FAILED: pAsciiErrorDescription = "adjusting events for dialog #lib#.#dlg# in document '#doc#' failed"; - aParameterNames.push_back(OUString("#doc#")); - aParameterNames.push_back(OUString("#lib#")); - aParameterNames.push_back(OUString("#dlg#")); + aParameterNames.emplace_back("#doc#"); + aParameterNames.emplace_back("#lib#"); + aParameterNames.emplace_back("#dlg#"); break; case ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED: pAsciiErrorDescription = "adjusting form component events for '#doc#' failed"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_BIND_SCRIPT_STORAGE_FAILED: pAsciiErrorDescription = "binding to the script storage failed for document '#doc#'"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_REMOVE_SCRIPTS_STORAGE_FAILED: pAsciiErrorDescription = "removing a scripts storage failed for document '#doc#'"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_DOCUMENT_BACKUP_FAILED: pAsciiErrorDescription = "backing up the document to #location# failed"; - aParameterNames.push_back(OUString("#location#")); + aParameterNames.emplace_back("#location#"); break; case ERR_UNKNOWN_SCRIPT_FOLDER: pAsciiErrorDescription = "unknown script folder '#name#' in document '#doc#'"; - aParameterNames.push_back(OUString("#doc#")); - aParameterNames.push_back(OUString("#name#")); + aParameterNames.emplace_back("#doc#"); + aParameterNames.emplace_back("#name#"); break; case ERR_EXAMINING_SCRIPTS_FOLDER_FAILED: pAsciiErrorDescription = "examining the 'Scripts' folder failed for document '#doc#'"; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; case ERR_PASSWORD_VERIFICATION_FAILED: pAsciiErrorDescription = "password verification failed for document '#doc#', #libtype# library '#name#'"; - aParameterNames.push_back(OUString("#doc#")); - aParameterNames.push_back(OUString("#libtype#")); - aParameterNames.push_back(OUString("#name#")); + aParameterNames.emplace_back("#doc#"); + aParameterNames.emplace_back("#libtype#"); + aParameterNames.emplace_back("#name#"); break; case ERR_NEW_STYLE_REPORT: pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Oracle Report Builder (TM) extension installed."; - aParameterNames.push_back(OUString("#doc#")); + aParameterNames.emplace_back("#doc#"); break; // do *not* add a default case here: Without a default, some compilers will warn you when diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 7090008dda71..ddc71f1eea60 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -458,8 +458,8 @@ void ODBExport::exportDataSource() { if ( !aDriverSupportedProperties.has(pProperties->Name) || aDriverSupportedProperties.get(pProperties->Name) != aValue ) { - m_aDataSourceSettings.push_back( TypedPropertyValue( - pProperties->Name, pProperties->Type, aValue ) ); + m_aDataSourceSettings.emplace_back( + pProperties->Name, pProperties->Type, aValue ); } continue; } diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index fc733502ba33..07ef9d90f928 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -696,7 +696,7 @@ void OApplicationController::doAction(sal_uInt16 _nId, const ElementOpenMode _eO else { Reference< XModel > xModel( openElementWithArguments( *aIter, eType, eOpenMode, _nId,aArguments ), UNO_QUERY ); - aComponents.push_back( std::pair< OUString, Reference< XModel > >( *aIter, xModel ) ); + aComponents.emplace_back( *aIter, xModel ); } } diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index eac3e20a74ad..0adba4a0d054 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -669,28 +669,28 @@ void OApplicationDetailView::impl_fillTaskPaneData( ElementType _eType, TaskPane switch ( _eType ) { case E_TABLE: - rList.push_back( TaskEntry( ".uno:DBNewTable", RID_STR_TABLES_HELP_TEXT_DESIGN, RID_STR_NEW_TABLE ) ); - rList.push_back( TaskEntry( ".uno:DBNewTableAutoPilot", RID_STR_TABLES_HELP_TEXT_WIZARD, RID_STR_NEW_TABLE_AUTO ) ); - rList.push_back( TaskEntry( ".uno:DBNewView", RID_STR_VIEWS_HELP_TEXT_DESIGN, RID_STR_NEW_VIEW, true ) ); + rList.emplace_back( ".uno:DBNewTable", RID_STR_TABLES_HELP_TEXT_DESIGN, RID_STR_NEW_TABLE ); + rList.emplace_back( ".uno:DBNewTableAutoPilot", RID_STR_TABLES_HELP_TEXT_WIZARD, RID_STR_NEW_TABLE_AUTO ); + rList.emplace_back( ".uno:DBNewView", RID_STR_VIEWS_HELP_TEXT_DESIGN, RID_STR_NEW_VIEW, true ); _rData.pTitleId = RID_STR_TABLES_CONTAINER; break; case E_FORM: - rList.push_back( TaskEntry( ".uno:DBNewForm", RID_STR_FORMS_HELP_TEXT, RID_STR_NEW_FORM ) ); - rList.push_back( TaskEntry( ".uno:DBNewFormAutoPilot", RID_STR_FORMS_HELP_TEXT_WIZARD, RID_STR_NEW_FORM_AUTO ) ); + rList.emplace_back( ".uno:DBNewForm", RID_STR_FORMS_HELP_TEXT, RID_STR_NEW_FORM ); + rList.emplace_back( ".uno:DBNewFormAutoPilot", RID_STR_FORMS_HELP_TEXT_WIZARD, RID_STR_NEW_FORM_AUTO ); _rData.pTitleId = RID_STR_FORMS_CONTAINER; break; case E_REPORT: - rList.push_back( TaskEntry( ".uno:DBNewReport", RID_STR_REPORT_HELP_TEXT, RID_STR_NEW_REPORT, true ) ); - rList.push_back( TaskEntry( ".uno:DBNewReportAutoPilot", RID_STR_REPORTS_HELP_TEXT_WIZARD, RID_STR_NEW_REPORT_AUTO ) ); + rList.emplace_back( ".uno:DBNewReport", RID_STR_REPORT_HELP_TEXT, RID_STR_NEW_REPORT, true ); + rList.emplace_back( ".uno:DBNewReportAutoPilot", RID_STR_REPORTS_HELP_TEXT_WIZARD, RID_STR_NEW_REPORT_AUTO ); _rData.pTitleId = RID_STR_REPORTS_CONTAINER; break; case E_QUERY: - rList.push_back( TaskEntry( ".uno:DBNewQuery", RID_STR_QUERIES_HELP_TEXT, RID_STR_NEW_QUERY ) ); - rList.push_back( TaskEntry( ".uno:DBNewQueryAutoPilot", RID_STR_QUERIES_HELP_TEXT_WIZARD, RID_STR_NEW_QUERY_AUTO ) ); - rList.push_back( TaskEntry( ".uno:DBNewQuerySql", RID_STR_QUERIES_HELP_TEXT_SQL, RID_STR_NEW_QUERY_SQL ) ); + rList.emplace_back( ".uno:DBNewQuery", RID_STR_QUERIES_HELP_TEXT, RID_STR_NEW_QUERY ); + rList.emplace_back( ".uno:DBNewQueryAutoPilot", RID_STR_QUERIES_HELP_TEXT_WIZARD, RID_STR_NEW_QUERY_AUTO ); + rList.emplace_back( ".uno:DBNewQuerySql", RID_STR_QUERIES_HELP_TEXT_SQL, RID_STR_NEW_QUERY_SQL ); _rData.pTitleId = RID_STR_QUERIES_CONTAINER; break; diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 4cc6913b0866..7a88101dc993 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1831,7 +1831,7 @@ void SbaXDataBrowserController::ExecuteSearch() if ( pFact ) { std::vector< OUString > aContextNames; - aContextNames.push_back( OUString("Standard") ); + aContextNames.emplace_back("Standard" ); pDialog = pFact->CreateFmSearchDialog(getBrowserView(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest)); } OSL_ENSURE( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index e7fed3d2f993..70d99d28a3da 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -421,7 +421,7 @@ namespace if ( _rFeatureState.aValue.hasValue() ) _out_rStates.push_back( _rFeatureState.aValue ); if ( _out_rStates.empty() ) - _out_rStates.push_back( Any() ); + _out_rStates.emplace_back( ); } } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index c2078eb2bd54..020a71ecb8de 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -690,15 +690,15 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm case DataType::BOOLEAN: { aCurrentModelType = "CheckBox"; - aInitialValues.push_back( NamedValue( "VisualEffect", makeAny( VisualEffect::FLAT ) ) ); + aInitialValues.emplace_back( "VisualEffect", makeAny( VisualEffect::FLAT ) ); sDefaultProperty = PROPERTY_DEFAULTSTATE; sal_Int32 nNullable = ColumnValue::NULLABLE_UNKNOWN; OSL_VERIFY( xColumn->getPropertyValue( PROPERTY_ISNULLABLE ) >>= nNullable ); - aInitialValues.push_back( NamedValue( + aInitialValues.emplace_back( "TriState", makeAny( ColumnValue::NO_NULLS != nNullable ) - ) ); + ); if ( ColumnValue::NO_NULLS == nNullable ) aDefault <<= (sal_Int16)TRISTATE_FALSE; } @@ -706,7 +706,7 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm case DataType::LONGVARCHAR: case DataType::CLOB: - aInitialValues.push_back( NamedValue( "MultiLine", makeAny( true ) ) ); + aInitialValues.emplace_back( "MultiLine", makeAny( true ) ); SAL_FALLTHROUGH; case DataType::BINARY: case DataType::VARBINARY: @@ -724,19 +724,19 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm sDefaultProperty = PROPERTY_EFFECTIVEDEFAULT; if ( xSupplier.is() ) - aInitialValues.push_back( NamedValue( "FormatsSupplier", makeAny( xSupplier ) ) ); - aInitialValues.push_back( NamedValue( "TreatAsNumber", makeAny( bFormattedIsNumeric ) ) ); - aCopyProperties.push_back( PROPERTY_FORMATKEY ); + aInitialValues.emplace_back( "FormatsSupplier", makeAny( xSupplier ) ); + aInitialValues.emplace_back( "TreatAsNumber", makeAny( bFormattedIsNumeric ) ); + aCopyProperties.emplace_back(PROPERTY_FORMATKEY ); break; } - aInitialValues.push_back( NamedValue( PROPERTY_CONTROLSOURCE, makeAny( *pIter ) ) ); + aInitialValues.emplace_back( PROPERTY_CONTROLSOURCE, makeAny( *pIter ) ); OUString sLabel; xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if ( !sLabel.isEmpty() ) - aInitialValues.push_back( NamedValue( PROPERTY_LABEL, makeAny( sLabel ) ) ); + aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( sLabel ) ); else - aInitialValues.push_back( NamedValue( PROPERTY_LABEL, makeAny( *pIter ) ) ); + aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( *pIter ) ); Reference< XPropertySet > xGridCol( xColFactory->createColumn( aCurrentModelType ), UNO_SET_THROW ); Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW ); @@ -756,11 +756,11 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm } if ( aDefault.hasValue() ) - aInitialValues.push_back( NamedValue( sDefaultProperty, aDefault ) ); + aInitialValues.emplace_back( sDefaultProperty, aDefault ); // transfer properties from the definition to the UNO-model : - aCopyProperties.push_back( PROPERTY_HIDDEN ); - aCopyProperties.push_back( PROPERTY_WIDTH ); + aCopyProperties.emplace_back(PROPERTY_HIDDEN ); + aCopyProperties.emplace_back(PROPERTY_WIDTH ); // help text to display for the column Any aDescription; @@ -772,18 +772,18 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm xColumn->getPropertyValue( PROPERTY_DESCRIPTION ) >>= sTemp; aDescription <<= sTemp; - aInitialValues.push_back( NamedValue( PROPERTY_HELPTEXT, aDescription ) ); + aInitialValues.emplace_back( PROPERTY_HELPTEXT, aDescription ); // ... horizontal justify Any aAlign; aAlign <<= sal_Int16( 0 ); Any aColAlign( xColumn->getPropertyValue( PROPERTY_ALIGN ) ); if ( aColAlign.hasValue() ) aAlign <<= sal_Int16( ::comphelper::getINT32( aColAlign ) ); - aInitialValues.push_back( NamedValue( PROPERTY_ALIGN, aAlign ) ); + aInitialValues.emplace_back( PROPERTY_ALIGN, aAlign ); // don't allow the mouse to scroll in the cells if ( xGridColPSI->hasPropertyByName( PROPERTY_MOUSE_WHEEL_BEHAVIOR ) ) - aInitialValues.push_back( NamedValue( PROPERTY_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ) ); + aInitialValues.emplace_back( PROPERTY_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ); // now set all those values for ( std::vector< NamedValue >::const_iterator property = aInitialValues.begin(); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 7f8abfb129f8..6214f73aaf43 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -232,7 +232,7 @@ namespace dbaui rLines.push_back(new OConnectionLineData()); nRow = rLines.size() - 1; // add new past-rLines row - m_ops.push_back(make_pair(INSERT, make_pair(nRow+1, nRow+2))); + m_ops.emplace_back(INSERT, make_pair(nRow+1, nRow+2)); } OConnectionLineDataRef pConnLineData = rLines[nRow]; @@ -255,8 +255,8 @@ namespace dbaui OConnectionLineDataVec::size_type line = m_pConnData->normalizeLines(); const OConnectionLineDataVec::size_type newSize = m_pConnData->GetConnLineDataList().size(); assert(newSize <= oldSize); - m_ops.push_back(make_pair(MODIFY, make_pair(line, newSize))); - m_ops.push_back(make_pair(DELETE, make_pair(newSize, oldSize))); + m_ops.emplace_back(MODIFY, make_pair(line, newSize)); + m_ops.emplace_back(DELETE, make_pair(newSize, oldSize)); return true; } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 92d0a7d2ec8f..518c24af3e05 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -220,9 +220,8 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal // user: DSID_USER -> "user" const SfxStringItem* pUser = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_USER); if (pUser && pUser->GetValue().getLength()) - aReturn.push_back( - PropertyValue( "user", 0, - makeAny(pUser->GetValue()), PropertyState_DIRECT_VALUE)); + aReturn.emplace_back( "user", 0, + makeAny(pUser->GetValue()), PropertyState_DIRECT_VALUE); // check if the connection type requires a password if (hasAuthentication(*m_pItemSetHelper->getOutputSet())) @@ -306,9 +305,8 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal } if (!sPassword.isEmpty()) - aReturn.push_back( - PropertyValue( "password", 0, - makeAny(sPassword), PropertyState_DIRECT_VALUE)); + aReturn.emplace_back( "password", 0, + makeAny(sPassword), PropertyState_DIRECT_VALUE); } if ( !aReturn.empty() ) diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 7e909b93176e..4c05e8664599 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -312,11 +312,11 @@ void ODbaseIndexDialog::Init() OUString aExt = aURL.getExtension(); if (aExt == aIndexExt) { - m_aFreeIndexList.push_back( OTableIndex(aURL.getName()) ); + m_aFreeIndexList.emplace_back(aURL.getName() ); } else if (aExt == aTableExt) { - m_aTableInfoList.push_back( OTableInfo(aURL.getName()) ); + m_aTableInfoList.emplace_back(aURL.getName() ); OTableInfo& rTabInfo = m_aTableInfoList.back(); // open the INF file @@ -341,7 +341,7 @@ void ODbaseIndexDialog::Init() if (aNDX == "NDX") { aEntry = OStringToOUString(aInfFile.ReadKey(aKeyName), osl_getThreadTextEncoding()); - rTabInfo.aIndexList.push_back( OTableIndex( aEntry ) ); + rTabInfo.aIndexList.emplace_back( aEntry ); // and remove it from the free index list aUsedIndexes.push_back(aEntry); diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 3cdadd9c3e78..d462f16d81b1 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -128,7 +128,7 @@ namespace dbaui if ( m_pDatasourceType->GetEntryPos( sDisplayName ) == LISTBOX_ENTRY_NOTFOUND && approveDatasourceType( sURLPrefix, sDisplayName ) ) { - aDisplayedTypes.push_back( DisplayedTypes::value_type( sURLPrefix, sDisplayName ) ); + aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName ); } } } @@ -167,7 +167,7 @@ namespace dbaui if ( m_pEmbeddedDBType->GetEntryPos( sDisplayName ) == LISTBOX_ENTRY_NOTFOUND && dbaccess::ODsnTypeCollection::isEmbeddedDatabase( sURLPrefix ) ) { - aDisplayedTypes.push_back( DisplayedTypes::value_type( sURLPrefix, sDisplayName ) ); + aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName ); } } } diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 6eafc8a30366..7545c7e62392 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -393,7 +393,7 @@ namespace dbaui if (!sSelectedEntry.isEmpty() && (nCurrentRow == rowCount - 1) /*&& (!m_nMaxColumnsInIndex || rowCount < m_nMaxColumnsInIndex )*/ ) { // in the last row, an non-empty string has been selected // -> insert a new row - m_aFields.push_back(OIndexField()); + m_aFields.emplace_back(); RowInserted(GetRowCount()); Invalidate(GetRowRectPixel(nCurrentRow)); } diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index 57b8fcb63305..0570a5cd1ff3 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -667,7 +667,7 @@ void ODatabaseExport::CreateDefaultColumn(const OUString& _rColumnName) m_aDestColumns.erase(aFind); } - m_vDestVector.push_back(m_aDestColumns.emplace(aAlias,pField).first); + m_vDestVector.emplace_back(m_aDestColumns.emplace(aAlias,pField).first); } bool ODatabaseExport::createRowSet() diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 5ca003866e32..e5e18edbe541 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -616,7 +616,7 @@ OCopyTableWizard::OCopyTableWizard( vcl::Window* pParent, const OUString& _rDefa ODatabaseExport::TColumnVector::const_iterator aEnd = _rSourceColVec.end(); for (; aIter != aEnd ; ++aIter) { - m_vSourceVec.push_back(m_vSourceColumns.find((*aIter)->first)); + m_vSourceVec.emplace_back(m_vSourceColumns.find((*aIter)->first)); } ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); @@ -781,7 +781,7 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos) m_bAddPKFirstTime = false; insertColumn(0,pField); } - m_vColumnPos.push_back(ODatabaseExport::TPositions::value_type(1,1)); + m_vColumnPos.emplace_back(1,1); m_vColumnTypes.push_back(pTypeInfo->nType); } } @@ -798,12 +798,12 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos) { ODatabaseExport::TColumnVector::const_iterator aFind = std::find(m_aDestVec.begin(),m_aDestVec.end(),aDestIter); sal_Int32 nPos = (aFind - m_aDestVec.begin())+1; - m_vColumnPos.push_back(ODatabaseExport::TPositions::value_type(nPos,nPos)); + m_vColumnPos.emplace_back(nPos,nPos); m_vColumnTypes.push_back((*aFind)->second->GetType()); } else { - m_vColumnPos.push_back( ODatabaseExport::TPositions::value_type( COLUMN_POSITION_NOT_FOUND, COLUMN_POSITION_NOT_FOUND ) ); + m_vColumnPos.emplace_back( COLUMN_POSITION_NOT_FOUND, COLUMN_POSITION_NOT_FOUND ); m_vColumnTypes.push_back(0); } } @@ -827,7 +827,7 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos) // now create a column insertColumn(m_vDestColumns.size(),pField); - m_vColumnPos.push_back(ODatabaseExport::TPositions::value_type(m_vDestColumns.size(),m_vDestColumns.size())); + m_vColumnPos.emplace_back(m_vDestColumns.size(),m_vDestColumns.size()); m_vColumnTypes.push_back((*aSrcIter)->second->GetType()); } } @@ -1065,7 +1065,7 @@ void OCopyTableWizard::loadData( const ICopyTableSourceObject& _rSourceObject, pTypeInfo = m_pTypeInfo; pActFieldDescr->FillFromTypeInfo(pTypeInfo,true,false); - _rColVector.push_back(_rColumns.emplace(pActFieldDescr->GetName(),pActFieldDescr).first); + _rColVector.emplace_back(_rColumns.emplace(pActFieldDescr->GetName(),pActFieldDescr).first); } // determine which columns belong to the primary key diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 9061365658c5..14d89cd448d5 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -1563,7 +1563,7 @@ void OJoinTableView::addConnection(OTableConnection* _pConnection,bool _bAddData #endif m_pView->getController().getTableConnectionData().push_back(_pConnection->GetData()); } - m_vTableConnection.push_back(_pConnection); + m_vTableConnection.emplace_back(_pConnection); _pConnection->RecalcLines(); _pConnection->InvalidateConnection(); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 3a56c45f912a..1ab8782d4034 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1581,13 +1581,13 @@ static std::vector< CommentStrip > getComment( const OUString& rQuery ) { bComment2 = false; aBuf.append( &pCopy[++i], 1); - aRet.push_back( CommentStrip( aBuf.makeStringAndClear(), false)); + aRet.emplace_back( aBuf.makeStringAndClear(), false); } } else { // comment can't close anymore, actually an error, but.. - aRet.push_back( CommentStrip( aBuf.makeStringAndClear(), false)); + aRet.emplace_back( aBuf.makeStringAndClear(), false); } continue; } @@ -1597,7 +1597,7 @@ static std::vector< CommentStrip > getComment( const OUString& rQuery ) { if (i == nQueryLen-1 && pCopy[i] != '\n') aBuf.append( &pCopy[i], 1); - aRet.push_back( CommentStrip( aBuf.makeStringAndClear(), true)); + aRet.emplace_back( aBuf.makeStringAndClear(), true); bComment = false; } else if (!aRet.empty()) |