Bug 56882 - Font list is unsorted in 'insert special character' dialog
Summary: Font list is unsorted in 'insert special character' dialog
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
4.0.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:4.0.0
Keywords: regression
Depends on:
Blocks: mab4.0
  Show dependency treegraph
 
Reported: 2012-11-08 16:28 UTC by Regina Henschel
Modified: 2012-11-29 11:55 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of insert special character font list (12.72 KB, image/png)
2012-11-08 16:28 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2012-11-08 16:28:19 UTC
Created attachment 69726 [details]
Screenshot of insert special character font list

Scroll through the font list in the 'insert special character' dialog. Notice, that the font names are not sorted, see attached screen shot.

It is very hard to find the desired font, if the font names are not alphabetic ordered.
Comment 1 Korrawit Pruegsanusak 2012-11-11 16:47:07 UTC
Confirmed on Win7 64bit, with build from W2008R2@16-minimal_build, pull time 2012-11-09 00:53:19, core: 70ec826eeb8f0b311095869e23be1db95fc9d109

And, NOT reproduced on master daily build dated 2012-08-01 01:16:50
Comment 2 Julien Nabet 2012-11-11 21:27:27 UTC
On pc Debian x86-64 with master sources updated today, I reproduced the problem.

Perhaps I'm wrong but it seems the font list is initialized here:
cui/source/dialogs/cuicharmap.cxx, line 264 void SvxCharacterMap::init()

Cédric: one for you?
Comment 3 Roman Eisele 2012-11-17 15:56:31 UTC
Set Platform to “All/All”: this problem is present on all platforms, as comment #2 confirmed it for pc Debian x86-64, and I can confirm it ([REPRODUCIBLE])
for Mac OS X: the bug is present in LOdev 4.0.0.0.alpha0+ (Build ID: ed8067;
pull time: 2012-11-15 03:54:19) for Mac OS X.
Comment 4 Roman Eisele 2012-11-17 16:10:37 UTC
When was this regression introduced? 

At least in the Mac OS X version, the bug is not yet present in
* master~2012-09-24_23.40.55_LibO-Dev_3.7.0.0.alpha0_MacOS_x86_install_en-US
* master~2012-09-27_04.27.30_LibO-Dev_3.7.0.0.alpha0_MacOS_x86_install_en-US

But I can REPRODUCE it in
* master~2012-09-30_06.38.06_LibO-Dev_3.7.0.0.alpha0_MacOS_x86_install_en-US
* master~2012-10-01_23.33.15_LibO-Dev_3.7.0.0.alpha0_MacOS_x86_install_en-US
* and so on.

So the bug has been introduced between 2012-09-27 04.27.30 and 2012-09-30 06.38.06.

But was has happened in this timeframe? The new Widged Layout feature landed in master, and one of the dialog windows which were ported to the Widget Layout (.ui files) first is the “Insert special character” dialog. So I fear that something in the widgetification of that dialog window went wrong ...

Of course, I may be wrong; I don’t want to blame anybody (and I really love the new Widget Layout feature!); I just want to help ...


@ Caolán:
As our expert for the widget layout, could you please take a look into the commits related to the widgetification of the “Insert special character” dialog and check, if there could be the reason for the introduction of this bug?

Thank you very much!
Comment 5 Julien Nabet 2012-11-18 13:45:33 UTC
It could be the commit http://cgit.freedesktop.org/libreoffice/core/commit/?id=2f6e8daf883fe67a1cebc2cdf9d54e41b064a55c

I noticed this in the removed part:
- ListBox LB_FONT
- {
- HelpID = "cui:ListBox:RID_SVXDLG_CHARMAP:LB_FONT";
- Pos = MAP_APPFONT ( 42 , 6 ) ;
- Size = MAP_APPFONT ( 70 , 58 ) ;
- Sort = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };

LB_FONT was linked to aFontLB and has been replaced by m_pFontLB. This one is ListBox* type. Then I suppose the new code uses InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
Now perhaps GetDevFont should be investigated or perhaps a new function should be created to retrieve fonts in alphabetical order.
Comment 6 Caolán McNamara 2012-11-20 16:33:26 UTC
yup, sorting wasn't ported across during.ui conversion
Comment 7 Not Assigned 2012-11-20 16:53:21 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0894db6f532a0a27d8da57d3e191d2ccb198ebf0

Resolves: fdo#56882 font list in insert symbols not sorted



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Caolán McNamara 2012-11-20 16:54:26 UTC
that should do it
Comment 9 Roman Eisele 2012-11-29 11:55:18 UTC
VERIFIED as FIXED
with LOdev 4.0.0.0.alpha1+ (Build ID: 519c947f213ec69b0c92d3ea76193270644263e; pull time: 2012-11-28 04:07:39) on Mac OS X 10.6.8 (Intel).

The font list is sorted again.


@ Caolán:
Thank you very much for fixing this issue ...

@ Julien Nabet:
... and thank you very much for debugging it!