In LibreOffice C++ code, there are many cases when you want to use some string literals or even numerical values as some data that you need to use in C++ code. Traditionally, in the code inherited from the old C days, these were defined as symbolic constants using #define and char* or other literals. Using modern C++ in LibreOffice, one may use o3tl::enumarray to create such arrays of values. Example Using #define, you may have seen definitions like this: const char[] FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER = "DispatchRecorderSupplier"; const char[] FRAME_PROPNAME_ASCII_ISHIDDEN = "IsHidden"; inline constexpr OUString FRAME_PROPNAME_ASCII_LAYOUTMANAGER = "LayoutManager"; And also, the relevant states: #define FRAME_PROPHANDLE_DISPATCHRECORDERSUPPLIER 0 #define FRAME_PROPHANDLE_ISHIDDEN 1 You may turn that into: enum class FramePropNameASCII { DispatcherRecorderSupplier, IsHidden, LAST=IsHidden } Don't forget to add LAST. It is required. And then: constexpr o3tl::enumarray<FramePropNameASCII, OUString> FramePropName = { u"DispatchRecorderSupplier"_ustr, u"IsHidden"_ustr }; The names will be more readable this way. The usage is quite easy. For example, one can use [] to access the relevant string literal.
Hossein, is it an EasyHack? If so then just set the status to NEW yourself please =)
Mo Amr committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/56343500ee0512015fcc1e4ea9ec83649c725c1a tdf#169155 use o3tl::enumarray for AutoRecovery and LayoutManager It will be available in 26.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.