https://issues.apache.org/bugzilla/show_bug.cgi?id=53528
Priority: P2
Bug ID: 53528
Assignee: [email protected]
Summary: Inserting consecutive character runs with different
character properties not works properly
Severity: normal
Classification: Unclassified
Reporter: [email protected]
Hardware: PC
Status: NEW
Version: 3.8
Component: HWPF
Product: POI
When inserting two consecutive character runs with different properties (the
first one is bold and the second is not) it results in them having the same
properties (both are normal).
I've tried the following code with poi 3.8-20120326 and 3.9-beta1-20120628.
The expected results is "<b>[Bold]</b>[Normal]", but the actual result is
"[Bold][Normal]".
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.usermodel.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
final HWPFDocument doc = new HWPFDocument(new
FileInputStream("empty.dot"));
final Range range = doc.getRange();
final CharacterRun cr1 = range.insertAfter("[Bold]");
cr1.setBold(true);
final CharacterRun cr2 = cr1.insertAfter("[Normal]");
cr2.setBold(false);
doc.write(new FileOutputStream("output.doc"));
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]