View | Details | Raw Unified | Return to bug 64244
Collapse All | Expand All

(-)src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java (-1 / +1 lines)
Lines 577-583 Link Here
577
            String txt = r.getT();
577
            String txt = r.getT();
578
            CTRPrElt fmt = r.getRPr();
578
            CTRPrElt fmt = r.getRPr();
579
            length += txt.length();
579
            length += utfDecode(txt).length();
580
            formats.put(length, fmt);
580
            formats.put(length, fmt);
581
        }
581
        }
582
        return formats;
582
        return formats;
(-)src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java (+13 lines)
Lines 258-263 Link Here
258
    }
258
    }
259
    @Test
259
    @Test
260
    public void testUtfDecode_withApplyFont() {
261
        XSSFFont font = new XSSFFont();
262
        font.setBold(true);
263
        font.setFontHeightInPoints((short) 14);
264
265
        CTRst st = CTRst.Factory.newInstance();
266
        st.setT("abc_x000D_2ef_x000D_");
267
        XSSFRichTextString rt = new XSSFRichTextString(st);
268
        rt.applyFont(font);
269
        assertEquals("abc\r2ef\r", rt.getString());
270
    }
271
272
    @Test
260
    public void testApplyFont_lowlevel(){
273
    public void testApplyFont_lowlevel(){
261
        CTRst st = CTRst.Factory.newInstance();
274
        CTRst st = CTRst.Factory.newInstance();
262
        String text = "Apache Software Foundation";
275
        String text = "Apache Software Foundation";

Return to bug 64244