Bug 155757 - Support Color Filter in "Standard Filter" dialog enhancement - missing background colors choice in filter field. UI french
Summary: Support Color Filter in "Standard Filter" dialog enhancement - missing backgr...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0
Keywords: haveBacktrace, implementationError
Depends on:
Blocks: Data-Filter
  Show dependency treegraph
 
Reported: 2023-06-09 13:34 UTC by Regis Perdreau
Modified: 2023-09-04 05:17 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test-file (27.08 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-06-09 13:35 UTC, Regis Perdreau
Details
Test autofilter wit background color, no selection, or A column selected (5.68 MB, video/mp4)
2023-06-20 09:59 UTC, Regis Perdreau
Details
Test autofilter with background color, with range defined (7.24 MB, video/mp4)
2023-06-20 10:00 UTC, Regis Perdreau
Details
Test autofilter wit background color, range A1-A18 defined (4.10 MB, video/mp4)
2023-06-21 14:25 UTC, Regis Perdreau
Details
Backtrace (14.09 KB, text/plain)
2023-08-18 01:43 UTC, Aron Budea
Details
Autofilter sort by color background list (23.21 KB, image/png)
2023-08-31 13:00 UTC, Regis Perdreau
Details
Background color list in standard filter. (26.89 KB, image/png)
2023-08-31 13:01 UTC, Regis Perdreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regis Perdreau 2023-06-09 13:34:31 UTC
Description:
Color filter choice is missing in filter field. 

Steps to Reproduce:
1.load test file
2.open autofilter dialog
3.open standard filter
4. in the first line of filter dialogue "color", select in second field "background"
5. in the third field you should see a choice of different color,  you'll cell content instead 

Actual Results:
- cell contents 

Expected Results:
- a set of background color


Reproducible: Always


User Profile Reset: No

Additional Info:
tested in Version: 7.6.0.0.beta1+ (X86_64) / LibreOffice Community
Build ID: a0ce0d4418ad92dd0e3a70cf698c549b544d6084
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 1 Regis Perdreau 2023-06-09 13:35:01 UTC
Created attachment 187811 [details]
test-file
Comment 2 ady 2023-06-09 15:31:30 UTC
In Filter by Color, I see the name of the colors, not the content; but comment 0 is not clear to me.

Perhaps attaching a screenshot of what you see as incorrect would help?

Additionally, attachment 187811 [details] from comment 1 mentions the following (which is not the same as comment 0):

"
test dark  orange  4 -cell 11
background color
color not present in color selector if cell is empty
background color items not always present in standard filter
"

Such behavior depends on how you select the autofilter area:

* If you just click on cell A1 and then Autofilter, the autofilter goes as far as the first empty cell in the column.

* If, instead, you first select the relevant area (A1:A18, or the entire column A:A), then all the values and all the respective colors will be included in the autofilter list.
Comment 3 Regis Perdreau 2023-06-20 09:57:48 UTC
It seems the behavior is better with 7.6 beta. I can see now background-color selector in  standard-filter.

Version: 7.6.0.0.beta1+ (X86_64) / LibreOffice Community
Build ID: a0ce0d4418ad92dd0e3a70cf698c549b544d6084
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: fr-FR (fr_FR); UI: en-GB
Calc: CL threaded

I think the behaviour can confuse user... 
If we select all A column, not all colors are present in the sort selector. See
Screenshot test-color-1.mp4
if we define a data range like A1-A18, all colors are now present. See screenshot test-color-2.mp4
Comment 4 Regis Perdreau 2023-06-20 09:59:12 UTC
Created attachment 188012 [details]
Test autofilter wit background color, no selection, or A column selected
Comment 5 Regis Perdreau 2023-06-20 10:00:08 UTC
Created attachment 188013 [details]
Test autofilter with background color, with range defined
Comment 6 ady 2023-06-20 22:27:40 UTC
STR for attachment 187811 [details]:
1. Deactivate Autofilter.
2. Select relevant area for each test case.
3. Activate Autofilter and follow the additional steps for:
3.1. Sort by color
3.2. Filter by color
3.3. Standard Filter by background color


(In reply to Regis Perdreau from comment #3)

> I think the behaviour can confuse user... 
> If we select all A column, not all colors are present in the sort selector.
> See
> Screenshot test-color-1.mp4

I see 8 colors in the sort list, in the filter list and in the standard filter.

> if we define a data range like A1-A18, all colors are now present. See
> screenshot test-color-2.mp4

Same as above.

The only case in which the list of colors is "incomplete" is when the filter is applied when the selected area is limited to cell A1 only (or rather, no selected area, just cell A1 has the focus when Autofilter is initially activated). This is as I described in comment 2. So that would be NAB.

Someone else would have to attempt to reproduce the behavior seen by the reporter.
Comment 7 Regis Perdreau 2023-06-21 14:25:13 UTC
Created attachment 188043 [details]
Test autofilter wit background color, range A1-A18 defined
Comment 8 Regis Perdreau 2023-06-21 14:26:42 UTC
We  have a standard filter with no possibility to choose background color (in autofilter)



In Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
Comment 9 ady 2023-06-21 20:41:01 UTC
(In reply to Regis Perdreau from comment #8)
> We  have a standard filter with no possibility to choose background color
> (in autofilter)

> In Version: 7.5.4.2 (X86_64) / LibreOffice Community

You originally reported the behavior for LO 7.6+, and I've been testing (repeated times) with 7.6+ or newer Dev versions. As I already said, with such tests I have not reproduced the problems.

I still could not repro with LO 7.5.3.2.

I'll reset this from NEEDINFO to UNCONFIRMED, until someone can repro this.

I'll change the Version field from 7.6.x to 7.5.4.2 too (for now).

I have to wonder whether any of the Locale and/or UI language settings make any difference, considering the different resulting behavior I see.

If there are problems with LO 7.5, perhaps some back-port / cherry-pick is needed.
Comment 10 ady 2023-06-21 21:48:24 UTC
(In reply to ady from comment #9)

> I still could not repro with LO 7.5.3.2.

> I have to wonder whether any of the Locale and/or UI language settings make
> any difference, considering the different resulting behavior I see.

Setting the UI to French (France), I can repro.

Setting the UI to English (US), no repro.

Setting to NEW.
Comment 11 ady 2023-06-23 13:14:13 UTC
(In reply to ady from comment #10)
> Setting the UI to French (France), I can repro.
> Setting the UI to English (US), no repro.

The [META] bug 142076 is (ATM):
(AutoFilter-Color) - [META] Color filtering in Autofilter bugs and enhancements

I don't see a meta for Standard Filter -  Color (neither background nor font).

I am unsure whether to CC Samuel Mehrbrodt about this bug 155757.

I am also not sure whether this is a "normal" bug, or instead it is related to some form of translation problem and/or UX/UI bug. Let's see if UX can help in any of these doubts > needsUXEval.
Comment 12 Heiko Tietze 2023-07-03 14:43:17 UTC
The fact that both font and background color show a spinbox (rather the expected list of applied colors) clearly indicate a missing implementation.

All background or font colors of the selection should be listed. And ideally we can also include empty cells with a background- currently those are not available in any filter.

Me doesn't hesitate to bother Samuel with this, the awesome developer who introduced the feature.
Comment 13 Heiko Tietze 2023-07-03 14:59:19 UTC
Got fooled by macOS. The dropdown lists the color of all cells with content except  the first. Testing with yellow/1, red/2, green/3 and only red and green show up (or only green if A3 is empty). 

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6ae13c5fc5b28efeb1f6b75d4f6574bae20af37c
CPU threads: 8; OS: Mac OS X 13.4.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_DE.UTF-8); UI: en-US
Calc: threaded
Comment 14 ady 2023-07-03 17:11:17 UTC
(In reply to Heiko Tietze from comment #13)
> Locale: en-US (en_DE.UTF-8); UI: en-US

Please re-read comment 10.

Regarding listing "no BC", that would be a different report (for which I don't see a problem).

Regarding listing cells with no content, that would be a different report (and it is not clear to me what the problem would be, considering what I already posted in comment 2 and in comment 6).
Comment 15 Regis Perdreau 2023-08-14 12:59:03 UTC
So, are there any code pointers to understand this lack of l10n support ? If relevant. Regards.
Comment 16 Regis Perdreau 2023-08-17 08:52:08 UTC
It Work in DE, IT, ES with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 218a7650a5cf03f895bed19c68d6f02daec536e9
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: fr-FR
Calc: CL threaded

But in French with the string "Couleur d'arrière-plan" the list of colour is not rendered... Is it possible to confirm that there is an encoding problem with this string ?
Comment 17 Aron Budea 2023-08-18 01:43:39 UTC
Created attachment 189017 [details]
Backtrace

When opening Standard Filter in the autofilter in French language, I get the following assert in a debug build:

sc/source/ui/dbgui/filtdlg.cxx :117 : ScFilterDlg::ScFilterDlg(SfxBindings*, SfxChildWindow*, weld::Window*, const SfxItemSet&):  l'assertion « m_xLbCond1->find_text(aStrBackgroundColor) != -1 » a échoué.


Since there is no assertion failure when using English language, it seems to be related to the reported problem.
Comment 18 Aron Budea 2023-08-18 04:43:55 UTC
As I can see the problem here is caused by two instances of the text "Background color" that are capitalized differently in the French translation.

1. The string SCSTR_FILTER_BACKGROUND_COLOR_COND:
#define SCSTR_FILTER_BACKGROUND_COLOR_COND          NC_("STANDARDFILTERDIALOG_COND", "Background color")
https://opengrok.libreoffice.org/xref/core/sc/inc/strings.hrc?r=bb5e0368#43

Translated as: "Couleur d'arrière-plan"

https://translations.documentfoundation.org/translate/libo_ui-master/scmessages/fr/?checksum=54fb1a3892885776&sort_by=-priority,position
source string description: sGJCz

There's even a comment in the .hrc file:
// This must match the translation of the same strings of standardfilterdialog|cond

2. Items in standardfilterdialog.ui

<item translatable="yes" context="standardfilterdialog|cond">Background color</item>

https://opengrok.libreoffice.org/xref/core/sc/uiconfig/scalc/ui/standardfilterdialog.ui?r=12606799#434
https://opengrok.libreoffice.org/xref/core/sc/uiconfig/scalc/ui/standardfilterdialog.ui?r=12606799#473
https://opengrok.libreoffice.org/xref/core/sc/uiconfig/scalc/ui/standardfilterdialog.ui?r=12606799#512
https://opengrok.libreoffice.org/xref/core/sc/uiconfig/scalc/ui/standardfilterdialog.ui?r=12606799#551

Translated as: "Couleur d'Arrière-plan"

https://translations.documentfoundation.org/translate/libo_ui-master/scmessages/fr/?checksum=c4ed5542833dcf1c&sort_by=-priority,position
source string description: 5Wa7m
Comment 19 Regis Perdreau 2023-08-18 20:46:16 UTC
I have to change this string "Couleur d'Arrière plan" by "Couleur arriere plan" to make the program run. (as other accepted language has only ascii letter)
Neither "'" and "è" are accepted. I suspect an encoding problem but it's tricky to follow where.
Could someone confirm ?
Comment 20 Aron Budea 2023-08-19 02:11:56 UTC
The problem is only with the different capitalization. Changing "Arrière" to "arrière" or vice versa in the respective strings should solve this issue.
Comment 21 Regis Perdreau 2023-08-19 06:33:52 UTC
I respectfully disagree. May be another underlaying problem...
Comment 22 Aron Budea 2023-08-19 12:46:25 UTC
I might've misunderstood, and there're more parts to this problem, but I'm fairly sure the reason why the colors aren't showing in French language is what I described.

This is the assert:
assert(m_xLbCond1->find_text(aStrBackgroundColor) != -1);
https://opengrok.libreoffice.org/xref/core/sc/source/ui/dbgui/filtdlg.cxx?r=d84291f5#117


There are a couple of comparisons of one string with the other (the strings are described in comment 18), like this:

OUString sSelectedCondition = maCondLbArr[nPos]->get_active_text();
if (sSelectedCondition == aStrFontColor)
    aColors = pList->maFilterEntries.getTextColors();
else if (sSelectedCondition == aStrBackgroundColor)
    aColors = pList->maFilterEntries.getBackgroundColors();
https://opengrok.libreoffice.org/xref/core/sc/source/ui/dbgui/filtdlg.cxx?r=d84291f5#648


It would be fairly easy to make the code do case-insensitive comparison as a "hack", which would solve this and similar cases, but there are also searches like the assert itself, and eg. this that tries to find the text among the items that'd require more complex workarounds that can be simply solved by fixing the translation:

nCondPos = maCondLbArr[i]->find_text(
    rEntry.IsQueryByTextColor() ? aStrFontColor : aStrBackgroundColor);
https://opengrok.libreoffice.org/xref/core/sc/source/ui/dbgui/filtdlg.cxx?r=d84291f5#1454

The string itself matters for none of these cases, the problem is only due to them being different.
Comment 23 Regis Perdreau 2023-08-19 13:00:07 UTC
Ok, i have asked a translation modification.
Comment 24 Regis Perdreau 2023-08-19 13:28:15 UTC
ok, i have fully rebuilded LO. The string "Couleur d'arrière-plan" is working... now...
Comment 25 ady 2023-08-20 01:56:34 UTC
Considering comment 18 (quote):
"
There's even a comment in the .hrc file:
// This must match the translation of the same strings of standardfilterdialog|cond
"

Perhaps some kind of (unit) test should be included, in order to warn when (new/modified/current) relevant translations are not a match, so as to avoid future problems similar to this report? IDK whether such thing is even possible, but if it is...
Comment 26 Regis Perdreau 2023-08-31 12:59:32 UTC
It's almost perfect except standard filter background color list...Version 7.6.1.1 windows fr.
- In the Autofilter menu, sort by color , we have all background color
(see screenshot)
- In the Standard filter background color option, we have only one color.
(see screenshot)
Comment 27 Regis Perdreau 2023-08-31 13:00:22 UTC
Created attachment 189290 [details]
Autofilter sort by color background list
Comment 28 Regis Perdreau 2023-08-31 13:01:10 UTC
Created attachment 189291 [details]
Background color list in standard filter.
Comment 29 Regis Perdreau 2023-09-01 10:18:32 UTC
The same in master, 

if the cell is empty : "sort by color" in Autofilter menu is different from "background color" list in standard filter.
If the cell is not empty : "sort by color" in Autofilter menu is the same than "background color" list in standard filter.


Is it possible to be consistent between the result of "sort by color" and "background color" list in standard filter ?
Comment 30 Aron Budea 2023-09-04 05:17:21 UTC
(In reply to Regis Perdreau from comment #29)
> if the cell is empty : "sort by color" in Autofilter menu is different from
> "background color" list in standard filter.
> If the cell is not empty : "sort by color" in Autofilter menu is the same
> than "background color" list in standard filter.
I can confirm this behavior, however it seems different from the originally reported bug (it isn't specific to French language, either).
Seems similar to bug 122975, perhaps it would be worth following up there.

Let me close this bug report, since it was fixed by the translation update.