Bug 91007

Summary: FILEOPEN: XLS - Cell borders not present
Product: LibreOffice Reporter: Yousuf Philips (jay) (retired) <philipz85>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: himajin100000, raal
Priority: medium Keywords: filter:xls
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 59284, 109072    
Attachments: excel 2007 screenshot
smaller reproducible document in xlsx format

Description Yousuf Philips (jay) (retired) 2015-05-02 01:43:45 UTC
Created attachment 115255 [details]
excel 2007 screenshot

Steps:
1) Open http://www.exinfm.com/excel%20files/fcfe2st.xls
2) Goto B3
3) There arent any top borders on cells C3 through H3
4) Compare it with attached screenshot from Excel 2007

Calc is combining B3 to I3 with the top borders of cell B3 which results in the others cells not having the border they should.

Version: 5.0.0.0.alpha1+
Build ID: 59adad74084e9281887e3f78a225794f37b784d7
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:master, Time: 2015-04-29_12:34:23
Comment 1 raal 2015-05-02 06:17:52 UTC
I can confirm with Version: 5.0.0.0.alpha1+
Build ID: 59adad74084e9281887e3f78a225794f37b784d7
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-04-29_12:40:39
Comment 2 QA Administrators 2016-09-20 09:37:50 UTC Comment hidden (obsolete)
Comment 3 vihsa 2017-06-01 04:55:08 UTC
reproducible with lo viewer version: 5.5.0.0.alpha0+ / build id : ec79f34 / android 5.1
Comment 4 eisa01 2018-03-17 14:45:48 UTC
Still present

Version: 6.1.0.0.alpha0+
Build ID: 8e8dd8f320a3ff59ff8a16c1a7a867888ce80700
CPU threads: 2; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2018-03-13_23:59:29
Locale: en-US (en_US.UTF-8); Calc: group
Comment 5 QA Administrators 2019-03-18 03:45:55 UTC Comment hidden (obsolete)
Comment 6 eisa01 2019-04-20 17:49:22 UTC
Still present

Version: 6.3.0.0.alpha0+
Build ID: ea9c13be02ba731074fa4207944ff7df40a0fb5c
CPU threads: 2; OS: Mac OS X 10.13.6; UI render: default; VCL: osx; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2019-04-10_20:43:17
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 7 Svatopluk Vít 2021-02-26 13:35:02 UTC
Bug is still present, even Excel changed to version 2016

Version: 7.1.1.1 (x64) / LibreOffice Community
Build ID: 575c5867c4cc13d7ae78f9ce39a54a52ed38c769
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: cs-CZ (cs_CZ); UI: cs-CZ
Calc: threaded
Comment 8 himajin100000 2021-03-06 12:56:48 UTC
Created attachment 170268 [details]
smaller reproducible document in xlsx format
Comment 9 himajin100000 2021-03-16 15:33:58 UTC
Just a guess.

A-1. Suppose we have A1:B1 merged. the merged area has a unique border style for a specific direction. If the border under A1 is with solid style, the border under B1 would be solid style. This applies to both Excel and Calc.
-----
A-2. Lets think about another case.

At least in Calc, When all the following three conditions are met,

a-1. there is a unmerged area A1:B1
a-2. A1 has solid bottom border 
a-3. B1 has no bottom border

if we merge A1:B1, the area will have a unique solid bottom border as described in A-1
-----
A-3. Lets think about one more case.

At least in Calc, When all the following three conditions are met,

b-1. there is a unmerged area A1:B1
b-2. A1 has no bottom border 
b-3. B1 has solid bottom border

if we merge A1:B1, the area will have no bottom border.
-----
A-4.
If all the following five conditions are met in Excel

c-1. there is a unmerged area A1:B1
c-2. A1 has no bottom border 
c-3. B1 has solid bottom border
c-4. A1 has its content "AAA"
c-5. After we select A1:B1, open [Format Cells] Dialog, and choose "Center across Selection" for [Horizontal] combobox under [Alignment] Tab

A1 will have no bottom border, B1 will have a solid bottom border. the content "AAA" will be poisitioned horizontally center in A1:B1

now we save this file in xlsx format. the data "centerContinuous" and its target area A1:B1 will be saved to the file.
-----
A-5.
Open this xlsx file in Calc.
On loading the file, Calc MERGES the area A1:B1. We can see no bottom border, as A1 had no bottom border.

https://opengrok.libreoffice.org/xref/core/sc/source/filter/oox/sheetdatabuffer.cxx?r=358bdc5e#716
https://opengrok.libreoffice.org/xref/core/sc/source/filter/oox/sheetdatabuffer.cxx?r=358bdc5e#500
Comment 10 Rafael Lima 2022-10-20 18:57:23 UTC
Still repro with:

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: bb67f10786fd5e232b198d09139c41078c3fc60d
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded