Summary: | Convert #define to enum or constexpr | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Hossein <hossein> |
Component: | LibreOffice | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | mentoring, sberg.fun, suokunlong |
Priority: | medium | Keywords: | difficultyBeginner, easyHack, skillCpp |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.documentfoundation.org/show_bug.cgi?id=148359 | ||
Whiteboard: | target:7.4.0 target:7.5.0 target:7.6.0 target:24.2.0 target:24.8.0 | ||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 143781 |
Description
Hossein
2021-11-10 12:30:43 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). (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. Set to New as this is an easy hack. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. |