DrawViewAnnotation: add transformation procedure for changed properties
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user