[TD]GeomHatch - handle empty parameter
This commit is contained in:
@@ -615,6 +615,9 @@ std::string DrawGeomHatch::prefGeomHatchFile(void)
|
||||
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/PAT/";
|
||||
std::string defaultFileName = defaultDir + "FCPAT.pat";
|
||||
std::string result = hGrp->GetASCII("FilePattern", defaultFileName.c_str());
|
||||
if (result.empty()) {
|
||||
result = defaultFileName;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -624,6 +627,9 @@ std::string DrawGeomHatch::prefGeomHatchName()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
|
||||
std::string defaultNamePattern = "Diamond";
|
||||
std::string result = hGrp->GetASCII("NamePattern",defaultNamePattern.c_str());
|
||||
if (result.empty()) {
|
||||
result = defaultNamePattern;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ void TaskGeomHatch::initUi()
|
||||
if (nameIndex > -1) {
|
||||
ui->cbName->setCurrentIndex(nameIndex);
|
||||
} else {
|
||||
Base::Console().Warning("Warning - Pattern name not found in current PAT File\n");
|
||||
Base::Console().Warning("Warning - Pattern name *%s* not found in current PAT File\n", m_name.c_str());
|
||||
}
|
||||
ui->sbScale->setValue(m_scale);
|
||||
ui->sbWeight->setValue(m_weight);
|
||||
|
||||
Reference in New Issue
Block a user