Bug 132191 - Refreshing a range applies the first data row's background color to all the other data rows
Summary: Refreshing a range applies the first data row's background color to all the o...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-DataRange
  Show dependency treegraph
 
Reported: 2020-04-17 13:17 UTC by Kristian Slavov
Modified: 2025-11-08 01:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple test db (8.00 KB, application/vnd.sqlite3)
2020-08-25 11:51 UTC, Kristian Slavov
Details
Base file (2.29 KB, application/vnd.sun.xml.base)
2020-08-25 11:51 UTC, Kristian Slavov
Details
Actual sheet file (7.82 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-25 11:53 UTC, Kristian Slavov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kristian Slavov 2020-04-17 13:17:08 UTC
Description:
I've defined a range that imports data from libreoffice base. For that range I've enabled "keep formatting" option.
When a range is refreshed the background color reverts to white. All other formatting remains (font, font size, borders)

If "keep formatting" option is not used, all formatting is lost, as expected.

Steps to Reproduce:
1.Associate a data source to some cells
2.Change the background color of some of them
3.Modify the range to use "keep formatting" option (probably on by default)
4.Update the range

Actual Results:
The background color of the cells changed to white. 
However other formatting such as borders, fonts, font sizes remain intact.

Expected Results:
The background color should remain as before the range update.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 6.4.2.2
Build ID: 1:6.4.2-3
CPU threads: 4; OS: Linux 5.5; UI render: default; VCL: x11; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded

The data source is fetched via libreoffice base using ODBC connection to a local sqlite3 database file.
Comment 1 Kristian Slavov 2020-04-17 13:18:33 UTC
OpenGL is *NOT* enabled.
Comment 2 Buovjaga 2020-08-25 11:22:06 UTC
(In reply to Kristian Slavov from comment #0)
> The data source is fetched via libreoffice base using ODBC connection to a
> local sqlite3 database file.

Please attach an example Base file + sqlite db file so we can quickly and conveniently test.

Please attach an example document.
Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the files.
Comment 3 Kristian Slavov 2020-08-25 11:51:14 UTC
Created attachment 164667 [details]
Simple test db
Comment 4 Kristian Slavov 2020-08-25 11:51:56 UTC
Created attachment 164668 [details]
Base file
Comment 5 Kristian Slavov 2020-08-25 11:53:01 UTC
Created attachment 164670 [details]
Actual sheet file
Comment 6 Kristian Slavov 2020-08-25 12:06:03 UTC
Attached sqlite3 db, Libreoffice Base file and the sheet.
All the data in the sheet is directly from the Base/db.  

I'm importing headers + data rows from a query, and I'm using the keep formatting option for the range.

I noticed something new. The first data row's background color is copied to all the other rows. So the bug should be renamed to:
Refreshing a range applies the first data row's background color to all the other data rows.

To reproduce the bug, change background color of the first data row and select refresh range.
Comment 7 Buovjaga 2020-08-25 12:40:23 UTC
Notes for reproduction on Arch Linux:

I had sqlite3 package already installed.

I installed sqliteodbc package from AUR per https://wiki.archlinux.org/index.php/Open_Database_Connectivity#SQLite

/etc/odbcinst.ini contents were amended by the installation as shown in the article.

In /etc/odbc.ini I added

[SQLite3]
Description=SQLite3
Driver=SQLite3
Database=/home/user/libobugs/vboxshare/odbc/mydb.sqlite
Timeout=100000
StepAPI=No
ShortNames=No
FKSupport=Yes
SyncPragma=Normal
JournalMode=Delete
BigInt=No

In lo_test.odb I did Edit - Database - Properties, Browse and selected SQLite3. Test Connection went fine. I saved the file.

In Tools - Options - LibO Base - Databases I added the lo_test.odb file.

Now I was able to look into test_sheet.ods.

1. Changed the background colour of cells B4:C4
2. Data - Refresh range

I confirm the colour was applied to the rest of the data cells.

A wild ride, but I learned something new :)
Comment 8 QA Administrators 2022-08-26 03:36:27 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2024-08-26 03:15:42 UTC Comment hidden (obsolete)
Comment 10 Regina Henschel 2025-11-08 01:05:51 UTC
The extended tooltip of the option "Keep formatting" is, "Applies the existing cell format of headers and first data row to the whole database range."

The property belongs to the attribute table:on-update-keep-styles of the <table:database-range> element in file format (section 19.687, part 3, ODF 1.4)
And that specifies, "The table:on-update-keep-styles attribute specifies the behavior if the database range is updated. If the attribute value is true, the cell styles that are assigned to the cells in the first non-label row of the database range are used for all rows with in the database range. If the attribute value is false, all cells in the database range are assigned the default cell style of the document assigned."

So I think, that LibreOffice behaves conform to the specification.