Add template based Document::countObjectsOfType
Also convert code to use this new method
This commit is contained in:
@@ -763,12 +763,8 @@ void CmdSketcherMapSketch::activated(int iMsg)
|
||||
bool CmdSketcherMapSketch::isActive()
|
||||
{
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
Base::Type sketch_type = Base::Type::fromName("Part::Part2DObject");
|
||||
std::vector<Gui::SelectionObject> selobjs = Gui::Selection().getSelectionEx();
|
||||
if (doc && doc->countObjectsOfType(sketch_type) > 0 && !selobjs.empty())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return doc && doc->countObjectsOfType<Part::Part2DObject>() > 0 && !selobjs.empty();
|
||||
}
|
||||
|
||||
DEF_STD_CMD_A(CmdSketcherViewSketch)
|
||||
|
||||
Reference in New Issue
Block a user