Issue 100989 - SpreadsheetML: cell with ss:MergeAcross="0" gets an extra empty cell to the right
Summary: SpreadsheetML: cell with ss:MergeAcross="0" gets an extra empty cell to the r...
Status: RESOLVED FIXED
Alias: None
Product: Calc
Classification: Application
Component: open-import (show other issues)
Version: OOo 3.0.1
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: 4.1.14
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2009-04-09 15:07 UTC by dcviana
Modified: 2023-02-08 18:17 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments
Small file that shows the problem. Please open in both Excel (2003 and up) and Calc to see the problem. (4.31 KB, application/vnd.ms-excel)
2009-04-09 15:08 UTC, dcviana
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description dcviana 2009-04-09 15:07:28 UTC
I have an application that uses Eclipse BIRT 2.3.2 to generate reports. The
reports are generated using Excel 2003 XML file format.

When I open the file in Excel, everything is fine. The same file on Calc appears
with one blank column between every column of the report, so if I have 3 columns
Calc shows 5 columns, two blanks and three with data.
Comment 1 dcviana 2009-04-09 15:08:53 UTC
Created attachment 61491 [details]
Small file that shows the problem. Please open in both Excel (2003 and up) and Calc to see the problem.
Comment 2 Regina Henschel 2009-04-09 16:12:28 UTC
Reproducible. The attached document shows two columns (A,B) when opened in
Excel2007. It shows these columns in A and C and an additional, empty column
between them in OOoDEV300m44.
Comment 3 damjan 2023-01-11 18:42:48 UTC
Deleting the:
    ss:MergeAcross="0"
attribute from each <Cell>:

    <Cell ss:Index="1" ss:StyleID="20" ss:MergeAcross="0" ss:MergeDown="0">

is enough to move the cells from column C to column B.

Something must be going wrong when converting ss:MergeAcross.
Comment 4 damjan 2023-01-11 18:57:36 UTC
The ODF resulting from the XSLT filter has these in between A1 and B1 when I don't delete ss:MergeAcross="0":

<table:covered-table-cell/>

and it's missing when I do delete ss:MergeAcross="0".
Comment 5 damjan 2023-01-12 01:20:36 UTC
Fixed by the below commit, resolving FIXED.

Thank you for your bug report and sample document :-).


commit a896732bfcd282115c06407a2f1da77694fa8d19
Author: Damjan Jovanovic
Date:   Thu Jan 12 03:02:18 2023 +0200

In ODF (19.679.2 of ODF 1.3), the <table:covered-table-cell> element's
table:number-columns-repeated attribute has a default value of 1,
meaning the cell spans the cell to its right. However when the XSLT import
filter converts from SpreadsheetML's ss:MergeAcross to ODF's    
table:number-columns-repeated, it always inserts a <table:covered-table-cell>
element, and then adds the table:number-columns-repeated attribute only if
it is greater than 1. This breaks when ss:MergeAcross="0", because ODF's
defaulting to 1 ends up occupying an extra empty cell to the right when it
shouldn't.

Fix this by only inserting the <table:covered-table-cell> when
ss:MergeAcross > 0.

Add a test document to prove this.

Fixes #100989 - SpreadsheetML: cell with ss:MergeAcross="0" gets an extra empty cell to the right
Patch by: me
Comment 6 damjan 2023-02-07 18:05:08 UTC
Cherry-picked for AOO41X in commit d1836b62275253243e873969ddd24d2e327afc76.
Comment 7 Matthias Seidel 2023-02-07 18:11:10 UTC
Has this already been cherry-picked for AOO42X?
Comment 8 damjan 2023-02-07 18:17:54 UTC
(In reply to Matthias Seidel from comment #7)
> Has this already been cherry-picked for AOO42X?

No.
Comment 9 Matthias Seidel 2023-02-08 09:19:41 UTC
The same problem with cherry-picking here.

Carl seems to maintain the test files only in trunk...
Comment 10 Matthias Seidel 2023-02-08 15:00:55 UTC
So this is fixed in AOO41X but not in AOO42X.

We must not forget to cherry-pick it.

For the moment, I will set it as "Target Milestone" 4.1.14.
Comment 11 damjan 2023-02-08 18:17:23 UTC
Cherry-picked for AOO42X with b9aa0698b102697d60533d02e6cbe50f52d1cb50.