You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2022/07/29 09:28:20 UTC

[Bug 66187] New: MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

            Bug ID: 66187
           Summary: MS document is error by XWPFDocument to write  when
                    XWPFRun call method getTextHightlightColor() or
                    getEmphasisMark
           Product: POI
           Version: 5.2.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: cn.luowenjie@qq.com
  Target Milestone: ---

The sample:


```Java
    public static void main(String[] args) throws Exception {
        String template =
XwpfUtils.class.getResource("/template-word/template.docx").getFile();
        try (FileInputStream argIS = new FileInputStream(template)) {
            try (XWPFDocument doc = new XWPFDocument(argIS)) {
                XWPFRun run =  doc.getParagraphs().get(0).getRuns().get(0);
                //TODO bug
                run.getTextHightlightColor(); //or run.getEmphasisMark()  also
causes the same error

                try (OutputStream out = new FileOutputStream("output.docx")) {
                    doc.write(out);
                }
             }
        }
    }

```

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

--- Comment #4 from cn.luowenjie@qq.com ---
Created attachment 38356
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38356&action=edit
The error

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #6 from PJ Fanning <fa...@yahoo.com> ---
I added r1903163 - would you be able to build POI and try the change for
yourself?

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

--- Comment #2 from cn.luowenjie@qq.com ---
Created attachment 38354
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38354&action=edit
the sample

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

--- Comment #1 from cn.luowenjie@qq.com ---
    public static void main(String[] args) throws Exception {
        String template =
XwpfUtils.class.getResource("/template-word/template.docx").getFile();
        try (FileInputStream argIS = new FileInputStream(template)) {
            try (XWPFDocument doc = new XWPFDocument(argIS)) {
                XWPFRun run =  doc.getParagraphs().get(0).getRuns().get(0);
                //TODO bug
                run.getTextHightlightColor(); //or run.getEmphasisMark()  also
causes the same error

                try (OutputStream out = new FileOutputStream("output.docx")) {
                    doc.write(out);
                }
             }
        }
    }

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

--- Comment #5 from cn.luowenjie@qq.com ---
(In reply to PJ Fanning from comment #3)
> Can you provide the 'error'? Is it a stack trace - if so, provide the full
> trace?

The Java program runs fine, but there is an error opening the output World
document.

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

cn.luowenjie@qq.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|1                           |0
         Resolution|FIXED                       |---
             Status|RESOLVED                    |UNCONFIRMED

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

--- Comment #3 from PJ Fanning <fa...@yahoo.com> ---
Can you provide the 'error'? Is it a stack trace - if so, provide the full
trace?

-- 
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


[Bug 66187] MS document is error by XWPFDocument to write when XWPFRun call method getTextHightlightColor() or getEmphasisMark

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66187

cn.luowenjie@qq.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 OS|                            |All
             Status|NEW                         |RESOLVED

-- 
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