Bug 130981 - Simplify uses of sal_math_Double
Summary: Simplify uses of sal_math_Double
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: james
URL:
Whiteboard: target:7.0.0
Keywords: difficultyMedium, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2020-02-27 09:47 UTC by Mike Kaganski
Modified: 2020-10-22 07:10 UTC (History)
2 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 Mike Kaganski 2020-02-27 09:47:49 UTC
We have a helper union sal_math_Double (defined in include/sal/mathconf.h) to help low-level access to double parts. It already has a member "value" of type double, representing the resulting value.

Throughout the code, the union is sometimes used inside other unions along with a double member, duplicating the already present "value". See e.g. sc/source/filter/oox/biffhelper.cxx and include/rtl/math.hxx. These usages may be simplified to avoid these extra unions (and e.g. drop DecodedDouble completely from sc/source/filter/oox/biffhelper.cxx).

So the task is to look through all the uses of the union, and simplify those unnecessary complications.
Comment 1 james 2020-03-12 17:38:12 UTC
i would like to work on this
Comment 2 Mike Kaganski 2020-03-12 18:51:27 UTC
(In reply to james from comment #1)

Great! Looking forward to see your patches on gerrit!
Comment 3 Commit Notification 2020-03-29 19:22:15 UTC
james committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/97bc0eae8bf884105cfcd0e21473c92a89c62f67

tdf#130981:Simplify uses of sal_math_Double

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