SimpleViewOnlyStyledModel: non-text paragraphs

XMLWordPrintable

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

      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:
            2 Start watching this issue

              Created:
              Updated: