DrawViewAnnotation: add transformation procedure for changed properties

This commit is contained in:
donovaly
2019-11-03 23:54:12 +01:00
committed by WandererFan
parent 3a34cf1344
commit 33844f8760
2 changed files with 19 additions and 0 deletions

View File

@@ -97,6 +97,24 @@ void DrawViewAnnotation::onChanged(const App::Property* prop)
TechDraw::DrawView::onChanged(prop);
}
void DrawViewAnnotation::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop)
// transforms properties that had been changed
{
// property LineSpace had the App::PropertyInteger and was changed to App::PropertyPercent
if (prop == &LineSpace && strcmp(TypeName, "App::PropertyInteger") == 0) {
App::PropertyInteger LineSpaceProperty;
// restore the PropertyInteger to be able to set its value
LineSpaceProperty.Restore(reader);
LineSpace.setValue(LineSpaceProperty.getValue());
}
// property MaxWidth had the App::PropertyFloat and was changed to App::PropertyLength
else if (prop == &MaxWidth && strcmp(TypeName, "App::PropertyFloat") == 0) {
App::PropertyFloat MaxWidthProperty;
MaxWidthProperty.Restore(reader);
MaxWidth.setValue(MaxWidthProperty.getValue());
}
}
QRectF DrawViewAnnotation::getRect() const
{
QRectF result;