From a268011a6fe4c5bd0cbacbb0571a61517cad8be2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 18 Jul 2016 14:46:38 +0200 Subject: -fsanitize=signed-integer-overflow Change-Id: I1a79d34dd25073de46bda47af1789fd7e69fe648 --- cui/source/tabpages/tpcolor.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index c85a80ed2c08..00d1a7b35248 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -653,7 +653,11 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet ) aPreviousColor = aColorItem.GetColorValue(); aNewColor = aColorItem.GetColorValue(); m_pLbColor->SelectEntry(aNewColor); - m_pValSetColorList->SelectItem( m_pLbColor->GetSelectEntryPos() + 1 ); + auto pos = m_pLbColor->GetSelectEntryPos(); + if (pos != LISTBOX_ENTRY_NOTFOUND) + { + m_pValSetColorList->SelectItem( pos + 1 ); + } } // set color model -- cgit