summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-09-23 13:35:56 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-09-23 13:35:56 +0200
commite828a781285d843c95a2c374bc38aa10c3aab146 (patch)
treeed5ec8fc5229c520b4b66a3e9bc48f8b182bfe92
parentfcec4caa3d32ce76339ef8916f0d2c1e09b9600a (diff)
check that the color index is valid
Change-Id: Id5c7c83f50e1611af12f3b25e6c9a335a8353ba0
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 14c4436513fe..a6db69e1f83f 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -257,9 +257,9 @@ void changeFont(SwFormat* pFormat, SwDocStyleSheet* pStyle, FontSet& rFontSet)
void changeColor(SwTextFormatColl* pCollection, svx::ColorSet& rColorSet, StyleRedefinition* /*pRedefinition*/)
{
SvxColorItem aColorItem(pCollection->GetColor());
- if (aColorItem.GetThemeIndex() >= 0)
+ sal_Int16 nIndex = aColorItem.GetThemeIndex();
+ if (nIndex >= 0 && nIndex < 12)
{
- sal_Int16 nIndex = aColorItem.GetThemeIndex();
Color aColor = Color(rColorSet.getColor(nIndex));
aColor.ApplyTintOrShade(aColorItem.GetTintOrShade());
aColorItem.SetValue(aColor);