ASF Bugzilla – Attachment 37107 Details for
Bug 64244
[PATCH] Fix exception from using applyFont for unicode representation _xHHHH_
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add testUtfDecode_withApplyFont and patch XSSFRichTextString.getFormatMap
getFormatMap.patch (text/plain), 1.53 KB, created by
Hyeonmin Park
on 2020-03-19 13:39:50 UTC
(
hide
)
Description:
Add testUtfDecode_withApplyFont and patch XSSFRichTextString.getFormatMap
Filename:
MIME Type:
Creator:
Hyeonmin Park
Created:
2020-03-19 13:39:50 UTC
Size:
1.53 KB
patch
obsolete
>Index: src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java >=================================================================== >--- src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java (revision 1875423) >+++ src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java (working copy) >@@ -577,7 +577,7 @@ > String txt = r.getT(); > CTRPrElt fmt = r.getRPr(); > >- length += txt.length(); >+ length += utfDecode(txt).length(); > formats.put(length, fmt); > } > return formats; >Index: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java >=================================================================== >--- src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java (revision 1875423) >+++ src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java (working copy) >@@ -258,6 +258,19 @@ > } > > @Test >+ public void testUtfDecode_withApplyFont() { >+ XSSFFont font = new XSSFFont(); >+ font.setBold(true); >+ font.setFontHeightInPoints((short) 14); >+ >+ CTRst st = CTRst.Factory.newInstance(); >+ st.setT("abc_x000D_2ef_x000D_"); >+ XSSFRichTextString rt = new XSSFRichTextString(st); >+ rt.applyFont(font); >+ assertEquals("abc\r2ef\r", rt.getString()); >+ } >+ >+ @Test > public void testApplyFont_lowlevel(){ > CTRst st = CTRst.Factory.newInstance(); > String text = "Apache Software Foundation";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 64244
: 37107