Bug 71413

Summary: WRITER and CALC: Font color toolbar button not redrawn in correct color
Product: LibreOffice Reporter: makeminemadmyron
Component: UIAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: barta, timofeev.i.s, tysontan, winfrieddonkers
Version: 3.6.0.4 releaseKeywords: regression
Hardware: x86 (IA32)   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=61868
Whiteboard:
i915 platform: i915 features:

Description makeminemadmyron 2013-11-09 00:51:40 UTC
Start with a new document and type a few words and insert an object like an image or math object. Highlight a word and change the font colour to anything other than the default using the Font color button on the Styles & Formatting toolbar. This causes the colour to change on the button to the last chosen colour, let's say green. Choosing other text at this point and clicking the font color button sets it to this last chosen colour, green. At this point everything is normal.

Now select one of the objects and the toolbar changes as appropriate. Click back on any of the text and the Styles & Formatting toolbar returns but with the initial colour, red, on the Font Color button, not the last one you had chosen, green. If you highlight any text and click the Font Color button it is still set to your last choice, green, but doesn't show that colour on the button.

Seems like a redraw problem when switching toolbars.

I'm using:

Version: 4.1.3.2
Build ID: 70feb7d99726f064edab4605a8ab840c50ec57a

on a machine running 64-bit Windows 7 with a Intel i5 processor.

This problem also exists in Calc.
Comment 1 makeminemadmyron 2013-11-09 01:59:10 UTC
A similar problem happens with the highlight button - when the toolbar get redrawn on the screen the button reverts to showing the default colour but it actually remembers the last colour used.

The background colour button seems to actually reset to the default colour which is more accurate in some ways because it reverts back to yellow but the button actually shows that it will be yellow. However, like most users I would prefer for it to remember the last colour I was using in the document.
Comment 2 makeminemadmyron 2013-11-09 02:02:24 UTC
Also, just discovered that once the Font color button and highlight color button have been redrawn with the incorrect colour that if I then start another blank document the Font and Highlight buttons will not take on a different colour on the toolbar and only show the default colour no matter what colour you last used. They do remember your last colour but just don't update/redraw correctly.
Comment 3 tommy27 2013-11-10 05:39:04 UTC
I confirm issue about Writer and Calc in 4.1.3.2 under Win7 64bit (I had not time to test Calc behaviour)

it's a regression of 3.6.0 release (it works in 3.5.7) and affects any release from then to date including Version: 4.2.0.0.alpha0+ 2013-11-01 build

I add GUI expert to CC list.
Ivan, is this something you can handle?
Comment 4 Ivan Timofeev (retired) 2013-11-10 11:08:13 UTC
Thanks for the report. I have a dirty solution... :)
Comment 5 Ivan Timofeev (retired) 2013-11-10 11:22:32 UTC
Tommy, in Calc 3.5.7 what was the color after switching back to the Styles & Formatting toolbar - the last chosen one or the selected cell's font color?
(Sorry, can't download 3.5.7 now - my current internet connection is poor.)
Comment 6 Ivan Timofeev (retired) 2013-11-12 13:34:03 UTC
Never mind, I've downloaded a 3.5.7.
Comment 7 tommy27 2013-11-25 03:08:57 UTC
*** Bug 71955 has been marked as a duplicate of this bug. ***
Comment 8 tommy27 2013-11-25 03:18:33 UTC
Bug affects Linux as well as reported in Bug 71955.
changed platform to ALL

@Ivan(In reply to comment #5)
> Tommy, in Calc 3.5.7 what was the color after switching back to the Styles &
> Formatting toolbar - the last chosen one or the selected cell's font color?

sorry for late reply, Ivan.

in Calc 3.5.7 the font color depends on which cell you select... if you select the same cell where you changed the color before, the font color icon reminds that color. if you select another empty cell the font color icon reverts to default color.

in Calc 4.1.3 the font color icon always reverts to default color regardless of the cell you choose
Comment 9 Ivan Timofeev (retired) 2013-12-15 16:53:05 UTC
Set to NEW, because I don't contribute to LibreOffice anymore.

My previous solution didn't work.

The problem here is that a color info is lost after destroying and creating a SvxColorExtToolBoxControl on toolbar hide and show, respectively.

http://opengrok.libreoffice.org/xref/core/svx/source/tbxctrls/tbcontrl.cxx#2429

Adding Winfried, maybe he can help.
Comment 10 Winfried Donkers 2013-12-16 06:52:22 UTC
(In reply to comment #9)
> Set to NEW, because I don't contribute to LibreOffice anymore.
> 
> My previous solution didn't work.
> 
> The problem here is that a color info is lost after destroying and creating
> a SvxColorExtToolBoxControl on toolbar hide and show, respectively.
> 
> http://opengrok.libreoffice.org/xref/core/svx/source/tbxctrls/tbcontrl.
> cxx#2429
> 
> Adding Winfried, maybe he can help.

I will have look at it in due time, am currently busy with calc functions.
Comment 11 Winfried Donkers 2013-12-30 13:47:56 UTC
A possible solution might be to store the last used colours in the class from which the buttons are created, i.e. ScDLL in the case of Calc.
However, this solution does not look right, as ScDLL has nothing to do with data such as last used colours of buttons. It disregards some principles of object oriented programming.

Another solution could be to keep the last used colours with the toolbar settings. This way it will even remember the last used colours when starting LibreOffice. But this will be a rather large change and is not familiar terrain for me at all.

All in all, I don't think it will be me patching this behaviour.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.