Commit 2e30d240 authored by Jan Möbius's avatar Jan Möbius

Skip warning and do the right thing when we have a mismatching type request in selectionplugin

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15184 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 93ea752b
......@@ -1707,8 +1707,17 @@ bool SelectionBasePlugin::typeExists(DataType _type, int _excludeId) {
if ( object == 0 ) {
std::cerr << "Unable to get Object for type exists" << std::endl;
} else {
// mismatching exclude type
if (_type != object->dataType()) {
std::cerr << "typeExists mismatch" << std::endl;
// return as if not excluded
if ( typeCounter_[_type] > 0) {
return true; // At least one object of this type exists
} else if ( typeCounter_[_type] == 0 ){
return false; // No object of this type exists
} else {
std::cerr << "Type exists Error after mismatch exclude: " << _type.name().toStdString() << " negative count" << std::endl;
return false;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment