Bug 120562 - Selection of favorite character is not applied in special character dialog
Summary: Selection of favorite character is not applied in special character dialog
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: Special-Character
  Show dependency treegraph
 
Reported: 2018-10-13 12:09 UTC by Tamás Zolnai
Modified: 2019-01-13 13:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the inconsistent state of the dialog (28.91 KB, image/png)
2018-10-13 12:10 UTC, Tamás Zolnai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamás Zolnai 2018-10-13 12:09:30 UTC
Description:
In special character dialog there is a favorite list (if the user added some favorites earlier). Sometimes selecting an item from this list is not actually applied. Which means that the character preview is not updated in the dialog and also closing the dialog with Insert button does not insert the selected favorite character.

Steps to Reproduce:
1. Open Writer
2. Open special character dialog from the menu: Insert -> Special Character...
3. Select a character from the character table -> preview shows the selected character
4. Select a character from the favorite list -> preview shows wrong character
5. Push Insert button -> Wrong character is inserted to the document.

Actual Results:
Wrong character is inserted to the document.

Expected Results:
The selected character should be inserted to the document.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Tamás Zolnai 2018-10-13 12:10:37 UTC
Created attachment 145673 [details]
Screenshot of the inconsistent state of the dialog

On screenshot you can see that 'j' is selected, but the preview displays a different character. Also the preview window and the label under the preview is inconsistent.
Comment 2 Tamás Zolnai 2018-10-13 12:12:51 UTC
Let's turn this into an easy hack. The code is here:
cui/source/dialogs/cuicharmap.cxx
Comment 3 V Stuart Foote 2018-10-13 13:47:38 UTC
(In reply to Tamás Zolnai from comment #1)
> Created attachment 145673 [details]
> Screenshot of the inconsistent state of the dialog
> 
> On screenshot you can see that 'j' is selected, but the preview displays a
> different character. Also the preview window and the label under the preview
> is inconsistent.

Well, it is not "any" different character, rather it is the last character picked/pasted from the chart. 

And moving by mouse pointer from the chart to either the Recent bar or the Favorites bar behaves the same--the glyph preview is not refreshed. Unitl a selection is made (an actual click on the glyph). Or moving from Favorites to Recents.

So nothing really major here other than non-refresh of the preview screen on mouse click of a glyph in either bar.  Another facet is behavior on advance with <TAB> from chart to search box(es) to Recents and Favorites bars.  The selection will move, but neither the preview nor the Unicode name refreshes until glyph is actually clicked.

Between the two behaviors, which is preferred?
Comment 4 Xisco Faulí 2018-11-16 03:40:24 UTC Comment hidden (obsolete)
Comment 5 Tamás Zolnai 2018-11-16 13:21:40 UTC
(In reply to V Stuart Foote from comment #3)
> (In reply to Tamás Zolnai from comment #1)
> > Created attachment 145673 [details]
> > Screenshot of the inconsistent state of the dialog
> > 
> > On screenshot you can see that 'j' is selected, but the preview displays a
> > different character. Also the preview window and the label under the preview
> > is inconsistent.
> 
> Well, it is not "any" different character, rather it is the last character
> picked/pasted from the chart. 
> 
> And moving by mouse pointer from the chart to either the Recent bar or the
> Favorites bar behaves the same--the glyph preview is not refreshed. Unitl a
> selection is made (an actual click on the glyph). Or moving from Favorites
> to Recents.
> 
> So nothing really major here other than non-refresh of the preview screen on
> mouse click of a glyph in either bar.  Another facet is behavior on advance
> with <TAB> from chart to search box(es) to Recents and Favorites bars.  The
> selection will move, but neither the preview nor the Unicode name refreshes
> until glyph is actually clicked.
> 
> Between the two behaviors, which is preferred?

What do you mean nothing major? Your comments do not make any sense.

Here you say the preview is refreshed by clicking on the glyph (in the favorite list):
> And moving by mouse pointer from the chart to either the Recent bar or the
> Favorites bar behaves the same--the glyph preview is not refreshed. Unitl a
> selection is made (an actual click on the glyph)

Later you say the preview is not refreshed by clicking on the glyph (in the favorite list):
> So nothing really major here other than non-refresh of the preview screen on
> mouse click of a glyph in either bar.

This paradox points to the problem. In that use case what reproduce steps describes the selection does not work the same as in general.

The expected behavior is that if I select a character by clicking on it, the preview should be updated and pushing the Insert button should insert the selected character. That's all.

I know that TAB-ing also bugous, but that should be handled in an other bug report.
Comment 6 Xisco Faulí 2018-12-17 03:40:00 UTC Comment hidden (obsolete)
Comment 7 Commit Notification 2018-12-20 15:44:12 UTC
Sumit Chauhan committed a patch related to this issue.
It has been pushed to "master":

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

tdf#120562 , Selection of favorite character is not applied.

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 8 BogdanB 2019-01-13 13:37:20 UTC
Everything is ok now.

Tested on
Version: 6.3.0.0.alpha0+
Build ID: be8897d9c63a77b223a9c0aed1d2eb689e0e0082
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-02_04:49:04
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded