Bug 123021 - Cancel doesn't cancel in Tools > Options > Chart colours
Summary: Cancel doesn't cancel in Tools > Options > Chart colours
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.0.7.3 release
Hardware: All All
: medium minor
Assignee: Jim Raykowski
URL: https://help.libreoffice.org/6.3/en-U...
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-28 17:42 UTC by Katarina Behrens (Inactive)
Modified: 2019-02-24 23:17 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katarina Behrens (Inactive) 2019-01-28 17:42:49 UTC
Description:
Cancelling the option dialog to configure default chart colours, the changes are applied anyway

Steps to Reproduce:
1. Tools > Options > Charts > Default colours
2. Pick any colour from the list on the left (Data series 1 .. Data series N)
3. Pick any palette and any replacement colour in the palette selector on the right
4. Click Cancel
5. Back to step 1 (revisit default colours dialog/tabpage)

Actual Results:
The selected data series colour has changed i.e. the changes were applied

Expected Results:
Since 'Cancel' was clicked, the selected data series colour should've stayed the same as it was in the original palette


Reproducible: Always


User Profile Reset: No



Additional Info:
this is extremely minor so don't worry about it too much, right?!
Comment 1 MM 2019-01-28 22:29:40 UTC
Confirmed on mint 19.1 with Version: 6.3.0.0.alpha0+
Build ID: 3424004cca7cb61043800f0ff0acc9de64768276
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-26_00:45:09
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Confirmed with Version: 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.2
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: threaded
Comment 2 Jim Raykowski 2019-01-29 02:56:55 UTC
Whew! Didn't know if Katarina's comment in Additional Info was intended that this should actually be fixed quickly. I think it should be. So I jumped right in trying to find how I introduced this bug. Could have saved myself some stress by looking at the version (earliest affected) 6.0.7.3. This was way before the palette selection patch I made was merged. :-)

Putting this one on the try to fix without breaking other things list.

For anyone that would like to try to fix this, here is where I was looking: 

pChartOptions is always true here:

cui/source/options/optchart.cxx

void SvxDefaultColorOptPage::dispose()
{
    // save changes
    if (pChartOptions)
    {
        pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
        pChartOptions->Commit();

        pColorConfig.reset();
        pChartOptions.reset();
    }
    ...
}

Now off to try to fix something I did break :(
Comment 3 Katarina Behrens (Inactive) 2019-01-29 08:38:54 UTC
(In reply to Jim Raykowski from comment #2)
> Whew! Didn't know if Katarina's comment in Additional Info was intended that
> this should actually be fixed quickly. 

Ah nope, quite the contrary. 
It's not that my daily work would depend on formatting chart data series, I found this bug by accident.
Comment 4 Timur 2019-01-29 09:36:18 UTC
(In reply to Katarina Behrens (CIB) from comment #0)
> this is extremely minor so don't worry about it too much, right?!

Not right. 
If "Press Cancel to cancel" doesn't really cancel, what in the world could we have confidence at. 

But there seems more to be in this bug if OK is pressed:
- if Data series i.e. 10 is selected, on revisit Data series 1 is still selected. 
- if replacement colour in the palette selector on the right is changes, on revisit it's not. 
I may not understand how this is supposed to work (and some images in Help would be nice) but this doesn't look logical.
Comment 5 Jim Raykowski 2019-01-31 18:37:26 UTC
Here is a purposed patch for review and comments:

https://gerrit.libreoffice.org/#/c/67236/
Comment 6 Commit Notification 2019-02-16 12:14:13 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/16d2876b61520a765a111d7c38d60b143e669a37%5E%21

tdf#123021 Fix options dialog cancel doesn't cancel chart color changes

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 MM 2019-02-22 14:05:39 UTC
Confirmed fixed on mint 19.1 with Version: 6.3.0.0.alpha0+
Build ID: a9eb7df678655bd71f062ba404b7d6b6f9cc18d4
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-02-21_16:52:40
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded