diff options
Diffstat (limited to 'cui/source/options/optchart.cxx')
-rw-r--r-- | cui/source/options/optchart.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 089b641ea72c..3fd6630afeaf 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -51,19 +51,16 @@ void SvxDefaultColorOptPage::InsertColorEntry(const XColorEntry& rEntry, sal_Int nPos = m_pLbChartColors->InsertEntry(rStr, Image(aBitmap), nPos); - if (nPos != LISTBOX_ERROR) + if ( static_cast<size_t>(nPos) < aColorList.size() ) { - if ( static_cast<size_t>(nPos) < aColorList.size() ) - { - ImpColorList::iterator it = aColorList.begin(); - std::advance( it, nPos ); - aColorList.insert( it, rColor ); - } - else - { - aColorList.push_back( rColor ); - nPos = aColorList.size() - 1; - } + ImpColorList::iterator it = aColorList.begin(); + std::advance( it, nPos ); + aColorList.insert( it, rColor ); + } + else + { + aColorList.push_back( rColor ); + nPos = aColorList.size() - 1; } } |