Bug 145614 - Convert #define to enum or constexpr
Summary: Convert #define to enum or constexpr
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.5.0 target:7.6....
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2021-11-10 12:30 UTC by Hossein
Modified: 2025-03-31 08:50 UTC (History)
5 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 Hossein 2021-11-10 12:30:43 UTC
In some older parts of the code, there are several consecutive symbolic constants that are #defined, and possibly have similar prefixes. You can improve this by replacing them with:

a) 'enum class' or 'enum': where facing multiple values of the same category or with similar prefixes. Some of these enums come from standards or other external documents or sources. It is good to find the source, and cross-check the values with it.
'enum class' is preferred to 'enum', but enums with binary or comparison operations can not be easily converted to 'enum class'.

b) 'constexpr': where there is a single value

For example, in emfio/inc/mtftools.hxx:

/* Mapping modes */
#define MM_TEXT                 1
#define MM_LOMETRIC             2
#define MM_HIMETRIC             3
#define MM_LOENGLISH            4
#define MM_HIENGLISH            5
#define MM_TWIPS                6
#define MM_ISOTROPIC            7
#define MM_ANISOTROPIC          8

#define LF_FACESIZE             32

is converted to:

/* Mapping modes */
enum MappingMode
{
    MM_TEXT        = 0x01,
    MM_LOMETRIC    = 0x02,
    MM_HIMETRIC    = 0x03,
    MM_LOENGLISH   = 0x04,
    MM_HIENGLISH   = 0x05,
    MM_TWIPS       = 0x06,
    MM_ISOTROPIC   = 0x07,
    MM_ANISOTROPIC = 0x08
};

