Ods: the direction of a right-to-left sheet is lost

Author: dkulykCreated Sep 27, 2026Updated Sep 27, 2026

This is:

- [x] a bug report
- [ ] a feature request
- [x] **not** a usage question

What is the expected behavior?

A sheet set right to left stays right to left through Ods, in both directions.

What is the current behavior?

Writer\Ods writes no direction for such a sheet, so LibreOffice opens it left to right. Reader\Ods does not read the direction either: a right-to-left sheet saved by LibreOffice, which writes style:writing-mode="rl-tb" in the table style, comes back with getRightToLeft() false.

What are the steps to reproduce?

php
<?php

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

use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;

$spreadsheet = new Spreadsheet();
$spreadsheet->getActiveSheet()->setRightToLeft(true);
IOFactory::createWriter($spreadsheet, 'Ods')->save('/tmp/rtl.ods');

var_dump(IOFactory::load('/tmp/rtl.ods')->getActiveSheet()->getRightToLeft()); // false

What features do you think are causing the issue

  • Reader
  • Writer

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

Ods only.

Which versions of PhpSpreadsheet and PHP are affected?

master be40c6682, PHP 8.5.

Source: PHPOffice/PhpSpreadsheet