From 529486831630259edff679765dd19834553537a4 Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@stud.unibas.ch>
Date: Wed, 21 Nov 2012 16:00:15 +0100
Subject: [PATCH] make function consisten with other ost function calls

---
 modules/mol/base/src/editor_base.cc      |  8 ++++++--
 modules/mol/base/src/editor_base.hh      |  2 +-
 modules/mol/base/src/impl/entity_impl.cc | 12 ------------
 modules/mol/base/src/impl/entity_impl.hh |  2 --
 4 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc
index 31642fee3..9e8729d93 100644
--- a/modules/mol/base/src/editor_base.cc
+++ b/modules/mol/base/src/editor_base.cc
@@ -208,9 +208,13 @@ void EditorBase::RenumberAllResidues(int start, bool keep_spacing)
   ent_.Impl()->RenumberAllResidues(start, keep_spacing);
 }
 
-void EditorBase::RenumberChain(const String& name, int start, bool keep_spacing)
+void EditorBase::RenumberChain(const ChainHandle& chain, int start, bool keep_spacing)
 {
-  ent_.Impl()->RenumberChain(name, start, keep_spacing);
+  CheckHandleValidity(chain);
+  if(chain.GetEntity()!=ent_){
+    throw Error("Chain does not belong to the editors entity!");
+  }
+  chain.Impl()->RenumberAllResidues(start, keep_spacing);
 }
 
 void EditorBase::RenameAtom(AtomHandle atom, const String& new_name)
diff --git a/modules/mol/base/src/editor_base.hh b/modules/mol/base/src/editor_base.hh
index ad87fe149..05d82ddb0 100644
--- a/modules/mol/base/src/editor_base.hh
+++ b/modules/mol/base/src/editor_base.hh
@@ -293,7 +293,7 @@ public:
   /// \param keep_spacing
   ///           If set to false, residues will continously be renumbered ongoing from start.
   ///           Otherwise the spacings between the residues are kept.
-  void RenumberChain(const String& name, int start, bool keep_spacing);
+  void RenumberChain(const ChainHandle& chain, int start, bool keep_spacing);
     
   /// \brief Get edit mode of editor
   EditMode GetMode() const {return mode_;}
diff --git a/modules/mol/base/src/impl/entity_impl.cc b/modules/mol/base/src/impl/entity_impl.cc
index f8fa19e32..1fd465f23 100644
--- a/modules/mol/base/src/impl/entity_impl.cc
+++ b/modules/mol/base/src/impl/entity_impl.cc
@@ -1202,16 +1202,4 @@ void EntityImpl::RenumberAllResidues(int start, bool keep_spacing)
 
 }
 
-void EntityImpl::RenumberChain(const String& name, int start, bool keep_spacing)
-{
-  ChainImplPtr ch=this->FindChain(name);
-
-  if(!ch) {
-    throw Error("Could not find chain with name "+name);
-  }
-
-  ch->RenumberAllResidues(start, keep_spacing);
-
-}
-
 }}} // ns
diff --git a/modules/mol/base/src/impl/entity_impl.hh b/modules/mol/base/src/impl/entity_impl.hh
index 74d8ded33..c95bef408 100644
--- a/modules/mol/base/src/impl/entity_impl.hh
+++ b/modules/mol/base/src/impl/entity_impl.hh
@@ -251,8 +251,6 @@ public:
 
   void RenumberAllResidues(int start, bool keep_spacing);
 
-  void RenumberChain(const String& name, int start, bool keep_spacing);
-
 private:
   void DoCopy(EntityImplPtr dest);
   
-- 
GitLab