https://issues.apache.org/bugzilla/show_bug.cgi?id=52682

             Bug #: 52682
           Summary: Strings ending by '\r' are not handled by textbox
           Product: POI
           Version: 3.8-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSLF
        AssignedTo: dev@poi.apache.org
        ReportedBy: el.char...@gmail.com
    Classification: Unclassified


When i try to insert a textbox ending by the char '\r' or '\n' the slide
"crash" (not the whole slideshow).

EX :

SlideShow ppt = new SlideShow();
Slide s = ppt.createSlide();
TextBox tb = new TextBox();

tb.getTextRun().setText("Test");    <-- WORKS
OR
tb.getTextRun().setText("Test\r");  <-- FAIL

s1.addShape(tb);

Possible cause : Class TextRun

In storeText the last char is striped if it's a '\r'

if(s.endsWith("\r")) {
  s = s.substring(0, s.length()-1);
}

but in setRawText the string is used unstripped

HERE ->  _rtRuns[0].setText(s);
AND THERE -> _rtRuns[0] = new RichTextRun(this,0,s.length());

I've removed the following part because there's no "implicit" line return. 

if(s.endsWith("\r")) {
  s = s.substring(0, s.length()-1);
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to