summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-31 10:18:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-01 06:43:29 +0100
commitd4e96a36d78299794ff4ac86e937fbbb0843c6ed (patch)
treebe5ca239c5273fb672fe91d88d5b9fd792158e86 /cui/source
parent2f1a4e0a875ea43f3845c95ea46ed95fd9c2923d (diff)
drop LISTBOX_ERROR
almost nobody checks it, so rather just assert Change-Id: Ic3ad4c04c4f6013db3e8757559d3a773df020a1d Reviewed-on: https://gerrit.libreoffice.org/62684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/options/optchart.cxx21
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;
}
}