Bug 113959 - svxlo-FrameDirectionListBox should be used rather than GtkComboBox for text direction drop down list
Summary: svxlo-FrameDirectionListBox should be used rather than GtkComboBox for text d...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Gabor Kelemen (allotropia)
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks: Writer-Table-Properties-Dialog l10n-Optimization
  Show dependency treegraph
 
Reported: 2017-11-20 22:47 UTC by Yousuf Philips (jay) (retired)
Modified: 2018-08-08 08:50 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 Yousuf Philips (jay) (retired) 2017-11-20 22:47:27 UTC
The Table tab of the Table Properties dialog utilizes a GtkListStore[1] of values to fill the Text Direction GtkComboBox, when it should utilize svxlo-FrameDirectionListBox and its code based strings[2] similar to the Alignment tab[3] of the Paragraph dialog.

This issue should also be resolved in columnpage.ui[1] (Insert > Section > Columns) as well to time save time for translators not to have to retranslate them multiple times. Would be good to fix up frmaddpage.ui[5] (Insert > Frame > Frame > Options) as well if possible, though it has 2 additional items.

[1] https://opengrok.libreoffice.org/xref/core/sw/uiconfig/swriter/ui/formattablepage.ui#577

[2] https://opengrok.libreoffice.org/xref/core/cui/inc/strings.hrc#302

[3] https://opengrok.libreoffice.org/xref/core/cui/uiconfig/ui/paragalignpage.ui#424

[4] https://opengrok.libreoffice.org/xref/core/sw/uiconfig/swriter/ui/columnpage.ui#734

[5] https://opengrok.libreoffice.org/xref/core/sw/uiconfig/swriter/ui/frmaddpage.ui#491
Comment 1 Buovjaga 2017-11-21 09:21:14 UTC
I believe you, so -> NEW
Comment 2 Yousuf Philips (jay) (retired) 2017-11-21 12:29:23 UTC
Gabor: This something you would be interested in taking on?
Comment 3 Ekansh Jha 2017-12-02 03:00:17 UTC
(In reply to Yousuf Philips (jay) from comment #0)
> The Table tab of the Table Properties dialog utilizes a GtkListStore[1] of
> values to fill the Text Direction GtkComboBox, 

> when it should utilize svxlo-FrameDirectionListBox 
I have to use svxlo-FrameDirectionListBox in place of GtkComboBox.

>and its code based strings[2] similar to the Alignment tab[3] of the Paragraph dialog.

I didn't get this line. what exactly I have to do. Please help me.
Comment 4 Yousuf Philips (jay) (retired) 2017-12-02 18:34:59 UTC
(In reply to Ekansh Jha from comment #3)
> I have to use svxlo-FrameDirectionListBox in place of GtkComboBox.

Yes

> I didn't get this line. what exactly I have to do. Please help me.

This showed an example of svxlo-FrameDirectionListBox being implemented in another dialog tab, so you can look at how its implemented there if you couldnt figure it out.
Comment 5 Ekansh Jha 2017-12-03 05:06:02 UTC
Hey! I have submitted a try patch. Please look into it and tell the area to improve. 
Thanks
Comment 6 Xisco Faulí 2017-12-03 18:51:24 UTC
Gerrit patch: https://gerrit.libreoffice.org/#/c/45732/
Comment 7 Gabor Kelemen (allotropia) 2017-12-04 21:19:27 UTC
(In reply to Yousuf Philips (jay) from comment #2)
> Gabor: This something you would be interested in taking on?

Yes, I did a bit of work on this. Sounded easy, but difficult enough to not assign myself to this.

(In reply to Ekansh Jha from comment #3)
> >and its code based strings[2] similar to the Alignment tab[3] of the Paragraph dialog.
> 
> I didn't get this line. what exactly I have to do. Please help me.

There are multiple things to do here.
- First changing the listbox to svxlo-FrameDirectionListBox in Glade. I see you already did that, but this is just a first step.
- Then removing the liststore
- Since we changed the object type, we need to change it in sw/source/uibase/table/tablepg.hxx as well. Adding the svx/frmdirlbox.hxx header is needed for this to work.
- This is necessary so that in sw/source/ui/table/tabledlg.cxx creating the object from the .ui file can still work with this line: 
 get(m_pTextDirectionLB, "textdirection")
- Then we need to populate the svxlo-FrameDirectionListBox with the actual RID_SVXSTR_FRAMEDIR_* items found in cui/inc/strings.hrc using InsertEntryValue() calls. The .hrc file needs to be included as well in tabledlg.cxx.
- Now we can think about localization as well. Since this summer the localization infrastructure changed hugely.
So if we have a string in cui/inc/strings.hrc, we just call CuiResId(RID_SVXSTR_FRAMEDIR_*) and we are good to go.
Until, we try to do that inside the cui module, and not in e.g. sw... like now.
In this case we need to include unotools/resmgr.hxx and use the Translate::Create and Translate::get methods.

On the UI the most visible result is in KeyID locale. If you go to the Table Properties window's Table page, in the Text direction dropdown you should see the same IDs there as on the Paragraph dialog -> Alignment tabs Text direction dropdown.

All of this is pushed to:
https://gerrit.libreoffice.org/45823

Doing the same for columnpage.ui and frmaddpage.ui should be rather straightforward after this.
Comment 8 Ekansh Jha 2017-12-05 03:08:37 UTC
Gabor : As you have already submit the bug. I think, I should unassign.
Comment 9 Commit Notification 2017-12-09 08:46:35 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=686e55d9e87b8dd7a3cfe22f9a6df9c77de3ce09

tdf#113959 Use svxlo-FrameDirectionListBox instead of ListBox

It will be available in 6.1.0.

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 10 Commit Notification 2017-12-11 12:16:34 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=18aaca86fc0733244f36b761479c8dd476752a30

tdf#113959 Use svxlo-FrameDirectionListBox instead of ListBox

It will be available in 6.1.0.

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 11 Commit Notification 2017-12-12 13:46:00 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9807290ccb87c0901a53f885a81a6aab93181f1d

tdf#113959 Use svxlo-FrameDirectionListBox instead of ListBox

It will be available in 6.1.0.

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 12 Gabor Kelemen (allotropia) 2017-12-17 18:50:48 UTC
I guess it's okay if this stays 6.1 material.
Comment 13 Yousuf Philips (jay) (retired) 2017-12-19 12:54:24 UTC
(In reply to Gabor Kelemen from comment #12)
> I guess it's okay if this stays 6.1 material.

Yep that is fine, as we dont want extra work for translators in the 6.0 cycle. :D
Thanks for the hard work.
Comment 14 Commit Notification 2018-04-23 10:17:59 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "master":

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

tdf#113959 Use simple SvxResId calls here

It will be available in 6.1.0.

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.