Bug Hunting Session
Bug 90341 - Clean up excessive const_cast'ing
Summary: Clean up excessive const_cast'ing
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Keywords: difficultyBeginner, easyHack, needsDevEval, skillCpp, topicCleanup
Depends on:
Reported: 2015-03-30 06:50 UTC by Stephan Bergmann
Modified: 2017-02-14 08:58 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2015-03-30 06:50:04 UTC
Find C++ source files that need a suspiciously high amount of const_cast, then see if some of them are due to poor design that can be improved (by e.g. making relevant member functions const, making relevant member variables mutable, making relevant variables pointer to non-const).

(You can use something like

> git grep --word-regexp --count const_cast | sort --numeric-sort --key=2 --field-separator=:

to get the high-scorers of const_cast usage.)
Comment 1 Robinson Tryon (qubit) 2015-12-10 11:40:55 UTC Comment hidden (obsolete)
Comment 2 Commit Notification 2016-01-06 13:36:46 UTC
Takeshi Abe committed a patch related to this issue.
It has been pushed to "master":


tdf#90341 Clean up excessive const_cast'ing

It will be available in 5.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:

Affected users are encouraged to test the fix and report feedback.
Comment 3 Robinson Tryon (qubit) 2016-02-18 14:52:26 UTC Comment hidden (obsolete)
Comment 4 jani 2016-08-05 09:19:45 UTC
Please be aware, that this easyhack is considered an important but large scale cosmetic change as described in https://wiki.documentfoundation.org/Development/LargeScaleChanges

It was in decided by the ESC to close this kind of easyhacks, and send them directly as mail, to new contributors.

Please do not submit patches with many files !!

This easyhacks should/will be opened, when we have a window to do largescale changes.
Comment 5 Xisco Faulí 2016-09-27 10:36:09 UTC Comment hidden (obsolete)