Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeRow with merged Cells apply the same merging to the row below #4077

Open
1 of 8 tasks
VoigtK opened this issue Jun 27, 2024 · 1 comment
Open
1 of 8 tasks

removeRow with merged Cells apply the same merging to the row below #4077

VoigtK opened this issue Jun 27, 2024 · 1 comment

Comments

@VoigtK
Copy link

VoigtK commented Jun 27, 2024

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?

removing a row where cells in the row are merged should not merge the cells in the row below

What is the current behavior?

I have a simple file where Row 1 Cells 1 to 4 are merged (Gray highlighted)
When removing this row, the Row 2, now Row 1 has its Cells 1 to 4 merged. Although they were not merged before.

Screenshot 2024-06-27 at 10 23 01

What are the steps to reproduce?

<?php

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

// Load file
$reader = IOFactory::createReader(IOFactory::READER_XLSX);
$spreadsheet = $reader->load($file);

// Remove row
$spreadsheet->getActiveSheet()->removeRow(1);

// Save file
$writer = IOFactory::createWriter($spreadsheet, IOFactory::WRITER_XLSX);
$writer->save(substr($file, 0, -5) . '_edited.xlsx');

test.xlsx

What features do you think are causing the issue

  • Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calculations
  • Charts
  • AutoFilter
  • Form Elements

Which versions of PhpSpreadsheet and PHP are affected?

PHP 8.3.8 (cli) (built: Jun 4 2024 14:53:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.8, Copyright (c) Zend Technologies

"name": "phpoffice/phpspreadsheet",
"version": "2.1.0",
"source": {
     "type": "git",
     "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
     "reference": "dbed77bd3a0f68f96c0dd68ad4499d5674fecc3e"
},
@oleibman
Copy link
Collaborator

Confirmed. I was hoping PR #3528 might address this, but it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants