accessibility/source/extended/textwindowaccessibility.cxx | 3 -- extensions/source/abpilot/typeselectionpage.cxx | 14 ++++++------ extensions/source/dbpilots/gridwizard.cxx | 16 +++++++------- extensions/source/update/check/updatecheckconfig.cxx | 4 +-- extensions/source/update/check/updateprotocol.cxx | 2 - 5 files changed, 19 insertions(+), 20 deletions(-)
New commits: commit cde3d1f70f8b795ded329a05fa081f44edb11853 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Fri Dec 22 16:31:04 2023 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Fri Dec 22 18:12:05 2023 +0100 Use emplace_back instead of push_back (extensions) Change-Id: I6cdb020f19797821c6a70bf01013f6a7718bdcac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161189 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index 79cfd5d6b035..8db9f5a2ae43 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -107,13 +107,13 @@ namespace abp #endif // Items are displayed in list order - m_aAllTypes.push_back( ButtonItem( m_xEvolution.get(), AST_EVOLUTION, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( m_xEvolutionGroupwise.get(), AST_EVOLUTION_GROUPWISE, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( m_xEvolutionLdap.get(), AST_EVOLUTION_LDAP, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( m_xThunderbird.get(), AST_THUNDERBIRD, true ) ); - m_aAllTypes.push_back( ButtonItem( m_xKab.get(), AST_KAB, bHaveKab ) ); - m_aAllTypes.push_back( ButtonItem( m_xMacab.get(), AST_MACAB, bHaveMacab ) ); - m_aAllTypes.push_back( ButtonItem( m_xOther.get(), AST_OTHER, true ) ); + m_aAllTypes.emplace_back(m_xEvolution.get(), AST_EVOLUTION, bHaveEvolution); + m_aAllTypes.emplace_back(m_xEvolutionGroupwise.get(), AST_EVOLUTION_GROUPWISE, bHaveEvolution); + m_aAllTypes.emplace_back(m_xEvolutionLdap.get(), AST_EVOLUTION_LDAP, bHaveEvolution); + m_aAllTypes.emplace_back(m_xThunderbird.get(), AST_THUNDERBIRD, true); + m_aAllTypes.emplace_back(m_xKab.get(), AST_KAB, bHaveKab); + m_aAllTypes.emplace_back(m_xMacab.get(), AST_MACAB, bHaveMacab); + m_aAllTypes.emplace_back(m_xOther.get(), AST_OTHER, true); Link<weld::Toggleable&,void> aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected ); for (auto const& elem : m_aAllTypes) diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 99507008870d..f5a9f11b5d55 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -121,14 +121,14 @@ namespace dbp { case DataType::BIT: case DataType::BOOLEAN: - aColumnServiceNames.push_back(OUString("CheckBox")); + aColumnServiceNames.emplace_back("CheckBox"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::TINYINT: case DataType::SMALLINT: case DataType::INTEGER: - aColumnServiceNames.push_back(OUString("NumericField")); + aColumnServiceNames.emplace_back("NumericField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; @@ -137,31 +137,31 @@ namespace dbp case DataType::DOUBLE: case DataType::NUMERIC: case DataType::DECIMAL: - aColumnServiceNames.push_back(OUString("FormattedField")); + aColumnServiceNames.emplace_back("FormattedField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::DATE: - aColumnServiceNames.push_back(OUString("DateField")); + aColumnServiceNames.emplace_back("DateField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::TIME: - aColumnServiceNames.push_back(OUString("TimeField")); + aColumnServiceNames.emplace_back("TimeField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::TIMESTAMP: - aColumnServiceNames.push_back(OUString("DateField")); + aColumnServiceNames.emplace_back("DateField"); aColumnLabelPostfixes.push_back(compmodule::ModuleRes(RID_STR_DATEPOSTFIX)); aFormFieldNames.push_back(*pSelectedFields); - aColumnServiceNames.push_back(OUString("TimeField")); + aColumnServiceNames.emplace_back("TimeField"); aColumnLabelPostfixes.push_back(compmodule::ModuleRes(RID_STR_TIMEPOSTFIX)); break; default: - aColumnServiceNames.push_back(OUString("TextField")); + aColumnServiceNames.emplace_back("TextField"); aColumnLabelPostfixes.push_back(s_sEmptyString); } } diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index e728d91e77f1..708aba65811d 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -139,14 +139,14 @@ UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const bool isDirectDownload = false; m_aNameAccess.getValue(IS_DIRECT_DOWNLOAD) >>= isDirectDownload; - rInfo.Sources.push_back( DownloadSource( isDirectDownload, getStringValue(DOWNLOAD_URL) ) ); + rInfo.Sources.emplace_back(isDirectDownload, getStringValue(DOWNLOAD_URL)); for(sal_Int32 n=1; n < 6; ++n ) { OUString aUStr = getStringValue( OString(OString::Concat(RELEASE_NOTE) + OString::number(n)).getStr()); if( !aUStr.isEmpty() ) - rInfo.ReleaseNotes.push_back(ReleaseNote(static_cast<sal_Int8>(n), aUStr)); + rInfo.ReleaseNotes.emplace_back(static_cast<sal_Int8>(n), aUStr); } } diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx index db8319c799df..2fb6be85286a 100644 --- a/extensions/source/update/check/updateprotocol.cxx +++ b/extensions/source/update/check/updateprotocol.cxx @@ -163,7 +163,7 @@ checkForUpdates( OUString aType = xParent->getAttribute("type"); bool bIsDirect = !aType.equalsIgnoreAsciiCase("text/html"); - o_rUpdateInfo.Sources.push_back( DownloadSource(bIsDirect, xNode2->getNodeValue()) ); + o_rUpdateInfo.Sources.emplace_back(bIsDirect, xNode2->getNodeValue()); } } commit 17f1d2fe890159cfa881be2d16239e078e0a5c89 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Fri Dec 22 13:13:12 2023 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Fri Dec 22 18:11:55 2023 +0100 Use emplace_back instead of push_back (accessibility) Change-Id: I1b5aa26e92c6e5eaef43bd1c03281d4068b0487a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161175 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 19c8d139c6c6..f1ccc69c413d 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1579,8 +1579,7 @@ void Document::init() m_xParagraphs->reserve(static_cast< Paragraphs::size_type >(nCount)); // numeric overflow is harmless here for (::sal_uInt32 i = 0; i < nCount; ++i) - m_xParagraphs->push_back(ParagraphInfo(static_cast< ::sal_Int32 >( - m_rEngine.GetTextHeight(i)))); + m_xParagraphs->emplace_back(m_rEngine.GetTextHeight(i)); // XXX numeric overflow m_nViewOffset = static_cast< ::sal_Int32 >( m_rView.GetStartDocPos().Y()); // XXX numeric overflow