summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-21 09:53:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-21 11:25:00 +0100
commitdf29825ec68c7cdba90a85fff49ac969522a43f7 (patch)
treee61f5ed2197610b345349e81003f5114ad6f38f9
parentd486b2b324364dd99bea686b6969f7a796f5e329 (diff)
drop StringCompare from vcl
Change-Id: If41503f382115affb42068d9a441241543197147
-rw-r--r--vcl/source/control/ilstbox.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index a5bc8bfd80ec..fa9c2773657a 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -184,12 +184,10 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
try
{
- // XXX even though XCollator::compareString returns a sal_Int32 the only
- // defined values are {-1, 0, 1} which is compatible with StringCompare
- StringCompare eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
+ sal_Int32 nComp = rSorter.compare(rStr, pTemp->maStr);
// fast insert for sorted data
- if ( eComp != COMPARE_LESS )
+ if ( nComp >= 0 )
{
insPos = maEntries.size();
maEntries.push_back(pNewEntry);
@@ -199,8 +197,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
nLow = mnMRUCount;
pTemp = (ImplEntryType*)GetEntry( (sal_uInt16)nLow );
- eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
- if ( eComp != COMPARE_GREATER )
+ nComp = rSorter.compare(rStr, pTemp->maStr);
+ if ( nComp <= 0 )
{
insPos = 0;
maEntries.insert(maEntries.begin(),pNewEntry);
@@ -214,13 +212,13 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
nMid = (nLow + nHigh) / 2;
pTemp = (ImplEntryType*)GetEntry( nMid );
- eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
+ nComp = rSorter.compare(rStr, pTemp->maStr);
- if ( eComp == COMPARE_LESS )
+ if ( nComp < 0 )
nHigh = nMid-1;
else
{
- if ( eComp == COMPARE_GREATER )
+ if ( nComp > 0 )
nLow = nMid + 1;
else
break;
@@ -228,7 +226,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
}
while ( nLow <= nHigh );
- if ( eComp != COMPARE_LESS )
+ if ( nComp >= 0 )
nMid++;
insPos = nMid;