Apache OpenOffice (AOO) Bugzilla – Issue 127672
Xlsx with omitted cell references opens with empty cells
Last modified: 2023-01-09 15:46:03 UTC
Created attachment 86329 [details] Example file with omitted cell references See attached example. If I open this file in MS Excel, i see four cells filled by some data (A2, B2, A3 and B3). In OpenOffice Calc, only one cell (A2) has data, all others is empty. In this xlsx package, the sheet data file (sheet1.xml) contains following fragment: <sheetData> <row r="2" spans="1:2" ht="12.75"> <c r="A2" s="1" t="s"><v>0</v></c> <c s="1" t="s"><v>1</v></c> </row> <row r="3" spans="1:2" ht="12.75"> <c s="7"><v>42781</v></c> <c s="8" t="s"><v>2</v></c> </row> </sheetData> Standard ECMA-376 define attribute "r" of type "CT_Cell" as optional (see xsd schema, [Annex A.2 SpreadsheetML]). MS Excel on cells with omitted references assumes that next cell has same row and increased column number from previous cell. A similar algorithm used for rows with omitted Row Index (also optional attribute "r" of <row> element).
*** Issue 128551 has been marked as a duplicate of this issue. ***
Confirming. Thank you for your bug report and sample file. This is a serious bug!! Elevating priority and setting milestone. Luckily it should be pretty easy to fix. I think this method in main/oox/source/xls/sheetdatacontext.cxx has to change: ---snip--- 318 bool SheetDataContext::importCell( const AttributeList& rAttribs ) 319 { 320 bool bValidAddr = mrAddressConv.convertToCellAddress( maCellData.maCellAddr, rAttribs.getString( XML_r, OUString() ), mnSheet, true ); 321 if( bValidAddr ) 322 { 323 maCellData.mnCellType = rAttribs.getToken( XML_t, XML_n ); 324 maCellData.mnXfId = rAttribs.getInteger( XML_s, -1 ); 325 maCellData.mbShowPhonetic = rAttribs.getBool( XML_ph, false ); 326 327 // reset cell value, formula settings, and inline string 328 maCellValue = OUString(); 329 mxInlineStr.reset(); 330 mbHasFormula = false; 331 332 // update used area of the sheet 333 extendUsedArea( maCellData.maCellAddr ); 334 } 335 return bValidAddr; 336 } ---snip---
Fixed by commit 9c741048d2a06db94d9507ba978d3aecd557e7e9. Resolving FIXED. Alexander: thank you for your bug report, sample file, and excellent explanation of the problem!
Cherry-picked for AOO42X with: https://github.com/apache/openoffice/commit/a60f0fbf670431e75ec883bbb8aa1ffb7dbe4cb4
*** Issue 126344 has been marked as a duplicate of this issue. ***
Cherry-picked for AOO41X with: https://github.com/apache/openoffice/commit/f4ffe9aeb04bfd08d8dd302a289902da8be99a95