Mod: use emplace_back
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user