SimpleViewOnlyStyledModel: non-text paragraphs

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • jfx26
    • Affects Version/s: jfx25
    • Component/s: javafx
    • b20

      There is a bug in SimpleViewOnlyStyledModel::lastParagraph() which breaks adding text segments after a Region-based paragraph.

      Test cases:

          @Test
          public void addTextAfterRegion() {
              SimpleViewOnlyStyledModel m = new SimpleViewOnlyStyledModel();
              m.addParagraph(() -> new Region());
              m.addNodeSegment(() -> new Region());
              assertEquals(2, m.size());
          }

          @Test
          public void addTextAfterRegionAfterText() {
              SimpleViewOnlyStyledModel m = new SimpleViewOnlyStyledModel();
              m.addNodeSegment(() -> new Region());
              m.addParagraph(() -> new Region());
              m.addSegment("text");
              assertEquals(3, m.size());
          }

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

              Created:
              Updated:
              Resolved: