diff options
author | Noel Grandin <noel@peralex.com> | 2014-04-22 12:48:05 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-04-23 11:11:47 +0200 |
commit | e4f690b0389263c35f83fa8b58382c6518d00f62 (patch) | |
tree | e89a15c8f29c51394ff539eabc6e122ab6d1c70f /i18npool/source/breakiterator | |
parent | fc06e00fd4ae2b82d827163e72eb6824e88dbd40 (diff) |
i18npool: sal_Bool->bool
Change-Id: Id73ee64dbf8586743f0e436e004e663a65d4548f
Diffstat (limited to 'i18npool/source/breakiterator')
-rw-r--r-- | i18npool/source/breakiterator/breakiteratorImpl.cxx | 26 | ||||
-rw-r--r-- | i18npool/source/breakiterator/breakiterator_unicode.cxx | 12 | ||||
-rw-r--r-- | i18npool/source/breakiterator/xdictionary.cxx | 22 |
3 files changed, 30 insertions, 30 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index db36852085a3..5593b9e306ff 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -67,7 +67,7 @@ sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& Text, #define isZWSP(c) (ch == 0x200B) -static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, sal_Int16 rWordType, sal_Bool bDirection) +static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, sal_Int16 rWordType, bool bDirection) { sal_uInt32 ch=0; sal_Int32 pos=nPos; @@ -107,7 +107,7 @@ Boundary SAL_CALL BreakIteratorImpl::nextWord( const OUString& Text, sal_Int32 n else { result = LBI->nextWord(Text, nStartPos, rLocale, rWordType); - nStartPos = skipSpace(Text, result.startPos, len, rWordType, sal_True); + nStartPos = skipSpace(Text, result.startPos, len, rWordType, true); if ( nStartPos != result.startPos) { if( nStartPos >= len ) @@ -122,7 +122,7 @@ Boundary SAL_CALL BreakIteratorImpl::nextWord( const OUString& Text, sal_Int32 n return result; } -static inline sal_Bool SAL_CALL isCJK( const Locale& rLocale ) { +static inline bool SAL_CALL isCJK( const Locale& rLocale ) { return rLocale.Language == "zh" || rLocale.Language == "ja" || rLocale.Language == "ko"; } @@ -138,7 +138,7 @@ Boundary SAL_CALL BreakIteratorImpl::previousWord( const OUString& Text, sal_Int return result; } - sal_Int32 nPos = skipSpace(Text, nStartPos, len, rWordType, sal_False); + sal_Int32 nPos = skipSpace(Text, nStartPos, len, rWordType, false); // if some spaces are skiped, and the script type is Asian with no CJK rLocale, we have to return // (nStartPos, -1) for caller to send correct rLocale for loading correct dictionary. @@ -162,8 +162,8 @@ Boundary SAL_CALL BreakIteratorImpl::getWordBoundary( const OUString& Text, sal_ result.endPos = result.startPos = len; else { sal_Int32 next, prev; - next = skipSpace(Text, nPos, len, rWordType, sal_True); - prev = skipSpace(Text, nPos, len, rWordType, sal_False); + next = skipSpace(Text, nPos, len, rWordType, true); + prev = skipSpace(Text, nPos, len, rWordType, false); if (prev == 0 && next == len) { result.endPos = result.startPos = nPos; } else if (prev == 0 && ! bDirection) { @@ -192,7 +192,7 @@ sal_Bool SAL_CALL BreakIteratorImpl::isBeginWord( const OUString& Text, sal_Int3 if (nPos < 0 || nPos >= len) return sal_False; - sal_Int32 tmp = skipSpace(Text, nPos, len, rWordType, sal_True); + sal_Int32 tmp = skipSpace(Text, nPos, len, rWordType, true); if (tmp != nPos) return sal_False; @@ -208,7 +208,7 @@ sal_Bool SAL_CALL BreakIteratorImpl::isEndWord( const OUString& Text, sal_Int32 if (nPos <= 0 || nPos > len) return sal_False; - sal_Int32 tmp = skipSpace(Text, nPos, len, rWordType, sal_False); + sal_Int32 tmp = skipSpace(Text, nPos, len, rWordType, false); if (tmp != nPos) return sal_False; @@ -525,18 +525,18 @@ sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar) return nRet; } -static inline sal_Bool operator == (const Locale& l1, const Locale& l2) { +static inline bool operator == (const Locale& l1, const Locale& l2) { return l1.Language == l2.Language && l1.Country == l2.Country && l1.Variant == l2.Variant; } -sal_Bool SAL_CALL BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUString& aLocaleName) throw( RuntimeException ) +bool SAL_CALL BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUString& aLocaleName) throw( RuntimeException ) { // to share service between same Language but different Country code, like zh_CN and zh_TW for (size_t l = 0; l < lookupTable.size(); l++) { lookupTableItem *listItem = lookupTable[l]; if (aLocaleName == listItem->aLocale.Language) { xBI = listItem->xBI; - return sal_True; + return true; } } @@ -547,10 +547,10 @@ sal_Bool SAL_CALL BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUS xBI.set(xI, UNO_QUERY); if (xBI.is()) { lookupTable.push_back(new lookupTableItem(Locale(aLocaleName, aLocaleName, aLocaleName), xBI)); - return sal_True; + return true; } } - return sal_False; + return false; } Reference < XBreakIterator > SAL_CALL diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index 205ff6c9f04c..126ac7a8d354 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -80,7 +80,7 @@ class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star::lang::Locale& rLocale, sal_Int16 rBreakType, sal_Int16 nWordType, const sal_Char *rule, const OUString& rText) throw(uno::RuntimeException) { - sal_Bool newBreak = sal_False; + bool newBreak = false; UErrorCode status = U_ZERO_ERROR; sal_Int16 breakType = 0; switch (rBreakType) { @@ -179,7 +179,7 @@ void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star:: } if (icuBI->aBreakIterator) { icuBI->maLocale=rLocale; - newBreak=sal_True; + newBreak=true; } else { throw uno::RuntimeException(); } @@ -371,7 +371,7 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak( loadICUBreakIterator(rLocale, LOAD_LINE_BREAKITERATOR, 0, lineRule, Text); - sal_Bool GlueSpace=sal_True; + bool GlueSpace=true; while (GlueSpace) { if (line.aBreakIterator->preceding(nStartPos + 1) == nStartPos) { //Line boundary break lbr.breakIndex = nStartPos; @@ -423,15 +423,15 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak( } #define WJ 0x2060 // Word Joiner - GlueSpace=sal_False; + GlueSpace=false; if (lbr.breakType == BreakType::WORDBOUNDARY) { nStartPos = lbr.breakIndex; if (Text[nStartPos--] == WJ) - GlueSpace=sal_True; + GlueSpace=true; while (nStartPos >= 0 && (u_isWhitespace(Text.iterateCodePoints(&nStartPos, 0)) || Text[nStartPos] == WJ)) { if (Text[nStartPos--] == WJ) - GlueSpace=sal_True; + GlueSpace=true; } if (GlueSpace && nStartPos < 0) { lbr.breakIndex = 0; diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx index 390b2cd7dcc4..6ded12393adc 100644 --- a/i18npool/source/breakiterator/xdictionary.cxx +++ b/i18npool/source/breakiterator/xdictionary.cxx @@ -66,7 +66,7 @@ xdictionary::xdictionary(const sal_Char *lang) : hModule( NULL ), #endif boundary(), - japaneseWordBreak( sal_False ) + japaneseWordBreak( false ) { existMark = NULL; index1 = NULL; @@ -150,7 +150,7 @@ xdictionary::xdictionary(const sal_Char *lang) : for (sal_Int32 i = 0; i < CACHE_MAX; i++) cache[i].size = 0; - japaneseWordBreak = sal_False; + japaneseWordBreak = false; } xdictionary::~xdictionary() @@ -168,13 +168,13 @@ xdictionary::~xdictionary() void xdictionary::setJapaneseWordBreak() { - japaneseWordBreak = sal_True; + japaneseWordBreak = true; } -sal_Bool xdictionary::exists(const sal_uInt32 c) +bool xdictionary::exists(const sal_uInt32 c) { // 0x1FFF is the hardcoded limit in gendict for existMarks - sal_Bool exist = (existMark && ((c>>3) < 0x1FFF)) ? sal::static_int_cast<sal_Bool>((existMark[c>>3] & (1<<(c&0x07))) != 0) : sal_False; + bool exist = (existMark && ((c>>3) < 0x1FFF)) ? sal::static_int_cast<sal_Bool>((existMark[c>>3] & (1<<(c&0x07))) != 0) : sal_False; if (!exist && japaneseWordBreak) return BreakIteratorImpl::getScriptClass(c) == ScriptType::ASIAN; else @@ -229,15 +229,15 @@ WordBreakCache::WordBreakCache() : * Compare two unicode string, */ -sal_Bool WordBreakCache::equals(const sal_Unicode* str, Boundary& boundary) +bool WordBreakCache::equals(const sal_Unicode* str, Boundary& boundary) { // Different length, different string. - if (length != boundary.endPos - boundary.startPos) return sal_False; + if (length != boundary.endPos - boundary.startPos) return false; for (sal_Int32 i = 0; i < length; i++) - if (contents[i] != str[i + boundary.startPos]) return sal_False; + if (contents[i] != str[i + boundary.startPos]) return false; - return sal_True; + return true; } @@ -246,7 +246,7 @@ sal_Bool WordBreakCache::equals(const sal_Unicode* str, Boundary& boundary) * @param pos : Position of the given character. * @return true if CJK. */ -sal_Bool xdictionary::seekSegment(const OUString &rText, sal_Int32 pos, +bool xdictionary::seekSegment(const OUString &rText, sal_Int32 pos, Boundary& segBoundary) { sal_Int32 indexUtf16; @@ -382,7 +382,7 @@ Boundary xdictionary::nextWord(const OUString& rText, sal_Int32 anyPos, sal_Int1 return getWordBoundary(rText, anyPos, wordType, true); } -Boundary xdictionary::getWordBoundary(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType, sal_Bool bDirection) +Boundary xdictionary::getWordBoundary(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType, bool bDirection) { const sal_Unicode *text=rText.getStr(); sal_Int32 len=rText.getLength(); |