From 2f0aa9b2a57bbedb7cb15bdb16c8fbeda582134d Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sat, 20 Jul 2019 11:18:47 +0800 Subject: [PATCH] Fix typos pathes -> paths --- src/App/Application.cpp | 6 +++--- src/App/Application.h | 4 ++-- src/App/Expression.cpp | 16 ++++++++-------- src/Gui/DocumentRecovery.cpp | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index b020e98b5e..74a0475da3 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -595,7 +595,7 @@ Document* Application::openDocument(const char * FileName, bool createView) { std::vector Application::openDocuments( const std::vector &filenames, - const std::vector *pathes, + const std::vector *paths, const std::vector *labels, std::vector *errs, bool createView) @@ -641,8 +641,8 @@ std::vector Application::openDocuments( const char *path = name; const char *label = 0; if(isMainDoc) { - if(pathes && pathes->size()>count) - path = (*pathes)[count].c_str(); + if(paths && paths->size()>count) + path = (*paths)[count].c_str(); if(labels && labels->size()>count) label = (*labels)[count].c_str(); } diff --git a/src/App/Application.h b/src/App/Application.h index b44a2b08e1..35bc7d264c 100644 --- a/src/App/Application.h +++ b/src/App/Application.h @@ -96,7 +96,7 @@ public: /** Open multiple documents * * @param filenames: input file names - * @param pathes: optional input file path in case it is different from + * @param paths: optional input file path in case it is different from * filenames (mainly used during recovery). * @param labels: optional label assign to document (mainly used during recovery). * @param errs: optional output error message corresponding to each input @@ -111,7 +111,7 @@ public: * This function will also open any external referenced files. */ std::vector openDocuments(const std::vector &filenames, - const std::vector *pathes=0, + const std::vector *paths=0, const std::vector *labels=0, std::vector *errs=0, bool createView = true); diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index d1fe5100d1..67c919fccc 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -260,10 +260,10 @@ bool ExpressionVisitor::renameObjectIdentifier(Expression &e, } void ExpressionVisitor::collectReplacement(Expression &e, - std::map &pathes, + std::map &paths, const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const { - return e._collectReplacement(pathes,parent,oldObj,newObj); + return e._collectReplacement(paths,parent,oldObj,newObj); } void ExpressionVisitor::moveCells(Expression &e, const CellAddress &address, int rowCount, int colCount) { @@ -875,16 +875,16 @@ public: void visit(Expression &e) { if(collect) - this->collectReplacement(e,pathes,parent,oldObj,newObj); + this->collectReplacement(e,paths,parent,oldObj,newObj); else - this->renameObjectIdentifier(e,pathes,dummy); + this->renameObjectIdentifier(e,paths,dummy); } const DocumentObject *parent; DocumentObject *oldObj; DocumentObject *newObj; ObjectIdentifier dummy; - std::map pathes; + std::map paths; bool collect = true; }; @@ -897,7 +897,7 @@ ExpressionPtr Expression::replaceObject(const DocumentObject *parent, // not const. This is ugly... const_cast(this)->visit(v); - if(v.pathes.empty()) + if(v.paths.empty()) return ExpressionPtr(); // Now make a copy and do the actual replacement @@ -2248,14 +2248,14 @@ bool VariableExpression::_renameObjectIdentifier( } void VariableExpression::_collectReplacement( - std::map &pathes, + std::map &paths, const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const { ObjectIdentifier path; if(var.replaceObject(path,parent,oldObj,newObj)) - pathes[var.canonicalPath()] = std::move(path); + paths[var.canonicalPath()] = std::move(path); } void VariableExpression::_moveCells(const CellAddress &address, diff --git a/src/Gui/DocumentRecovery.cpp b/src/Gui/DocumentRecovery.cpp index ffbfeff128..a3ae1431f4 100644 --- a/src/Gui/DocumentRecovery.cpp +++ b/src/Gui/DocumentRecovery.cpp @@ -244,7 +244,7 @@ void DocumentRecovery::accept() WaitCursor wc; int index = -1; std::vector indices; - std::vector filenames, pathes, labels, errs; + std::vector filenames, paths, labels, errs; for(auto &info : d->recoveryInfo) { ++index; std::string documentName; @@ -257,7 +257,7 @@ void DocumentRecovery::accept() if (fi.fileName() == QLatin1String("Document.xml")) file = createProjectFile(info.projectFile); - pathes.emplace_back(file.toUtf8().constData()); + paths.emplace_back(file.toUtf8().constData()); filenames.emplace_back(info.fileName.toUtf8().constData()); labels.emplace_back(info.label.toUtf8().constData()); indices.push_back(index); @@ -283,7 +283,7 @@ void DocumentRecovery::accept() } } - auto docs = App::GetApplication().openDocuments(filenames,&pathes,&labels,&errs); + auto docs = App::GetApplication().openDocuments(filenames,&paths,&labels,&errs); for(int i=0;i<(int)docs.size();++i) { auto &info = d->recoveryInfo[indices[i]];