Skip to content
This repository was archived by the owner on Jan 2, 2019. It is now read-only.
This repository was archived by the owner on Jan 2, 2019. It is now read-only.

Unable to read cell style while using OOCalc reader #280

Open
@nexces

Description

@nexces

I'm unable to read cell styles in .ods file.
I've created a simple .ods file with yellow cell background in cell A1
and strike through text in cell A2 and after reading styles with code:

$objReader = new PHPExcel_Reader_OOCalc();

$file = $objReader->load('/tmp/foo.ods');

$worksheet = $file->getActiveSheet();
echo 'Cell "A1": ' . PHP_EOL;
$cellStyle = $worksheet->getStyle('A1');
echo 'Fill type: ';
var_dump($cellStyle->getFill()->getFillType());
echo 'Start color: ';
var_dump($cellStyle->getFill()->getStartColor()->getRGB());
echo 'End color: ';
var_dump($cellStyle->getFill()->getEndColor()->getRGB());

echo 'Cell "A2": ' . PHP_EOL;
$cellStyle = $worksheet->getStyle('A2');
echo 'Font strike through: ';
var_dump($cellStyle->getFont()->getStrikethrough());

i'm getting:

Cell "A1": 
Fill type: string(4) "none"
Start color: string(6) "FFFFFF"
End color: string(6) "000000"
Cell "A2": 
Font strike through: bool(false)

but I would expect something like this:

Cell "A1": 
Fill type: string(5) "solid"
Start color: string(6) "FFFF00"
End color: string(6) "FFFF00"
Cell "A2": 
Font strike through: bool(true)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions