OSDN Git Service

Molecule#on_modified is not called when undo is disabled
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 30 Sep 2014 16:00:03 +0000 (16:00 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 30 Sep 2014 16:00:03 +0000 (16:00 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@575 a2be9bc6-48de-4e38-9406-05402d4bc13c

wxSources/MyDocument.cpp

index 4c1bf2b..6f8b74e 100755 (executable)
@@ -532,7 +532,9 @@ MyDocument::OnDocumentModified(wxCommandEvent& event)
        MoleculeClearModifyCount(GetMainView()->mol);
 
        /*  Call modified handler in the Ruby world  */
-       MolActionCreateAndPerform(mol, SCRIPT_ACTION(""), "on_modified");
+       /*  (Does not if undo is disabled --- e.g. during loading structure)  */
+       if (isUndoEnabled)
+               MolActionCreateAndPerform(mol, SCRIPT_ACTION(""), "on_modified");
 
        event.Skip();  //  Also pass to other notification handlers
        UpdateModifyFlag();