Skip to content

Double fill-element in style.xml #1066

@klafah

Description

@klafah

This is:

- [x ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Correct representation of calculated Cells

What is the current behavior?

Numbers are 'printed' on each other (at least in MS Excel 2010, 14.0.7224.5000 32-bit)

What are the steps to reproduce?

Take a new empty excel document. Open and save it whith PhPSpreadsheet.
After that fills-section in styles.xml looks like that (double patternType "none"):
<fills count="3">
<fill><patternFill patternType="none"/></fill>
<fill><patternFill patternType="gray125"><fgColor rgb="FFFFFFFF"/> ... </fill>
<fill><patternFill patternType="none"/></fill>
</fills>

As a result, Excel no longer correctly displays cells containing formulas. Instead, the numbers are printed on top of each other.

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

`<?php

require DIR . '/vendor/autoload.php';

// Create new Spreadsheet object
// $spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

// add code that show the issue here...
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load('empty.xlsx');

$writer = new Xlsx($spreadsheet);
$writer->save('empty_modified.xlsx');`

Which versions of PhpSpreadsheet and PHP are affected?

1.8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions