tools/source/stream/GenericTypeSerializer.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e47aebcec5a0103f8ed836f1bcba50c5f198f47c
Author:     Arnaud VERSINI <arnaud.vers...@pm.me>
AuthorDate: Fri Dec 27 14:03:08 2024 +0100
Commit:     Arnaud Versini <arnaud.vers...@pm.me>
CommitDate: Fri Dec 27 16:26:13 2024 +0100

    tools : use constexpr array instead of std::vector
    
    Change-Id: Ifade95457b4b7c614a4ec83857c822d349a9f88d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179444
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Arnaud Versini <arnaud.vers...@pm.me>

diff --git a/tools/source/stream/GenericTypeSerializer.cxx 
b/tools/source/stream/GenericTypeSerializer.cxx
index 3eefb008ea67..c946e310e6b5 100644
--- a/tools/source/stream/GenericTypeSerializer.cxx
+++ b/tools/source/stream/GenericTypeSerializer.cxx
@@ -48,7 +48,7 @@ void GenericTypeSerializer::readColor(Color& rColor)
     }
     else
     {
-        static const std::vector<Color> staticColorArray = {
+        static constexpr Color staticColorArray[] = {
             COL_BLACK, // COL_BLACK
             COL_BLUE, // COL_BLUE
             COL_GREEN, // COL_GREEN
@@ -82,7 +82,7 @@ void GenericTypeSerializer::readColor(Color& rColor)
             COL_BLACK // COL_FIELDTEXT
         };
 
-        if (nColorNameID < staticColorArray.size())
+        if (nColorNameID < std::size(staticColorArray))
             rColor = staticColorArray[nColorNameID];
         else
             rColor = COL_BLACK;

Reply via email to