constexpr sal_Int32 LF_FACESIZE = 32;
Comment 1 Stephan Bergmann 2021-11-16 14:54:52 UTC
(In reply to Hossein from comment #0)
> /* Mapping modes */
> enum MappingMode
> {
>     MM_TEXT        = 0x01,
>     MM_LOMETRIC    = 0x02,
>     MM_HIMETRIC    = 0x03,
>     MM_LOENGLISH   = 0x04,
>     MM_HIENGLISH   = 0x05,
>     MM_TWIPS       = 0x06,
>     MM_ISOTROPIC   = 0x07,
>     MM_ANISOTROPIC = 0x08
> };

Why change the values from decimal to hexadecimal?

> constexpr sal_Int32 LF_FACESIZE = 32;

I guess some explanation is needed what type to use (`sal_Int32` will not be the best choice in general; even `auto` may be an appropriate choice).
Comment 2 Hossein 2021-11-16 15:36:14 UTC
(In reply to Stephan Bergmann from comment #1)
> (In reply to Hossein from comment #0)
> > /* Mapping modes */
> > enum MappingMode
> > {
> >     MM_TEXT        = 0x01,
> >     MM_LOMETRIC    = 0x02,
> >     MM_HIMETRIC    = 0x03,
> >     MM_LOENGLISH   = 0x04,
> >     MM_HIENGLISH   = 0x05,
> >     MM_TWIPS       = 0x06,
> >     MM_ISOTROPIC   = 0x07,
> >     MM_ANISOTROPIC = 0x08
> > };
> 
> Why change the values from decimal to hexadecimal?

That's the way they are defined in [MS-WMF] documentation:

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/97b31821-a0db-4113-a210-fffbcedcec4a

In some enumerations in the same file, I had to add some values that were missing. So, when the source of the enum definition is known, I think using the same definitions can help avoid mistakes. If possible, using the same name would also be good.

> > constexpr sal_Int32 LF_FACESIZE = 32;
> 
> I guess some explanation is needed what type to use (`sal_Int32` will not be
> the best choice in general; even `auto` may be an appropriate choice).

Correct. I will add some explanation for this.
Comment 3 Kevin Suo 2021-11-17 11:29:37 UTC
Set to New as this is an easy hack.
Comment 4 Commit Notification 2021-12-07 15:26:23 UTC
Pesi Taototo committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/47503fce3ebc0874534175c0d9ea40d3a5bbffde

tdf#145614 Convert #define to 'enum class'

It will be available in 7.4.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 2022-01-19 05:56:06 UTC
VaibhavMalik4187 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/40bab1e31c7865f8c45883b8e4b684c0134b9191

tdf#145614 Convert #define to enum or constexpr

It will be available in 7.4.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 6 Commit Notification 2022-01-28 11:23:47 UTC
Ramreiso Kashung committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/124059f64a87d8074a0be32d6cc5f74c71bf836e

tdf#145614: Convert #define to enum

It will be available in 7.4.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 7 Commit Notification 2022-03-15 12:01:39 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e7dd04dd8ca1baea4b7918eb7a7080c595c4625

tdf#145614 Convert #define to enum and constexpr

It will be available in 7.4.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 8 Commit Notification 2022-03-18 15:31:33 UTC
Deep17 committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define to enum or constexpr

It will be available in 7.4.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 9 Commit Notification 2022-03-22 07:38:04 UTC
Deep17 committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define to enum or constexpr

It will be available in 7.4.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 10 Commit Notification 2022-03-29 11:28:28 UTC
offtkp committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/64888968b30fb387d8c2536664117915e5423b0c

tdf#145614 Convert #define to constexpr

It will be available in 7.4.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 11 Commit Notification 2022-08-13 10:10:05 UTC
ehsan committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9b5f0234da27a674a939941d89975bc5a365f7ae

tdf#145614 Convert #define to constexpr

It will be available in 7.5.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 12 Commit Notification 2022-08-30 22:24:57 UTC
Liu Hao committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define to enum or constexpr

It will be available in 7.5.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 13 Commit Notification 2023-01-28 22:10:51 UTC
Rasenkai committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0e09fff5f89b38245b108edb67d5e75e57774874

tdf#145614 chart2: controller: Convert #define to enum

It will be available in 7.6.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 14 Commit Notification 2023-03-20 13:23:17 UTC
MoazAlaa committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9b631efd012c94d099b0181c5d85aed321d031f5

tdf#145614 convert all #define into enum in hwpfilter/source/grammar.h

It will be available in 7.6.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 15 Commit Notification 2023-04-05 11:35:52 UTC
Jani Saranpää committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define to enum in propctrlr/fontitemids.hxx

It will be available in 7.6.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 16 Commit Notification 2023-07-18 15:52:07 UTC
Venetia Furtado committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/63a9b0bed08a68f3619cadf7b7cef0a087154c10

tdf#145614 Convert #define to enum

It will be available in 24.2.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 17 Commit Notification 2024-03-08 20:31:00 UTC
AhmedHamed committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8e5a5b7af90ebe4ad35b89ec30f4f19191d9b1ec

tdf#145614 Convert #define to enum

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 18 Commit Notification 2024-03-09 10:14:22 UTC
Sujatro Bhadra committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/47e778211b83936d067acad6df01412560f8edac

tdf#145614 Convert #define to constexpr

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 19 Commit Notification 2024-03-18 08:52:44 UTC
RMZeroFour committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert GCM_PROPERTY_ID #defines to enum

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 20 Commit Notification 2024-04-30 06:39:30 UTC
Nima Mahanloo committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define to enum

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 21 Commit Notification 2024-05-07 06:13:34 UTC
Zainab Abbasi committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define to enum

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 22 Commit Notification 2024-10-17 07:24:47 UTC
Chizoba ODINAKA committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d84bab85c9c00ce552d7da5cee0c5d88a160726

tdf#145614 Convert #define to 'enum'

It will be available in 25.2.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 23 Commit Notification 2024-11-12 14:27:43 UTC
Oromidayo Owolabi committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7a7ba9cbee91485a9254949d1594352b3629c070

tdf#145614 Convert #define to enum class

It will be available in 25.2.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 24 Commit Notification 2024-12-31 11:22:23 UTC
kkasliwal committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 convert #define to constexpr for scripts

It will be available in 25.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 25 Commit Notification 2024-12-31 11:23:25 UTC
kkasliwal committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 convert #define to constexpr

It will be available in 25.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 26 Commit Notification 2025-01-06 08:50:09 UTC
Johann committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614: Convert #define to enum

It will be available in 25.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 27 Commit Notification 2025-01-19 14:59:32 UTC
bruh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/623521289e7673c795d848c241637bcbb3ce5c0d

tdf#145614 Convert #define to enum

It will be available in 25.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 28 Commit Notification 2025-01-21 07:56:52 UTC
Akshay Kumar Dubey committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e706aa31d7d1a521710dfa544316e5d35bdf5f0

tdf#145614 Convert #define to constexpr

It will be available in 25.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 29 Commit Notification 2025-02-12 14:00:28 UTC
Simon Chenery committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/37481972038dddffcfda9cb5b86d75cac85a3b27

tdf#145614 Convert #define ZOOM_PARAMS to constexpr

It will be available in 25.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 30 Commit Notification 2025-02-15 14:57:42 UTC
Rahul Anand committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/43f5ad59d64ef48669d99bbae349cc556a674bad

tdf#145614 Convert #define to constexpr

It will be available in 25.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 31 Commit Notification 2025-02-20 08:34:56 UTC
Simon Chenery committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/748fef9fbd9a2818c58bcb149092b3960448ea14

tdf#145614 Convert #define MAX_ENTRIES to constexpr

It will be available in 25.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 32 Commit Notification 2025-03-03 19:02:09 UTC
Simon Chenery committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7e4acdc2f70d46b73424e38e876d559fd6ab7a6d

tdf#145614 Convert #define MAX_HEADER_LENGTH to constexpr

It will be available in 25.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 33 Commit Notification 2025-03-12 00:34:20 UTC
Simon Chenery committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 Convert #define WIDTH_CHARS to constexpr

It will be available in 25.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 34 Commit Notification 2025-03-17 14:25:18 UTC
Simon Chenery committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/288ad65ee8ef93dbcac3334249a39a09ebe4b660

tdf#145614 Convert #define CELL_X to constexpr

It will be available in 25.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 35 fpy 2025-03-28 12:10:58 UTC
in case like :
#define PROPERTYCOUNT_POPUPMENU                         4
#define OFFSET_POPUPMENU_TITLE                          0
#define OFFSET_POPUPMENU_CONTEXT                        1
#define OFFSET_POPUPMENU_SUBMENU                        2
#define OFFSET_POPUPMENU_URL                            3

any preference to get the *COUNT* ?

for ref:  https://stackoverflow.com/questions/14989274/is-it-possible-to-determine-the-number-of-elements-of-a-c-enum-class
Comment 36 Buovjaga 2025-03-28 13:18:20 UTC
(In reply to fpy from comment #35)
> in case like :
> #define PROPERTYCOUNT_POPUPMENU                         4
> #define OFFSET_POPUPMENU_TITLE                          0
> #define OFFSET_POPUPMENU_CONTEXT                        1
> #define OFFSET_POPUPMENU_SUBMENU                        2
> #define OFFSET_POPUPMENU_URL                            3
> 
> any preference to get the *COUNT* ?
> 
> for ref: 
> https://stackoverflow.com/questions/14989274/is-it-possible-to-determine-the-
> number-of-elements-of-a-c-enum-class

In C++26 we will be able to write

std::meta::enumerators_of(^myenum).size()

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2996r10.html
Comment 37 Commit Notification 2025-03-31 08:30:53 UTC
Devashish Gupta committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145614 - Convert #define to constexpr

It will be available in 25.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 38 Commit Notification 2025-03-31 08:50:57 UTC
Simon Chenery committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/03dced9d7ddb084649e72b88ed8f41d13b8e4469

tdf#145614 Convert #define to constexpr

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