Lost leading spaces in Calc cells?

Hi!
I enter formulas as shown in the first picture.

Screenshot 2022-05-11 173659

Then I close and open the document - the leading spaces are lost.

=> => => Screenshot 2022-05-11 173800
Why is this happening?


Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL


temp1.xlsx (6.9 KB)


1 Like

This is still there for me after saving and opening.

77424 Test


In which file format do you save?


With me:
File format = ODS

Version: 7.3.3.2 (x64) / LibreOffice Community
Build ID: d1d0ea68f081ee2800a922cac8f79445e4603348
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL

ODS, surely?

Edit to add: it works for me saving as ods also.

1 Like

@BigRAl
Thank you very much.
I have changed it.

The ODS format is working properly. The xlsx format (original) is defective.

In LibreOffice the (original) is always ODF!


It could be a compatibility problem between
ODS and XLS / XLSX .

Basically:

Recommendation for clean working with LibreOffice when different Office programs are used.
Always create and save your files in LibreOffice and save them in ODF format (ODT, ODS, etc.).
Always keep these files as their source.
If you need other formats for distribution to partners, you can open an ODF file and save and distribute another format with ″ Save as… ″.
This way, you always have working files available in your system environment.

See:

Edit different file formats in LibreOffice


Please report the behavior as a bug in Bugzilla .

See also:

How to Report Bugs in LibreOffice .

Please post the link from the bug here.
format: tdf#nnnnnn (use only the number, not the link)
To do this, edit your initial question. Thank you.

1 Like

It’s definitely a bug.

  1. XLS also works OK.
  2. Hard recalc (Ctrl+Shift+F9) fixes the problem; the same effect has Options|Calc|Formula, Excel 2007 and newer: Always recalculate.
  3. Saving the file using Excel, and opening it in Calc, shows the strings OK.

So this is definitely a problem of storing the cached cell values. And even more specifically, Calc should add xml:space="preserve" attributes when writing respective v elements. Needs a bug report.

2 Likes

It works (… Hard recalc …)! Thank you!
Thank you all for your help!

2 Likes

By the way: if you open such a file in Calc, and add a formula like =LEFT(B2;1), you would get T, not a space. Hard recalc would indeed fix the formula value - but this shows that there could also be problems other than purely “cosmetic”.