[Bug 64494] New: CellStyles propagate unexpectedly and incorrectly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64494] New: CellStyles propagate unexpectedly and incorrectly

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64494

            Bug ID: 64494
           Summary: CellStyles propagate unexpectedly and incorrectly
           Product: POI
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Hello, in the context of XSSF CellStyles this happens. If I write this very
simple code:

XSSFCellStyle styleRight = workbook.createCellStyle();
XSSFCellStyle styleLeft = workbook.createCellStyle();
styleRight.setAlignment(HorizontalAlignment.RIGHT);
styleLeft.setAlignment(HorizontalAlignment.LEFT);

The cells that have their style set to styleLeft will also, incorrectly, be
aligned to the right.

If there is any other command that acts on either one of these styles, say for
example a setFont or setDataFormat, at any other point in the code, the cells
that have their style set to styleLeft will correctly be aligned to the left.

If BOTH styles have a, say, setFont applied to them, and the font put as
argument is the same object for both styles, the alignment will break again and
the supposedly left-aligned cells will align right (this doesn't happen if two
identical objects are set as the setFont arguments in either style).

If the order in which the objects are created flips (so styleLeft is created
before styleRight), so does the alignment (both will be aligned left). This
applies also for >2 styles, the first style created will propagate to all the
following ones.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64494] CellStyles propagate unexpectedly and incorrectly

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64494

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]