From: toshinagata1964 Date: Tue, 30 Sep 2014 16:00:03 +0000 (+0000) Subject: Molecule#on_modified is not called when undo is disabled X-Git-Tag: v1.0.2~66 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7de10cf59547bddb1d0401682767ccc2f6b6069f;p=molby%2FMolby.git Molecule#on_modified is not called when undo is disabled git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@575 a2be9bc6-48de-4e38-9406-05402d4bc13c --- diff --git a/wxSources/MyDocument.cpp b/wxSources/MyDocument.cpp index 4c1bf2b..6f8b74e 100755 --- a/wxSources/MyDocument.cpp +++ b/wxSources/MyDocument.cpp @@ -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();