include/svx/ColorSets.hxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit f0ff9162950487f1e7ccc01e01160d60bf102488
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Dec 29 12:15:28 2022 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Dec 29 16:57:29 2022 +0000

    cid#1518241 Improper use of negative value
    
    and
    
    cid#1518243 Improper use of negative value
    cid#1518244 Improper use of negative value
    
    Change-Id: I82de403d833d931703d52a368aa0b467abffa54b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144861
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 6b4504ebb877..47e1d8866e5d 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -15,6 +15,7 @@
 #include <vector>
 
 #include <rtl/ustring.hxx>
+#include <sal/log.hxx>
 #include <sal/types.h>
 #include <svx/svxdllapi.h>
 #include <tools/color.hxx>
@@ -68,6 +69,11 @@ public:
 
     Color getColor(ThemeColorType nType) const
     {
+        if (nType == ThemeColorType::Unknown)
+        {
+            SAL_WARN("svx", "ColorSet::getColor with ThemeColorType::Unknown");
+            return COL_AUTO;
+        }
         return maColors[size_t(nType)];
     }
 

Reply via email to