Bug 117058 - Simplify calls to Menu::CheckItem
Summary: Simplify calls to Menu::CheckItem
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2018-04-17 08:54 UTC by Muhammet Kara
Modified: 2019-12-25 16:51 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 Muhammet Kara 2018-04-17 08:54:30 UTC
If you wanted to check a menu item by its name, you had to do it like this:

pGearMenu->CheckItem( pGearMenu->GetItemId("gear_iconOnly") );

Now we can do it just like this:

pGearMenu->CheckItem( "gear_iconOnly" );


There are still some instances of the old-style calls that needs to be changed. You can search with "git grep CheckItem" for such instances, and change them to the new style. Just make sure it is a call to the CheckItem method of the Menu class (or one of its sub-classes), but not a call to CheckItem method of an unrelated class.

Example commit: https://cgit.freedesktop.org/libreoffice/core/commit/?id=66ed9797ba8f61994a187dfcc189f375dcd0cdcc
Comment 1 Kevin Dubrulle 2018-05-27 09:52:19 UTC
Hi, I will work on that bug.
Comment 2 Xisco Faulí 2018-06-27 02:45:43 UTC Comment hidden (obsolete)
Comment 3 Kevin Dubrulle 2018-06-27 17:34:33 UTC
Hi,

Didn't have time recently, but I will !
Comment 4 Xisco Faulí 2018-07-28 02:41:05 UTC Comment hidden (obsolete)
Comment 5 Commit Notification 2018-08-10 07:26:11 UTC
Arnold Dumas committed a patch related to this issue.
It has been pushed to "master":

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

tdf#117058: Simplify calls to Menu::CheckItem

It will be available in 6.2.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 6 Commit Notification 2018-08-29 14:42:48 UTC
Arnold Dumas committed a patch related to this issue.
It has been pushed to "master":

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

tdf#117058: Simplify calls to Menu::CheckItem

It will be available in 6.2.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 7 Xisco Faulí 2018-09-29 02:40:24 UTC Comment hidden (obsolete)
Comment 8 Kevin Dubrulle 2018-09-29 15:34:18 UTC
Well, I would like, but my main computer has a broken screen, thanks to a cat attack, followed by the encouter with the ground...
Comment 9 Xisco Faulí 2018-10-30 03:54:38 UTC Comment hidden (obsolete)
Comment 10 Xisco Faulí 2018-11-30 03:56:57 UTC Comment hidden (obsolete)
Comment 11 Xisco Faulí 2018-12-31 03:40:50 UTC Comment hidden (obsolete)
Comment 12 Xisco Faulí 2019-01-31 03:46:19 UTC Comment hidden (obsolete)
Comment 13 Xisco Faulí 2019-03-03 03:37:01 UTC Comment hidden (obsolete)
Comment 14 Muhammet Kara 2019-03-06 13:24:28 UTC
Let's keep this open for new contributors.

@Kevin: Please don't hesitate to assign it back to yourself if you are willing to solve and close it.
Comment 15 Vincent Woltmann 2019-03-09 16:57:52 UTC
I would like to finish the work on this bug. Doing a quick git grep shows that there are not that many occasions left. But it is a bit unclear to me wether the remaining occasions are actually calls to a subclass of Menu or an unrelated class. Is there any easy way to get some kind of dependency graph or general inheritance overview?
Comment 16 Paje test 2019-12-25 16:51:09 UTC
Seems completed.