Menu

#524 Using Cut command with no selection crashes TCoolEdit

6.44
closed
1
2022-02-23
2022-01-23
No

Using the Cut command (either from the menu or the Ctrl+X shortcut) with no selection in a TCoolEdit derived window causes a precondition and then a crash in TUndoDeleteSelection constructor.

Note that this is not related to recent Unicode changes and affects OWLMaker as well.

Related

Wiki: OWLNext_Stable_Releases

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2022-01-23
    • labels: --> CoolPrj, Internal, Crash
     
  • Ognyan Chernokozhev

    Pushed a fix in [r5756]

    Some notes:

    • The method used in the - IsSelection - should be renamed to HasSelection. (And there is another method IsSelectionMargin that should be renamed to IsSelectionMarginEnabled or HasSelectionMargin)
    • The command enabler for CM_EDITCUT is commented out for some reason. I think it is a good idea to make the Cut command disabled when there is no selection, just as the Copy command
    • Any reason not to merge this fix back to 6.44 and 7.0?
     
    👍
    1

    Related

    Commit: [r5756]

  • Vidar Hasfjord

    Vidar Hasfjord - 2022-01-24

    Good catch!

    Any reason not to merge this fix back to 6.44 and 7.0?

    Not that I see. It is an internal issue and the fix does not affect the ABI. Since the crash is easy to reproduce, and the severity is high (loss of data), I think it warrants a fix in 6.44 and 7.0, even though CoolPrj probably has few users.

    So, feel free to set the milestone to 6.44, and I will merge your fix when we approach the next release (unless you want to rekindle your role as release manager, in which case you can go ahead and merge and release immediately, if you want — see "Preparing and releasing a new version" for the steps needed).

    PS. Agree on all your other notes, by the way, although the API changes should be limited to 7.1, in my view.

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2022-01-24

    Hi Jogy, I just recompiled OWLMaker with your fix, and issuing the Cut command with no selection now does not crash, which is good, but I spotted another issue: Undoing a Cut command causes a CHECK assertion in TUndoDeleteSelection::Undo. If ignoring it, the program seems to run fine. However, if I make a series of edits and cuts and then issue Undo repeatedly (ignoring the assertions) the text isn't properly restored.

    PS. I see that TCoolEdit has Redo functionality, but this is not on the menu in OWLMaker, nor in your test example.

     
    • Ognyan Chernokozhev

      Yeah, that is another issue - we should look to fix it.

      Also I added the Redo command to the menu, but it does not get enabled and does not work.

       
    • Ognyan Chernokozhev

      Added [bugs:#528] to address the CHECK assertion and working on it.

       
      👍
      1

      Related

      Bugs: #528


      Last edit: Vidar Hasfjord 2022-02-19
  • Ognyan Chernokozhev

    • Group: 7 --> 6.44
     
  • Ognyan Chernokozhev

    So, feel free to set the milestone to 6.44, and I will merge your fix when we approach the next release

    As it looks, there may be a bunch of other issues as well - we should merge all non-API changing fixes back to the old branches.

     
    👍
    1
  • Ognyan Chernokozhev

    • status: open --> pending
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2022-02-23
    • Status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB