From 13ed4bc6e8ec9be74be792f569a61b4affa49656 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 20 Feb 2021 13:33:54 +0100 Subject: [PATCH] PD: [skip ci] fixes #0004540: When manual size of DatumPlane is selected its Length property is not saved to the file and consequently not restored on opening --- src/Mod/PartDesign/App/DatumPlane.cpp | 9 +++++++++ src/Mod/PartDesign/App/DatumPlane.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/Mod/PartDesign/App/DatumPlane.cpp b/src/Mod/PartDesign/App/DatumPlane.cpp index 0968ac1736..8e065ba834 100644 --- a/src/Mod/PartDesign/App/DatumPlane.cpp +++ b/src/Mod/PartDesign/App/DatumPlane.cpp @@ -78,6 +78,15 @@ Base::Vector3d Plane::getNormal() return normal; } +void Plane::Restore(Base::XMLReader& reader) +{ + // set it to Manual to avoid to automatically adjust + // Length because it will be read before ResizeMode + // See bug #0004540 + ResizeMode.setValue("Manual"); + Datum::Restore(reader); +} + void Plane::onChanged(const App::Property *prop) { if (prop == &ResizeMode) { diff --git a/src/Mod/PartDesign/App/DatumPlane.h b/src/Mod/PartDesign/App/DatumPlane.h index d5781ea862..34ae349c29 100644 --- a/src/Mod/PartDesign/App/DatumPlane.h +++ b/src/Mod/PartDesign/App/DatumPlane.h @@ -50,6 +50,9 @@ public: Base::Vector3d getNormal(); +protected: + virtual void Restore(Base::XMLReader& reader); + private: static const char* ResizeModeEnums[]; };