diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 13:28:40 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 13:28:40 +0000 |
commit | b2966ece2167ed9b12afa6ab36628856e652f808 (patch) | |
tree | 036cb82a24950d49bd404169b471203ad757a211 /linguistic/source/convdic.cxx | |
parent | 9d3f6a36cdf9370450914a3315f64c625ed63299 (diff) |
INTEGRATION: CWS gt08hangulhanja (1.3.4); FILE MERGED
2004/10/15 16:26:32 tl 1.3.4.2: RESYNC: (1.3-1.4); FILE MERGED
2004/05/10 10:39:20 tl 1.3.4.1: #116051# removed duplicate entries from the results of getConversionEntries
Diffstat (limited to 'linguistic/source/convdic.cxx')
-rw-r--r-- | linguistic/source/convdic.cxx | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 7a367a1c817d..e751230e316e 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -2,9 +2,9 @@ * * $RCSfile: convdic.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2004-09-17 13:33:51 $ + * last change: $Author: rt $ $Date: 2004-11-26 14:28:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -568,6 +568,24 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( } +static BOOL lcl_SeqHasEntry( + const OUString *pSeqStart, // first element to check + INT32 nToCheck, // number of elements to check + const OUString &rText) +{ + BOOL bRes = FALSE; + if (pSeqStart && nToCheck > 0) + { + const OUString *pDone = pSeqStart + nToCheck; // one behind last to check + while (!bRes && pSeqStart != pDone) + { + if (*pSeqStart++ == rText) + bRes = TRUE; + } + } + return bRes; +} + uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( ConversionDirection eDirection ) throw (RuntimeException) @@ -588,11 +606,14 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( INT32 nIdx = 0; while (aIt != rConvMap.end()) { - pRes[ nIdx++ ] = (*aIt).first; + OUString aCurEntry( (*aIt).first ); + // skip duplicate entries + if (nIdx == 0 || !lcl_SeqHasEntry( pRes, nIdx, aCurEntry )) + pRes[ nIdx++ ] = aCurEntry; ++aIt; } - DBG_ASSERT( nIdx == rConvMap.size(), - "ConvDic::getConversionEntries: size/index mismatch" ); + //DBG_ASSERT( nIdx == rConvMap.size(), + // "ConvDic::getConversionEntries: size/index mismatch" ); return aRes; } |