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 2021/09/24 14:08:49 UTC

[Bug 65595] New: [PATCH] Strip colour formatting in headers and footers created by Excel

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

            Bug ID: 65595
           Summary: [PATCH] Strip colour formatting in headers and footers
                    created by Excel
           Product: POI
           Version: 5.0.x-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: viru.gajanayake@yahoo.com
  Target Milestone: ---

Excel allows the colour of header and footer text to be 
specified. A header displaying "test test test" with the
middle "test" in red will be stored as follows:
test &KFF0000test&K01+000 test

org.apache.poi.hssf.usermodel.HeaderFooter.stripFields() removes 
formatting tags from headers and footers, but this is missed.

This patch removes these colour formatting tags by adding the 
following new regexes after the existing ones
        text = text.replaceAll("\\&K[\\dA-F]{6}", "");
        text = text.replaceAll("\\&K[\\d]{2}[+][\\d]{3}", "");

An example of an Excel file with this an other formatting is 
used for a unit test

-- 
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 65595] [PATCH] Strip colour formatting in headers and footers created by Excel

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

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 65595] [PATCH] Strip colour formatting in headers and footers created by Excel

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

--- Comment #2 from PJ Fanning <fa...@yahoo.com> ---
Thanks - committed with r1893599

-- 
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 65595] [PATCH] Strip colour formatting in headers and footers created by Excel

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

--- Comment #1 from Viru <vi...@yahoo.com> ---
Created attachment 38047
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38047&action=edit
Patch

This patch is a gzipped tar containing the subversion diff and a test file used
for the unit test

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