poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53528] New: Inserting consecutive character runs with different character properties not works properly
Date Tue, 10 Jul 2012 10:34:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53528

          Priority: P2
            Bug ID: 53528
          Assignee: dev@poi.apache.org
           Summary: Inserting consecutive character runs with different
                    character properties not works properly
          Severity: normal
    Classification: Unclassified
          Reporter: frolovskij@gmail.com
          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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message