diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index 3f3e0d35a2..dc10f2253b 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -363,6 +363,21 @@ void DrawView::handleChangedPropertyType( static_cast(prop)->setValue(link.getValue()); } } + + // property X had App::PropertyFloat and was changed to App::PropertyLength + // sb PropertyDistance. some X,Y are relative to existing point on page + } else if (prop == &X && strcmp(TypeName, "App::PropertyFloat") == 0) { + App::PropertyFloat XProperty; + XProperty.setContainer(this); + // restore the PropertyFloat to be able to set its value + XProperty.Restore(reader); + X.setValue(XProperty.getValue()); + } else if (prop == &Y && strcmp(TypeName, "App::PropertyFloat") == 0) { + App::PropertyFloat YProperty; + YProperty.setContainer(this); + YProperty.Restore(reader); + Y.setValue(YProperty.getValue()); + // property Rotation had App::PropertyFloat and was changed to App::PropertyAngle } else if (prop == &Rotation && strcmp(TypeName, "App::PropertyFloat") == 0) { App::PropertyFloat RotationProperty; diff --git a/src/Mod/TechDraw/App/DrawViewBalloon.cpp b/src/Mod/TechDraw/App/DrawViewBalloon.cpp index ea70fb5fd4..c151ced41f 100644 --- a/src/Mod/TechDraw/App/DrawViewBalloon.cpp +++ b/src/Mod/TechDraw/App/DrawViewBalloon.cpp @@ -131,22 +131,37 @@ void DrawViewBalloon::onDocumentRestored() void DrawViewBalloon::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop) // transforms properties that had been changed { - // also check for changed properties of the base class - DrawView::handleChangedPropertyType(reader, TypeName, prop); + // also check for changed properties of the base class + DrawView::handleChangedPropertyType(reader, TypeName, prop); - // property OriginX had the App::PropertyFloat and was changed to App::PropertyLength - if (prop == &OriginX && strcmp(TypeName, "App::PropertyFloat") == 0) { - App::PropertyFloat OriginXProperty; - // restore the PropertyFloat to be able to set its value - OriginXProperty.Restore(reader); - OriginX.setValue(OriginXProperty.getValue()); - } - // property OriginY had the App::PropertyFloat and was changed to App::PropertyLength - else if (prop == &OriginY && strcmp(TypeName, "App::PropertyFloat") == 0) { - App::PropertyFloat OriginYProperty; - OriginYProperty.Restore(reader); - OriginY.setValue(OriginYProperty.getValue()); - } + // property OriginX had the App::PropertyFloat and was changed to App::PropertyDistance + if ( (prop == &OriginX) && + (strcmp(TypeName, "App::PropertyFloat") == 0) ) { + App::PropertyFloat OriginXProperty; + // restore the PropertyFloat to be able to set its value + OriginXProperty.Restore(reader); + OriginX.setValue(OriginXProperty.getValue()); + } else if ( (prop == &OriginX) && + (strcmp(TypeName, "App::PropertyLength") == 0) ) { + App::PropertyLength OriginXProperty; + // restore the PropertyFloat to be able to set its value + OriginXProperty.Restore(reader); + OriginX.setValue(OriginXProperty.getValue()); + + // property OriginY had the App::PropertyFloat and was changed to App::PropertyDistance + } else if ( (prop == &OriginY) && + (strcmp(TypeName, "App::PropertyFloat") == 0) ) { + App::PropertyFloat OriginYProperty; + // restore the PropertyFloat to be able to set its value + OriginYProperty.Restore(reader); + OriginY.setValue(OriginYProperty.getValue()); + } else if ( (prop == &OriginY) && + (strcmp(TypeName, "App::PropertyLength") == 0) ) { + App::PropertyLength OriginYProperty; + // restore the PropertyLength to be able to set its value + OriginYProperty.Restore(reader); + OriginY.setValue(OriginYProperty.getValue()); + } } diff --git a/src/Mod/TechDraw/App/DrawViewBalloon.h b/src/Mod/TechDraw/App/DrawViewBalloon.h index e2ecb219b0..3b643832db 100644 --- a/src/Mod/TechDraw/App/DrawViewBalloon.h +++ b/src/Mod/TechDraw/App/DrawViewBalloon.h @@ -54,8 +54,8 @@ public: App::PropertyEnumeration EndType; App::PropertyEnumeration Symbol; App::PropertyFloat SymbolScale; - App::PropertyLength OriginX; - App::PropertyLength OriginY; + App::PropertyDistance OriginX; + App::PropertyDistance OriginY; App::PropertyBool OriginIsSet; App::PropertyFloat TextWrapLen;