fix exception catching by reference

This commit is contained in:
Abdullah Tahiri
2018-11-17 15:55:04 +01:00
committed by wmayer
parent bf6f2b855d
commit 012e35253a
2 changed files with 11 additions and 11 deletions

View File

@@ -3729,7 +3729,7 @@ void GeomLineSegment::Restore (Base::XMLReader &reader)
try {
setPoints(start, end);
}
catch(Base::ValueError e) {
catch(Base::ValueError &e) {
// for a line segment construction, the only possibility of a value error is that
// the points are too close. The best try to restore is incrementing the distance.
// for other objects, the best effort may be just to leave default values.

View File

@@ -155,7 +155,7 @@ void PropertyGeometryList::Save(Writer &writer) const
writer.Stream() << writer.ind() << "<GeometryList count=\"" << getSize() <<"\">" << endl;
writer.incInd();
for (int i = 0; i < getSize(); i++) {
writer.Stream() << writer.ind() << "<Geometry type=\""
writer.Stream() << writer.ind() << "<Geometry type=\""
<< _lValueList[i]->getTypeId().getName() << "\">" << endl;;
writer.incInd();
_lValueList[i]->Save(writer);
@@ -169,7 +169,7 @@ void PropertyGeometryList::Save(Writer &writer) const
void PropertyGeometryList::Restore(Base::XMLReader &reader)
{
bool partialrestore = false;
// read my element
reader.readElement("GeometryList");
// get the value of my attribute
@@ -188,9 +188,9 @@ void PropertyGeometryList::Restore(Base::XMLReader &reader)
reader.readEndElement("Geometry");
}
catch(Base::RestoreError &e) {
e.ReportException();
if(isOrderRelevant()) {
// Pushes the best try by the Geometry class
values.push_back(newG);
@@ -198,22 +198,22 @@ void PropertyGeometryList::Restore(Base::XMLReader &reader)
else {
delete newG;
}
reader.readEndElement("Geometry");
partialrestore = true;
continue;
}
}
reader.readEndElement("GeometryList");
// assignment
setValues(values);
if(partialrestore)
THROW(Base::RestoreError);
}