From 9bb360bb755a86c138cd8c3eb776651e2f135e3d Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 22 Oct 2018 12:06:54 +0200 Subject: [PATCH] fix bug in PropertyPlacementList::RestoreDocFile --- src/App/PropertyGeo.cpp | 2 +- src/Mod/Test/Document.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index 5f54bfc508..9033a077ec 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -946,7 +946,7 @@ void PropertyPlacementList::RestoreDocFile(Base::Reader &reader) if (reader.getFileVersion() > 0) { for (std::vector::iterator it = values.begin(); it != values.end(); ++it) { Base::Vector3d pos; - float q0, q1, q2, q3; + double q0, q1, q2, q3; str >> pos.x >> pos.y >> pos.z >> q0 >> q1 >> q2 >> q3; Base::Rotation rot(q0,q1,q2,q3); it->setPosition(pos); diff --git a/src/Mod/Test/Document.py b/src/Mod/Test/Document.py index dba5a80c4f..897f871d7f 100644 --- a/src/Mod/Test/Document.py +++ b/src/Mod/Test/Document.py @@ -164,6 +164,16 @@ class DocumentBasicCases(unittest.TestCase): self.Doc.removeObject(obj.Name) self.assertListEqual(grp.Group, []) + def testPlacementList(self): + obj = self.Doc.addObject("App::FeaturePython","Label") + obj.addProperty("App::PropertyPlacementList", "PlmList") + plm = FreeCAD.Placement() + plm.Base = (1,2,3) + plm.Rotation = (0,0,1,0) + obj.PlmList = [plm] + cpy = self.Doc.copyObject(obj) + self.assertListEqual(obj.PlmList, cpy.PlmList) + def testAddRemove(self): L1 = self.Doc.addObject("App::FeatureTest","Label_1") # must delete object