@@ -119,21 +119,27 @@ DimensionGeometryType TechDraw::validateDimSelection(
119
119
TechDraw::DrawViewPart* dvp = dynamic_cast <TechDraw::DrawViewPart*>(ref.getObject ());
120
120
if (dvp) {
121
121
dvpSave = dvp;
122
- // TODO: check for non-empty subname?
123
- subNames.push_back (ref.getSubName ());
122
+ if (!ref.getSubName ().empty ()) {
123
+ subNames.push_back (ref.getSubName ());
124
+ }
124
125
}
125
126
}
126
127
if (!dvpSave) {
127
128
// must have 1 DVP in selection
128
129
return isInvalid;
129
130
}
130
131
131
- if (subNames.front (). empty ()) {
132
+ if (subNames.empty ()) {
132
133
// no geometry referenced. can not make a dim from this mess. We are being called to validate
133
134
// a selection for a 3d reference
134
135
return isViewReference;
135
136
}
136
137
138
+ if (subNames.front ().empty ()) {
139
+ // can this still happen?
140
+ return isViewReference;
141
+ }
142
+
137
143
// check for invalid geometry descriptors in the subNames
138
144
std::unordered_set<std::string> acceptableGeometrySet (acceptableGeometry.begin (),
139
145
acceptableGeometry.end ());
@@ -237,11 +243,11 @@ bool TechDraw::checkGeometryOccurences(StringVector subNames, GeomCountMap keyed
237
243
std::string geometryType = DrawUtil::getGeomTypeFromName (sub);
238
244
std::map<std::string, int >::iterator it0 (foundCounts.find (geometryType));
239
245
if (it0 == foundCounts.end ()) {
240
- // already have this geometryType
241
- it0->second ++;
242
- } else {
243
246
// first occurrence of this geometryType
244
247
foundCounts[geometryType] = 1 ;
248
+ } else {
249
+ // already have this geometryType
250
+ it0->second ++;
245
251
}
246
252
}
247
253
0 commit comments