Bug 124247 - Hex representation of color is used for recent color tool tip after split color button is clicked
Summary: Hex representation of color is used for recent color tool tip after split col...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Aditya Sahu
URL:
Whiteboard: target:6.3.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2019-03-21 19:12 UTC by Jim Raykowski
Modified: 2019-04-09 04:26 UTC (History)
3 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 Jim Raykowski 2019-03-21 19:12:46 UTC
Steps to reproduce:

1) click on split color button to set font or highlight color
2) click on the drop down part of the color button
3) hover mouse pointer over first color in the recent color list

Results: color tool tip displays hex representation of color

Expected results: color tool tip displays color name if color is not a custom color
Comment 1 Durgapriyanka 2019-03-22 17:41:23 UTC
Thank you for reporting the bug. I can confirm the bug present in

Version: 6.3.0.0.alpha0+
Build ID: b6b28931435e44aca92b8c0e1659f701e3ed1a87
CPU threads: 2; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-01-30_06:57:04
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 2 Jim Raykowski 2019-03-24 18:02:25 UTC
I can provide code pointers for anyone who would like to work on this.
Comment 3 Xisco Faulí 2019-03-25 16:27:46 UTC
(In reply to Jim Raykowski from comment #2)
> I can provide code pointers for anyone who would like to work on this.

Hi Jim,
it would be fantastic to provide them and turn this into an easyhack if you can do so...
Comment 4 Xisco Faulí 2019-03-27 11:42:14 UTC
--- Comment #4 from Jim Raykowski <raykowj at gmail.com> ---
Here are some code pointers.

Classes to examine:

ToolboxButtonColorUpdater class
include/svx/tbxcolorupdate.hxx
svx/source/tbxctrls/tbxcolorupdate.cxx

SvxColorToolBoxControl class
include/svx/tbcontrl.hxx
svx/source/tbxctrls/tbcontrl.cxx

PaletteManager class
include/svx/PaletteManager.hxx
svx/source/tbxctrls/PaletteManager.cxx

Suggested approach:

Add a member function to the ToolboxButtonColorUpdater class that gets the
current color name.

Getting the current color name can be accomplished by:

parsing the color name from the tool box quick help text/tool tip text 
include/svx/tbxcolorupdate.hxx
sal_uInt16 const mnBtnId;
VclPtr<ToolBox> mpTbx;
include/vcl/toolbox.hxx
OUString ToolBox::GetQuickHelpText( sal_uInt16 nItemId )

or

adding a member variable to the ToolboxButtonColorUpdater class to store the
color name that is set in  
svx/source/tbxctrls/tbxcolorupdate.cxx
ToolboxButtonColorUpdater::Update(const NamedColor &rNamedColor) 

Replace the color hex representation string code with code that uses the
created get current color name function
svx/source/tbxctrls/tbcontrl.cxx
void SvxColorToolBoxControl::execute(sal_Int16 /*nSelectModifier*/)
include/svx/PaletteManager.hxx
PaletteManger::AddRecentColor

HTH

Message lost during the BZ outage -> https://lists.freedesktop.org/archives/libreoffice-bugs/2019-March/176596.html
Comment 5 Xisco Faulí 2019-03-27 11:43:10 UTC
Let's turn this into an easyHack.
Jim, thanks for providing the codepointers...
Comment 6 Commit Notification 2019-04-09 01:55:43 UTC
Aditya committed a patch related to this issue.
It has been pushed to "master":

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

tdf#124247: Fix tooltip message when color added to recent colors

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.