Kaydet (Commit) b347e5da authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:salbool: Automatic rewrite of sal_False/True

Change-Id: I3f7f71f05db09219f0de3ec14bdb56bd16fb0c8d
üst 07b4791d
......@@ -112,7 +112,7 @@ Boundary SAL_CALL BreakIteratorImpl::nextWord( const OUString& Text, sal_Int32 n
if( nStartPos >= len )
result.startPos = result.endPos = len;
else {
result = LBI->getWordBoundary(Text, nStartPos, rLocale, rWordType, sal_True);
result = LBI->getWordBoundary(Text, nStartPos, rLocale, rWordType, true);
// i88041: avoid startPos goes back to nStartPos when switching between Latin and CJK scripts
if (result.startPos < nStartPos) result.startPos = nStartPos;
}
......@@ -172,9 +172,9 @@ Boundary SAL_CALL BreakIteratorImpl::getWordBoundary( const OUString& Text, sal_
} else {
if (next != prev) {
if (next == nPos && next != len)
bDirection = sal_True;
bDirection = true;
else if (prev == nPos && prev != 0)
bDirection = sal_False;
bDirection = false;
else
nPos = bDirection ? next : prev;
}
......@@ -189,13 +189,13 @@ sal_Bool SAL_CALL BreakIteratorImpl::isBeginWord( const OUString& Text, sal_Int3
{
sal_Int32 len = Text.getLength();
if (nPos < 0 || nPos >= len) return sal_False;
if (nPos < 0 || nPos >= len) return false;
sal_Int32 tmp = skipSpace(Text, nPos, len, rWordType, true);
if (tmp != nPos) return sal_False;
if (tmp != nPos) return false;
result = getWordBoundary(Text, nPos, rLocale, rWordType, sal_True);
result = getWordBoundary(Text, nPos, rLocale, rWordType, true);
return result.startPos == nPos;
}
......@@ -205,13 +205,13 @@ sal_Bool SAL_CALL BreakIteratorImpl::isEndWord( const OUString& Text, sal_Int32
{
sal_Int32 len = Text.getLength();
if (nPos <= 0 || nPos > len) return sal_False;
if (nPos <= 0 || nPos > len) return false;
sal_Int32 tmp = skipSpace(Text, nPos, len, rWordType, false);
if (tmp != nPos) return sal_False;
if (tmp != nPos) return false;
result = getWordBoundary(Text, nPos, rLocale, rWordType, sal_False);
result = getWordBoundary(Text, nPos, rLocale, rWordType, false);
return result.endPos == nPos;
}
......
......@@ -827,7 +827,7 @@ Calendar_gregorian::isValid() throw(RuntimeException, std::exception)
// compare only with fields that are set and reset fieldSet[]
if (tmp & (1 << fieldIndex)) {
if (fieldSetValue[fieldIndex] != fieldValue[fieldIndex])
return sal_False;
return false;
}
}
}
......
......@@ -94,7 +94,7 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
sal_Unicode* out = pStr->buffer;
Reference< BreakIteratorImpl > xBrk(new BreakIteratorImpl(m_xContext));
Boundary bdy = xBrk->getWordBoundary(Text, nPos, rLocale,
WordType::ANYWORD_IGNOREWHITESPACES, sal_True);
WordType::ANYWORD_IGNOREWHITESPACES, true);
for (sal_Int32 i = nPos; i < nCount + nPos; i++, out++) {
if (i >= bdy.endPos)
bdy = xBrk->nextWord(Text, bdy.endPos, rLocale,
......
......@@ -1034,8 +1034,8 @@ sal_Bool DefaultNumberingProvider::hasNumberingType( const OUString& rNumberingI
{
for(sal_Int16 i = 0; i < nSupported_NumberingTypes; i++)
if(rNumberingIdentifier.equals(makeNumberingIdentifier(i)))
return sal_True;
return sal_False;
return true;
return false;
}
OUString DefaultNumberingProvider::getNumberingIdentifier( sal_Int16 nNumberingType )
......
......@@ -51,7 +51,7 @@ sal_Bool SAL_CALL IndexEntrySupplier::loadAlgorithm( const Locale& rLocale, cons
return xIES->loadAlgorithm(rLocale, SortAlgorithm, collatorOptions);
}
}
return sal_False;
return false;
}
sal_Bool SAL_CALL IndexEntrySupplier::usePhoneticEntry( const Locale& rLocale ) throw (RuntimeException, std::exception)
......
......@@ -67,7 +67,7 @@ sal_Bool SAL_CALL IndexEntrySupplier_Common::loadAlgorithm( const lang::Locale&
collator->loadCollatorAlgorithm(rAlgorithm, rLocale, collatorOptions);
aLocale = rLocale;
aAlgorithm = rAlgorithm;
return sal_True;
return true;
}
OUString SAL_CALL IndexEntrySupplier_Common::getIndexKey( const OUString& rIndexEntry,
......
......@@ -54,14 +54,14 @@ InputSequenceCheckerImpl::checkInputSequence(const OUString& Text, sal_Int32 nSt
sal_Unicode inputChar, sal_Int16 inputCheckMode) throw(RuntimeException, std::exception)
{
if (inputCheckMode == InputSequenceCheckMode::PASSTHROUGH)
return sal_True;
return true;
sal_Char* language = getLanguageByScripType(Text[nStartPos], inputChar);
if (language)
return getInputSequenceChecker(language)->checkInputSequence(Text, nStartPos, inputChar, inputCheckMode);
else
return sal_True; // not a checkable languages.
return true; // not a checkable languages.
}
sal_Int32 SAL_CALL
......
......@@ -100,8 +100,8 @@ static const sal_uInt16 dev_cell_check[14][14] = {
};
sal_Bool DEV_Composible[2][2] = {
/* Mode 0 */ {sal_True, sal_True }, // PASSTHROUGH = 0
/* Mode 1 */ {sal_False, sal_True} // STRICT = 1
/* Mode 0 */ {true, true }, // PASSTHROUGH = 0
/* Mode 1 */ {false, true} // STRICT = 1
};
#define getCharType(x) \
......
......@@ -57,9 +57,9 @@ sal_Char TAC_celltype_inputcheck[17][17] = {
sal_Bool TAC_Composible[3][5] = {
/* 'A', 'C', 'S', 'R', 'X' */
/* Mode 0 */ {sal_True, sal_True, sal_True, sal_True, sal_True}, // PASSTHROUGH = 0
/* Mode 1 */ {sal_True, sal_True, sal_True, sal_False, sal_True}, // BASIC = 1
/* Mode 2 */ {sal_True, sal_True, sal_False, sal_False, sal_True} // STRICT = 2
/* Mode 0 */ {true, true, true, true, true}, // PASSTHROUGH = 0
/* Mode 1 */ {true, true, true, false, true}, // BASIC = 1
/* Mode 2 */ {true, true, false, false, true} // STRICT = 2
};
static bool SAL_CALL check(sal_Unicode ch1, sal_Unicode ch2, sal_Int16 inputCheckMode)
......
......@@ -663,12 +663,12 @@ sal_Bool SAL_CALL NativeNumberSupplierService::isValidNatNum( const Locale& rLoc
switch (nNativeNumberMode) {
case NativeNumberMode::NATNUM0: // Ascii
case NativeNumberMode::NATNUM3: // Char, FullWidth
return sal_True;
return true;
case NativeNumberMode::NATNUM1: // Char, Lower
return (langnum >= 0);
case NativeNumberMode::NATNUM2: // Char, Upper
if (langnum == 4) // Hebrew numbering
return sal_True;
return true;
case NativeNumberMode::NATNUM4: // Text, Lower, Long
case NativeNumberMode::NATNUM5: // Text, Upper, Long
case NativeNumberMode::NATNUM6: // Text, FullWidth
......@@ -680,7 +680,7 @@ sal_Bool SAL_CALL NativeNumberSupplierService::isValidNatNum( const Locale& rLoc
case NativeNumberMode::NATNUM11: // Text, Hangul, Short
return (langnum == 3); // Korean numbering
}
return sal_False;
return false;
}
NativeNumberXmlAttributes SAL_CALL NativeNumberSupplierService::convertToXmlAttributes( const Locale& rLocale, sal_Int16 nNativeNumberMode ) throw (RuntimeException, std::exception)
......
......@@ -56,7 +56,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage,
aFormatSeq[i].formatName,
aFormatSeq[i].formatKey,
aFormatSeq[i].formatIndex,
sal_True);
true);
return anumberFormatCode;
}
}
......
......@@ -1052,7 +1052,7 @@ SearchResult TextSearch::ApproxSrchFrwrd( const OUString& searchStr,
Boundary aWBnd = xBreak->getWordBoundary( searchStr, startPos,
aSrchPara.Locale,
WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
WordType::ANYWORD_IGNOREWHITESPACES, true );
do
{
......@@ -1097,7 +1097,7 @@ SearchResult TextSearch::ApproxSrchBkwrd( const OUString& searchStr,
Boundary aWBnd = xBreak->getWordBoundary( searchStr, startPos,
aSrchPara.Locale,
WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
WordType::ANYWORD_IGNOREWHITESPACES, true );
do
{
......
......@@ -352,7 +352,7 @@ sal_Bool SAL_CALL
TextConversion_ko::interactiveConversion( const Locale& /*rLocale*/, sal_Int16 /*nTextConversionType*/, sal_Int32 /*nTextConversionOptions*/ )
throw( RuntimeException, IllegalArgumentException, NoSupportException, std::exception )
{
return sal_True;
return true;
}
} } } }
......
......@@ -329,7 +329,7 @@ sal_Bool SAL_CALL
TextConversion_zh::interactiveConversion( const Locale& /*rLocale*/, sal_Int16 /*nTextConversionType*/, sal_Int32 /*nTextConversionOptions*/ )
throw( RuntimeException, IllegalArgumentException, NoSupportException, std::exception )
{
return sal_False;
return false;
}
} } } }
......
......@@ -109,7 +109,7 @@ TextToPronounce_zh::equals( const OUString & str1, sal_Int32 pos1, sal_Int32 nCo
const sal_Unicode *pron2 = getPronounce(*s2++);
if (pron1 != pron2) {
nMatch1 = nMatch2 = i;
return sal_False;
return false;
}
}
nMatch1 = nMatch2 = realCount;
......
......@@ -479,7 +479,7 @@ TransliterationImpl::equals(
// return number of matched code points so far
nMatch1 = (i < offset1.getLength()) ? offset1[i] : i;
nMatch2 = (i < offset2.getLength()) ? offset2[i] : i;
return sal_False;
return false;
}
}
// i==nLen
......@@ -487,11 +487,11 @@ TransliterationImpl::equals(
// return number of matched code points so far
nMatch1 = (i <= offset1.getLength()) ? offset1[i-1] + 1 : i;
nMatch2 = (i <= offset2.getLength()) ? offset2[i-1] + 1 : i;
return sal_False;
return false;
} else {
nMatch1 = nCount1;
nMatch2 = nCount2;
return sal_True;
return true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment