Fix typos pathes -> paths

This commit is contained in:
Zheng, Lei
2019-07-20 11:18:47 +08:00
committed by wmayer
parent 3bb578c825
commit 2f0aa9b2a5
4 changed files with 16 additions and 16 deletions

View File

@@ -595,7 +595,7 @@ Document* Application::openDocument(const char * FileName, bool createView) {
std::vector<Document*> Application::openDocuments(
const std::vector<std::string> &filenames,
const std::vector<std::string> *pathes,
const std::vector<std::string> *paths,
const std::vector<std::string> *labels,
std::vector<std::string> *errs,
bool createView)
@@ -641,8 +641,8 @@ std::vector<Document*> 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();
}

View File

@@ -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<Document*> openDocuments(const std::vector<std::string> &filenames,
const std::vector<std::string> *pathes=0,
const std::vector<std::string> *paths=0,
const std::vector<std::string> *labels=0,
std::vector<std::string> *errs=0,
bool createView = true);

View File

@@ -260,10 +260,10 @@ bool ExpressionVisitor::renameObjectIdentifier(Expression &e,
}
void ExpressionVisitor::collectReplacement(Expression &e,
std::map<ObjectIdentifier,ObjectIdentifier> &pathes,
std::map<ObjectIdentifier,ObjectIdentifier> &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<ObjectIdentifier, ObjectIdentifier> pathes;
std::map<ObjectIdentifier, ObjectIdentifier> paths;
bool collect = true;
};
@@ -897,7 +897,7 @@ ExpressionPtr Expression::replaceObject(const DocumentObject *parent,
// not const. This is ugly...
const_cast<Expression*>(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<ObjectIdentifier,ObjectIdentifier> &pathes,
std::map<ObjectIdentifier,ObjectIdentifier> &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,

View File

@@ -244,7 +244,7 @@ void DocumentRecovery::accept()
WaitCursor wc;
int index = -1;
std::vector<int> indices;
std::vector<std::string> filenames, pathes, labels, errs;
std::vector<std::string> 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]];