Closing Undo Wrapper corrupts IsModified

Post » Thu Jan 15, 2015 4:16 pm

I've been struggling to find either a reason or workaround for this, but have come up empty.

Basically, any time I close an undo wrapper, the IsModified property of the edited file gets corrupted. As an example:

Code Block:
bool fCancel = false;int idUndo = file.BeginUndo(Script.Name);// DO THINGSfile.EndUndo(idUndo, fCancel);


I can perform any number of editing actions at "DO THINGS", and all the while the IsModified stays true, but as soon as I use the EndUndo function, IsModified flips to false, even though the file is actually dirty (and the window in the interface has the dirty "*" showing). So if I try to close the file, it simply closes without warning about my unsaved changes.

If I manually undo the script with Ctrl+Z, the behavior corrects itself, and I can then use the script as many times as I want without IsModified status get errantly flipped. I've tried this a dozen different ways, and I can't find a workaround short of performing another editing action after closing the undo wrapper, but that ruins the point of what I'm trying.

I'm using Sound Forge 10, so I can expect that a fix won't be developed for this, but can anyone think of a workaround?
User avatar
Sheila Reyes
 
Posts: 519
Joined: Thu Dec 28, 2006 1:40 am





Return to Sound Forge Pro