From e2c22ae98ecb5267f02a01da7e2b2f51fa8cb7e1 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Sat, 15 Sep 2018 15:29:07 -0400 Subject: [PATCH] Suppress spurious message - was reporting "pattern not found" even if hatch source file was not a .pat file. --- src/Mod/TechDraw/App/DrawViewSection.cpp | 31 ++++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index f3a217c9c1..d8f7a970fe 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -162,19 +162,24 @@ void DrawViewSection::onChanged(const App::Property* prop) } if (prop == &FileHatchPattern || prop == &NameGeomPattern ) { - if ((!FileHatchPattern.isEmpty()) && - (!NameGeomPattern.isEmpty())) { - std::vector specs = - DrawGeomHatch::getDecodedSpecsFromFile(FileHatchPattern.getValue(),NameGeomPattern.getValue()); - m_lineSets.clear(); - for (auto& hl: specs) { - //hl.dump("hl from section"); - LineSet ls; - ls.setPATLineSpec(hl); - m_lineSets.push_back(ls); - } - - } + std::string fileSpec = FileHatchPattern.getValue(); + Base::FileInfo fi(fileSpec); + std::string ext = fi.extension(); + if ( (ext == "pat") || + (ext == "PAT") ) { + if ((!FileHatchPattern.isEmpty()) && + (!NameGeomPattern.isEmpty())) { + std::vector specs = + DrawGeomHatch::getDecodedSpecsFromFile(FileHatchPattern.getValue(),NameGeomPattern.getValue()); + m_lineSets.clear(); + for (auto& hl: specs) { + //hl.dump("hl from section"); + LineSet ls; + ls.setPATLineSpec(hl); + m_lineSets.push_back(ls); + } + } + } } DrawView::onChanged(prop);