RichTextModel: ContentChange.isEdit incorrect undoing style modification

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: jfx24
    • Component/s: javafx
    • None
    • Fix Understood

      User feedback:
      Undoing a style only change fires a change event where ContentChange.isEdit is true when it should be false.

      The failure can be tested with the following unit test:

          @Test
          public void undoStyleChange() {
              ArrayList<ContentChange> changes = new ArrayList<>();
              TextPos p = control.appendText("BOLD");
              control.getModel().addListener((ch) -> {
                  changes.add(ch);
              });
              control.applyStyle(TextPos.ZERO, p, BOLD);
              control.undo();
              assertEquals(2, changes.size());
              ContentChange ch1 = changes.get(0);
              assertFalse(ch1.isEdit());
              ContentChange ch2 = changes.get(1);
              assertFalse(ch2.isEdit());
          }

            Assignee:
            Andy Goryachev
            Reporter:
            Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: