LibreOffice Calc 7.0.4.2 does not preserve formatting

LibreOffice Calc 7.0.4.2 on Linux. When I create Calc document and save it in Excel format (. xlsx), the LO does not save fomatting. Example: I created a calc document, saved it in xlsx format, then I used Format cells > Alignment > Indents, and selected Text alignment - Horizintal: Left, Indent: 5 pt, then Format cells > Borders > Line Width: 0,20 pt. Then click “Save” - everything looks correct and prints correctly. When I close doc and re-openi it, the above formatting disappears and becomes different values: Indent: 15 pt and Line Width: 0,05 pt.

Let’s try to figure it out. For this we will need… Excel.
So, let’s do the actions you specified in Calc, save in .xlsx format and open the specified file in Excel.

We see that the indent is 1. In Excel, and therefore in the .xlsx format, indents are measured in whole numbers from 0 to 15. Naturally, when opening the .xlsx format in Calc, we will get distortion.
The same is true for the thickness of the cell border

2 Likes

See also: tdf#144116. The interesting detail is: what are those units in Excel? It turns out, they are a very intuitive “1 = the width of three space characters using the spreadsheet’s default font”.

2 Likes

Original source.

If you specify a number in the Indent box, Microsoft Excel indents the contents of the cell from the left by the specified number of character spaces. The character spaces are based on the standard font and font size selected on the General tab of the Options dialog box (Tools menu).

This refers to the settings for the font that Excel application uses when creating new workbooks.

This seems like a strange solution.
If I, for example, aligned a cell with word wrap and an indent greater than 0 by height, then when another user opens the book, there may be problems due to a different indent value (in mm).

1 Like

Interesting, that that page doesn’t mention, that “1” is three space characters.

Experimentation has shown that the wording in the documentation is not precise.
In fact, the value indent = 1 in Excel is equivalent to an indent of three spaces (U+0020) in the Normal style font of this Excel workbook (as @mikekaganski pointed out above).