Mod: use emplace_back

This commit is contained in:
berniev
2022-08-05 16:06:37 +10:00
committed by wwmayer
parent 6ac4d8392e
commit 2d4c5a4cfb
65 changed files with 254 additions and 265 deletions

View File

@@ -131,7 +131,7 @@ std::vector<std::string> DrawViewSymbol::getEditableFields()
while (!queryResult.next().isNull()) {
QDomElement tspan = model.toDomNode(queryResult.current().toNodeModelIndex()).toElement();
QString editableValue = tspan.firstChild().nodeValue();
editables.push_back(std::string(editableValue.toUtf8().constData()));
editables.emplace_back(editableValue.toUtf8().constData());
}
}
return editables;

View File

@@ -1347,8 +1347,8 @@ void CmdTechDrawLandmarkDimension::activated(int iMsg)
std::vector<App::DocumentObject*> refs2d;
std::vector<std::string> subs;
subs.push_back("Vertex1");
subs.push_back("Vertex1");
subs.emplace_back("Vertex1");
subs.emplace_back("Vertex1");
TechDraw::DrawPage* page = dvp->findParentPage();
std::string parentName = dvp->getNameInDocument();
std::string PageName = page->getNameInDocument();

View File

@@ -160,7 +160,7 @@ void TaskProjGroup::saveGroupState()
for( const auto it : multiView->Views.getValues() ) {
auto view( dynamic_cast<DrawProjGroupItem *>(it) );
if (view) {
m_saveViewNames.push_back(view->Type.getValueAsString());
m_saveViewNames.emplace_back(view->Type.getValueAsString());
}
}
}

View File

@@ -125,7 +125,7 @@ std::vector<std::string> ViewProviderPage::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderDocumentObject::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}

View File

@@ -63,7 +63,7 @@ std::vector<std::string> ViewProviderProjGroup::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderDrawingView::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}
@@ -126,21 +126,21 @@ bool ViewProviderProjGroup::onDelete(const std::vector<std::string> &)
// add names to a list
if (!viewSection.empty()) {
for (auto SecIterator : viewSection) {
ViewList.push_back(SecIterator->Label.getValue());
ViewList.emplace_back(SecIterator->Label.getValue());
}
}
// get its detail views
auto viewDetail = Item->getDetailRefs();
if (!viewDetail.empty()) {
for (auto DetIterator : viewDetail) {
ViewList.push_back(DetIterator->Label.getValue());
ViewList.emplace_back(DetIterator->Label.getValue());
}
}
// get its leader lines
auto viewLead = Item->getLeaders();
if (!viewLead.empty()) {
for (auto LeadIterator : viewLead) {
ViewList.push_back(LeadIterator->Label.getValue());
ViewList.emplace_back(LeadIterator->Label.getValue());
}
}
}

View File

@@ -55,7 +55,7 @@ std::vector<std::string> ViewProviderProjGroupItem::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderViewPart::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}