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 2016/12/09 21:21:33 UTC

[Bug 60462] New: indexedColors not extracted when stored in styles.xml

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

            Bug ID: 60462
           Summary: indexedColors not extracted when stored in styles.xml
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: bknippen@abinitio.com
  Target Milestone: ---

Created attachment 34513
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34513&action=edit
example workbook

The attached spreadsheet originally created with an earlier Excel, but recently
modified, has a fill foreground set for A1 on 'mixed' sheet.

from sheet1.xml:

<c r="A1" s="2" t="s">

from styles.xml

Here is xf #2:

                <xf numFmtId="0" fontId="4" fillId="43" borderId="0" xfId="0"
applyFont="1" applyFill="1" applyProtection="1">
                        <protection hidden="1"/>
                </xf>


Here is fill #43:

                        <patternFill patternType="solid">
                                <fgColor indexed="8"/>
                                <bgColor indexed="64"/>
                        </patternFill>

and here are the first 8 indexedColors:

        <colors>
                <indexedColors>
                        <rgbColor rgb="00000000"/>
                        <rgbColor rgb="00FFFFFF"/>
                        <rgbColor rgb="00FF0000"/>
                        <rgbColor rgb="0000FF00"/>
                        <rgbColor rgb="000000FF"/>
                        <rgbColor rgb="00FFFF00"/>
                        <rgbColor rgb="00FF00FF"/>
                        <rgbColor rgb="0000FFFF"/>
                        <rgbColor rgb="00FF00FF"/>

The correct color here is 00FF00FF (magenta), and that is what any version of
excel shows when reading this wb. However, using getFillForegroundColor() on
XSSFCellFill returns '00000000' because it simply looks it up in the
indexedColors enum. But that enum only describes the default indexedColors. If
indexedColors is stored in the wb, those should be used during extraction

-- 
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 60462] indexedColors not extracted when stored in styles.xml

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

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
It seems support for this is completely absent currently, i.e. the
CTIndexedColors item is not read in StylesTable at all, currently a fixed set
of indexed colors is used in ExtendedColor.getRGBOrARGB().

So the first step is likely to add support for these to class StylesTable so
that we read a custom list of indexed colors and then adjust the places where
the mapping from indexed colors to RGB should take place.

Patches welcome!

-- 
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 60462] indexedColors not extracted when stored in styles.xml

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

bknippen@abinitio.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bknippen@abinitio.com

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