diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-14 16:17:22 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-14 16:17:22 +0100 |
commit | 1fb042333fe6287756ff1fac11d18cd7c150730d (patch) | |
tree | 595de5d187177832ce656d7832af9dce9dce2d99 /linguistic/source/hyphdsp.cxx | |
parent | 5b3e910e926c7dd1e8dcfe8e0a5c6cb5bd17480a (diff) | |
parent | cd0d6a5a6775f197fdb7e78b54c8133074a7a236 (diff) |
rebase to DEV300_m100
Diffstat (limited to 'linguistic/source/hyphdsp.cxx')
-rw-r--r-- | linguistic/source/hyphdsp.cxx | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index 2d234fdc15fa..d296a8a56bfb 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -82,7 +82,7 @@ void HyphenatorDispatcher::ClearSvcList() Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( const OUString rOrigWord, const Reference<XDictionaryEntry> &xEntry, - INT16 nLang, INT16 nMaxLeading ) + sal_Int16 nLang, sal_Int16 nMaxLeading ) { MutexGuard aGuard( GetLinguMutex() ); @@ -91,25 +91,25 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( if (xEntry.is()) { OUString aText( xEntry->getDictionaryWord() ); - INT32 nTextLen = aText.getLength(); + sal_Int32 nTextLen = aText.getLength(); // trailing '=' means "hyphenation should not be possible" if (nTextLen > 0 && aText[ nTextLen - 1 ] != '=') { - INT16 nHyphenationPos = -1; + sal_Int16 nHyphenationPos = -1; OUStringBuffer aTmp( nTextLen ); - BOOL bSkip = FALSE; - INT32 nHyphIdx = -1; - INT32 nLeading = 0; - for (INT32 i = 0; i < nTextLen; i++) + sal_Bool bSkip = sal_False; + sal_Int32 nHyphIdx = -1; + sal_Int32 nLeading = 0; + for (sal_Int32 i = 0; i < nTextLen; i++) { sal_Unicode cTmp = aText[i]; if (cTmp != '=') { aTmp.append( cTmp ); nLeading++; - bSkip = FALSE; + bSkip = sal_False; nHyphIdx++; } else @@ -117,9 +117,9 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( if (!bSkip && nHyphIdx >= 0) { if (nLeading <= nMaxLeading) - nHyphenationPos = (INT16) nHyphIdx; + nHyphenationPos = (sal_Int16) nHyphIdx; } - bSkip = TRUE; //! multiple '=' should count as one only + bSkip = sal_True; //! multiple '=' should count as one only } } @@ -169,7 +169,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( - const Reference< XDictionaryEntry > &xEntry, INT16 nLanguage ) + const Reference< XDictionaryEntry > &xEntry, sal_Int16 nLanguage ) { MutexGuard aGuard( GetLinguMutex() ); @@ -179,33 +179,33 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( { // text with hyphenation info OUString aText( xEntry->getDictionaryWord() ); - INT32 nTextLen = aText.getLength(); + sal_Int32 nTextLen = aText.getLength(); // trailing '=' means "hyphenation should not be possible" if (nTextLen > 0 && aText[ nTextLen - 1 ] != '=') { // sequence to hold hyphenation positions - Sequence< INT16 > aHyphPos( nTextLen ); - INT16 *pPos = aHyphPos.getArray(); - INT32 nHyphCount = 0; + Sequence< sal_Int16 > aHyphPos( nTextLen ); + sal_Int16 *pPos = aHyphPos.getArray(); + sal_Int32 nHyphCount = 0; OUStringBuffer aTmp( nTextLen ); - BOOL bSkip = FALSE; - INT32 nHyphIdx = -1; - for (INT32 i = 0; i < nTextLen; i++) + sal_Bool bSkip = sal_False; + sal_Int32 nHyphIdx = -1; + for (sal_Int32 i = 0; i < nTextLen; i++) { sal_Unicode cTmp = aText[i]; if (cTmp != '=') { aTmp.append( cTmp ); - bSkip = FALSE; + bSkip = sal_False; nHyphIdx++; } else { if (!bSkip && nHyphIdx >= 0) - pPos[ nHyphCount++ ] = (INT16) nHyphIdx; - bSkip = TRUE; //! multiple '=' should count as one only + pPos[ nHyphCount++ ] = (sal_Int16) nHyphIdx; + bSkip = sal_True; //! multiple '=' should count as one only } } @@ -245,7 +245,7 @@ Sequence< Locale > SAL_CALL HyphenatorDispatcher::getLocales() } -BOOL SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale) +sal_Bool SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -264,8 +264,8 @@ Reference< XHyphenatedWord > SAL_CALL Reference< XHyphenatedWord > xRes; - INT32 nWordLen = rWord.getLength(); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int32 nWordLen = rWord.getLength(); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !nWordLen || nMaxLeading == 0 || nMaxLeading == nWordLen) return xRes; @@ -274,7 +274,7 @@ Reference< XHyphenatedWord > SAL_CALL HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - BOOL bWordModified = FALSE; + sal_Bool bWordModified = sal_False; if (!pEntry || (nMaxLeading < 0 || nMaxLeading > nWordLen)) { #ifdef LINGU_EXCEPTIONS @@ -296,7 +296,7 @@ Reference< XHyphenatedWord > SAL_CALL bWordModified |= RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) bWordModified |= RemoveControlChars( aChkWord ); - INT16 nChkMaxLeading = (INT16) GetPosInWordToCheck( rWord, nMaxLeading ); + sal_Int16 nChkMaxLeading = (sal_Int16) GetPosInWordToCheck( rWord, nMaxLeading ); // check for results from (positive) dictionaries which have precedence! Reference< XDictionaryEntry > xEntry; @@ -304,7 +304,7 @@ Reference< XHyphenatedWord > SAL_CALL if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { xEntry = GetDicList()->queryDictionaryEntry( aChkWord, rLocale, - TRUE, FALSE ); + sal_True, sal_False ); } if (xEntry.is()) @@ -318,11 +318,11 @@ Reference< XHyphenatedWord > SAL_CALL } else { - INT32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; + sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XHyphenator > xHyph; if (pEntry->aSvcRefs.getLength() > 0) xHyph = pEntry->aSvcRefs[0]; @@ -373,7 +373,7 @@ Reference< XHyphenatedWord > SAL_CALL xRes = xHyph->hyphenate( aChkWord, rLocale, nChkMaxLeading, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; // if language is not supported by the services @@ -409,8 +409,8 @@ Reference< XHyphenatedWord > SAL_CALL Reference< XHyphenatedWord > xRes; - INT32 nWordLen = rWord.getLength(); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int32 nWordLen = rWord.getLength(); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !nWordLen) return xRes; @@ -418,7 +418,7 @@ Reference< XHyphenatedWord > SAL_CALL HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - BOOL bWordModified = FALSE; + sal_Bool bWordModified = sal_False; if (!pEntry || !(0 <= nIndex && nIndex <= nWordLen - 2)) { #ifdef LINGU_EXCEPTIONS @@ -440,7 +440,7 @@ Reference< XHyphenatedWord > SAL_CALL bWordModified |= RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) bWordModified |= RemoveControlChars( aChkWord ); - INT16 nChkIndex = (INT16) GetPosInWordToCheck( rWord, nIndex ); + sal_Int16 nChkIndex = (sal_Int16) GetPosInWordToCheck( rWord, nIndex ); // check for results from (positive) dictionaries which have precedence! Reference< XDictionaryEntry > xEntry; @@ -448,7 +448,7 @@ Reference< XHyphenatedWord > SAL_CALL if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { xEntry = GetDicList()->queryDictionaryEntry( aChkWord, rLocale, - TRUE, FALSE ); + sal_True, sal_False ); } if (xEntry.is()) @@ -457,11 +457,11 @@ Reference< XHyphenatedWord > SAL_CALL } else { - INT32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; + sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XHyphenator > xHyph; if (pEntry->aSvcRefs.getLength() > 0) xHyph = pEntry->aSvcRefs[0]; @@ -512,7 +512,7 @@ Reference< XHyphenatedWord > SAL_CALL xRes = xHyph->queryAlternativeSpelling( aChkWord, rLocale, nChkIndex, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; // if language is not supported by the services @@ -548,7 +548,7 @@ Reference< XPossibleHyphens > SAL_CALL Reference< XPossibleHyphens > xRes; - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !rWord.getLength()) return xRes; @@ -582,7 +582,7 @@ Reference< XPossibleHyphens > SAL_CALL if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { xEntry = GetDicList()->queryDictionaryEntry( aChkWord, rLocale, - TRUE, FALSE ); + sal_True, sal_False ); } if (xEntry.is()) @@ -591,11 +591,11 @@ Reference< XPossibleHyphens > SAL_CALL } else { - INT32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; + sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XHyphenator > xHyph; if (pEntry->aSvcRefs.getLength() > 0) xHyph = pEntry->aSvcRefs[0]; @@ -646,7 +646,7 @@ Reference< XPossibleHyphens > SAL_CALL xRes = xHyph->createPossibleHyphens( aChkWord, rLocale, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; // if language is not supported by the services @@ -674,9 +674,9 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale, { MutexGuard aGuard( GetLinguMutex() ); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); - INT32 nLen = rSvcImplNames.getLength(); + sal_Int32 nLen = rSvcImplNames.getLength(); if (0 == nLen) // remove entry aSvcMap.erase( nLanguage ); @@ -711,7 +711,7 @@ Sequence< OUString > Sequence< OUString > aRes; // search for entry with that language and use data from that - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this; const HyphSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); const LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; |