Bug 157638 - Useless comments of kind //90682 in GraphicImport.cxx
Summary: Useless comments of kind //90682 in GraphicImport.cxx
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Declan Fodor
URL:
Whiteboard: target:24.8.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2023-10-06 14:05 UTC by Regina Henschel
Modified: 2023-12-29 16:11 UTC (History)
4 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 Regina Henschel 2023-10-06 14:05:18 UTC
The file https://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/GraphicImport.cxx contains a lot of comments of the kind "// 90650" or "//90682". These comments are intended to help debugging. They are supposed to contain the numerical value of NS_ooxml::LN_CT_NonVisualDrawingProps_id or NS_ooxml::LN_CT_Hyperlink_URL, for example. All of these values in the comments are outdated and therefor are no longer helpful, but confusing.

I suggest to add a comment, that the values in the comments are outdated and that the actual numerical values can be found in workdir/CustomTarget/writerfilter/source/ooxml/resourceids.hxx in the build directory.

I'm not sure about removing the values in the comments, because that would affect the history.

Affected are the methods
void GraphicImport::lcl_sprm(Sprm& rSprm)
void GraphicImport::handleWrapTextValue(sal_uInt32 nVal)
void GraphicImport::lcl_attribute(Id nName, Value& rValue)
Comment 1 Stéphane Guillou (stragu) 2023-10-06 19:37:00 UTC
Thanks Regina, I can see the comment and trust you on the analysis.

Hossein, I assume an easyHack?
Comment 2 Hossein 2023-10-13 11:09:01 UTC
(In reply to Regina Henschel from comment #0)
> I'm not sure about removing the values in the comments, because that would
> affect the history.
It is possible to ignore some commits when invoking 'git blame':

How to exclude commits from git blame
https://www.stefanjudis.com/today-i-learned/how-to-exclude-commits-from-git-blame/

In this way, it would be safe to remove the above mentioned comments. In this case, it would be important to do the change in one run.

It is good to mention that we have .git-blame-ignore-revs file in LibreOffice core repository since 2019, so this is not something new:
https://opengrok.libreoffice.org/history/core/.git-blame-ignore-revs

(In reply to Stéphane Guillou (stragu) from comment #1)
> Hossein, I assume an easyHack?
Yes, this is an EasyHack. The EasyHacker should do the task in a single patch, and also update .git-blame-ignore-revs file.
Comment 3 Declan Fodor 2023-12-23 05:31:15 UTC
Looks like something that would be interesting to start out with. I will try it.
Comment 4 Commit Notification 2023-12-29 13:15:02 UTC
Declan Fodor committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1c235c1343ed7b88a3e6b923b9b0d6e567054f1c

tdf#157638 Removed old comments

It will be available in 24.8.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 5 Commit Notification 2023-12-29 16:02:24 UTC
Declan Fodor committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a8cd20ab56863413c2dc7d8c7f5f8c7f742e279d

tdf#157638 Added to git blame ignore list

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