diff --git a/Framework/API/src/AlgorithmProxy.cpp b/Framework/API/src/AlgorithmProxy.cpp index e911da5ef3cd6d7036a55215ab2d66f588a15e03..c1a77746b23d389a16f10c89c606aaa192430d24 100644 --- a/Framework/API/src/AlgorithmProxy.cpp +++ b/Framework/API/src/AlgorithmProxy.cpp @@ -223,14 +223,13 @@ void AlgorithmProxy::afterPropertySet(const std::string &name) { * Making sure that the concrete alg is kept in sync * @param po :: The property manager to copy */ -void AlgorithmProxy::copyPropertiesFrom(const PropertyManagerOwner& po) -{ +void AlgorithmProxy::copyPropertiesFrom(const PropertyManagerOwner &po) { PropertyManagerOwner::copyPropertiesFrom(po); createConcreteAlg(true); m_alg->copyPropertiesFrom(*this); } - //---------------------------------------------------------------------- +//---------------------------------------------------------------------- // Private methods //---------------------------------------------------------------------- diff --git a/Framework/API/test/AlgorithmProxyTest.h b/Framework/API/test/AlgorithmProxyTest.h index 25b2f27d24d2b8f79e5f5e4418bb8be41b4dc776..6e8cafd780007d1caedf0087baf6c4936736b8c6 100644 --- a/Framework/API/test/AlgorithmProxyTest.h +++ b/Framework/API/test/AlgorithmProxyTest.h @@ -214,27 +214,27 @@ public: } void test_copyPropertiesFrom() { - IAlgorithm_sptr alg = + IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy"); - alg->initialize(); - alg->setPropertyValue( "prop1", "string" ); - alg->setPropertyValue("prop2","1"); - IAlgorithm_sptr algCopy = + alg->initialize(); + alg->setPropertyValue("prop1", "string"); + alg->setPropertyValue("prop2", "1"); + IAlgorithm_sptr algCopy = AlgorithmManager::Instance().create("ToyAlgorithmProxy"); - auto algProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(alg); - auto algCopyProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(algCopy); - algCopyProxy->copyPropertiesFrom(*algProxy); + auto algProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(alg); + auto algCopyProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(algCopy); + algCopyProxy->copyPropertiesFrom(*algProxy); - int val = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2")); + int val = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2")); - TS_ASSERT_EQUALS(val,1); + TS_ASSERT_EQUALS(val, 1); - //set another value and check the other value is unaffected - algCopy->setPropertyValue( "prop1", "A difference" ); - int val2 = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2")); + // set another value and check the other value is unaffected + algCopy->setPropertyValue("prop1", "A difference"); + int val2 = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2")); - TS_ASSERT_EQUALS(val,val2); + TS_ASSERT_EQUALS(val, val2); } }; diff --git a/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h b/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h index 87a4de60f33848e9103334085f80c14413daac34..ada32918cb12d35a2b41a9359cce28e8c18ca112 100644 --- a/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h +++ b/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h @@ -65,7 +65,9 @@ public: void setPropertyOrdinal(const int &index, const std::string &value); /// Make m_properties point to the same PropertyManager as po. - virtual void copyPropertiesFrom(const PropertyManagerOwner &po) { *this = po; } + virtual void copyPropertiesFrom(const PropertyManagerOwner &po) { + *this = po; + } bool existsProperty(const std::string &name) const; bool validateProperties() const;