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

More loplugin:cstylecast: linguistic

auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: Ic1b6e8fbf3ba8d3477ee3f5539667427d26c2f43
üst ad137adb
......@@ -301,9 +301,9 @@ void ConvDic::AddEntry( const OUString &rLeftText, const OUString &rRightText )
if (bMaxCharCountIsValid)
{
if (rLeftText.getLength() > nMaxLeftCharCount)
nMaxLeftCharCount = (sal_Int16) rLeftText.getLength();
nMaxLeftCharCount = static_cast<sal_Int16>(rLeftText.getLength());
if (pFromRight.get() && rRightText.getLength() > nMaxRightCharCount)
nMaxRightCharCount = (sal_Int16) rRightText.getLength();
nMaxRightCharCount = static_cast<sal_Int16>(rRightText.getLength());
}
bIsModified = true;
......@@ -513,7 +513,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection )
ConvMap::iterator aIt = aFromLeft.begin();
while (aIt != aFromLeft.end())
{
sal_Int16 nTmp = (sal_Int16) (*aIt).first.getLength();
sal_Int16 nTmp = static_cast<sal_Int16>((*aIt).first.getLength());
if (nTmp > nMaxLeftCharCount)
nMaxLeftCharCount = nTmp;
++aIt;
......@@ -525,7 +525,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection )
aIt = pFromRight->begin();
while (aIt != pFromRight->end())
{
sal_Int16 nTmp = (sal_Int16) (*aIt).first.getLength();
sal_Int16 nTmp = static_cast<sal_Int16>((*aIt).first.getLength());
if (nTmp > nMaxRightCharCount)
nMaxRightCharCount = nTmp;
++aIt;
......
......@@ -726,14 +726,14 @@ bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry >& xDic
Reference< XSpellAlternatives > xTmpRes;
xSpell.set( xLngSvcMgr->getSpellChecker(), UNO_QUERY );
Sequence< css::beans::PropertyValue > aEmptySeq;
if (xSpell.is() && (xSpell->isValid( SPELLML_SUPPORT, (sal_uInt16)nLanguage, aEmptySeq )))
if (xSpell.is() && (xSpell->isValid( SPELLML_SUPPORT, static_cast<sal_uInt16>(nLanguage), aEmptySeq )))
{
// "Grammar By" sample word is a Hunspell dictionary word?
if (xSpell->isValid( xDicEntry->getReplacementText(), (sal_uInt16)nLanguage, aEmptySeq ))
if (xSpell->isValid( xDicEntry->getReplacementText(), static_cast<sal_uInt16>(nLanguage), aEmptySeq ))
{
xTmpRes = xSpell->spell( "<?xml?><query type='add'><word>" +
xDicEntry->getDictionaryWord() + "</word><word>" + xDicEntry->getReplacementText() +
"</word></query>", (sal_uInt16)nLanguage, aEmptySeq );
"</word></query>", static_cast<sal_uInt16>(nLanguage), aEmptySeq );
bRes = true;
} else
bRes = false;
......@@ -810,7 +810,7 @@ sal_Int32 SAL_CALL DictionaryNeo::getCount( )
if (bNeedEntries)
loadEntries( aMainURL );
return (sal_Int32)aEntries.size();
return static_cast<sal_Int32>(aEntries.size());
}
Locale SAL_CALL DictionaryNeo::getLocale( )
......@@ -842,7 +842,7 @@ uno::Reference< XDictionaryEntry > SAL_CALL DictionaryNeo::getEntry(
sal_Int32 nPos;
bool bFound = seekEntry( aWord, &nPos, true );
DBG_ASSERT(!bFound || nPos < (sal_Int32)aEntries.size(), "lng : index out of range");
DBG_ASSERT(!bFound || nPos < static_cast<sal_Int32>(aEntries.size()), "lng : index out of range");
return bFound ? aEntries[ nPos ]
: uno::Reference< XDictionaryEntry >();
......@@ -896,7 +896,7 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord )
sal_Int32 nPos;
bool bFound = seekEntry( aWord, &nPos );
DBG_ASSERT(!bFound || nPos < (sal_Int32)aEntries.size(), "lng : index out of range");
DBG_ASSERT(!bFound || nPos < static_cast<sal_Int32>(aEntries.size()), "lng : index out of range");
// remove element if found
if (bFound)
......
......@@ -110,7 +110,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord(
if (!bSkip && nHyphIdx >= 0)
{
if (nLeading <= nMaxLeading) {
nHyphenationPos = (sal_Int16) nHyphIdx;
nHyphenationPos = static_cast<sal_Int16>(nHyphIdx);
nOrigHyphPos = i;
}
}
......@@ -220,7 +220,7 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens(
else
{
if (!bSkip && nHyphIdx >= 0)
pPos[ nHyphCount++ ] = (sal_Int16) nHyphIdx;
pPos[ nHyphCount++ ] = static_cast<sal_Int16>(nHyphIdx);
bSkip = true; //! multiple '=' should count as one only
}
}
......@@ -305,7 +305,7 @@ Reference< XHyphenatedWord > SAL_CALL
bWordModified |= RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
bWordModified |= RemoveControlChars( aChkWord );
sal_Int16 nChkMaxLeading = (sal_Int16) GetPosInWordToCheck( rWord, nMaxLeading );
sal_Int16 nChkMaxLeading = static_cast<sal_Int16>(GetPosInWordToCheck( rWord, nMaxLeading ));
// check for results from (positive) dictionaries which have precedence!
Reference< XDictionaryEntry > xEntry;
......@@ -379,7 +379,7 @@ Reference< XHyphenatedWord > SAL_CALL
xRes = xHyph->hyphenate( aChkWord, rLocale, nChkMaxLeading,
rProperties );
pEntry->nLastTriedSvcIndex = (sal_Int16) i;
pEntry->nLastTriedSvcIndex = static_cast<sal_Int16>(i);
++i;
// if language is not supported by the services
......@@ -440,7 +440,7 @@ Reference< XHyphenatedWord > SAL_CALL
bWordModified |= RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
bWordModified |= RemoveControlChars( aChkWord );
sal_Int16 nChkIndex = (sal_Int16) GetPosInWordToCheck( rWord, nIndex );
sal_Int16 nChkIndex = static_cast<sal_Int16>(GetPosInWordToCheck( rWord, nIndex ));
// check for results from (positive) dictionaries which have precedence!
Reference< XDictionaryEntry > xEntry;
......@@ -510,7 +510,7 @@ Reference< XHyphenatedWord > SAL_CALL
xRes = xHyph->queryAlternativeSpelling( aChkWord, rLocale,
nChkIndex, rProperties );
pEntry->nLastTriedSvcIndex = (sal_Int16) i;
pEntry->nLastTriedSvcIndex = static_cast<sal_Int16>(i);
++i;
// if language is not supported by the services
......@@ -631,7 +631,7 @@ Reference< XPossibleHyphens > SAL_CALL
if (xHyph.is() && xHyph->hasLocale( rLocale ))
xRes = xHyph->createPossibleHyphens( aChkWord, rLocale, rProperties );
pEntry->nLastTriedSvcIndex = (sal_Int16) i;
pEntry->nLastTriedSvcIndex = static_cast<sal_Int16>(i);
++i;
// if language is not supported by the services
......
......@@ -111,23 +111,23 @@ public:
virtual sal_Bool SAL_CALL getIsUseDictionaryList() override
{ return getPropertyBool(UPN_IS_USE_DICTIONARY_LIST); }
virtual void SAL_CALL setIsUseDictionaryList(sal_Bool p1) override
{ setProperty(UPN_IS_USE_DICTIONARY_LIST, (bool) p1); }
{ setProperty(UPN_IS_USE_DICTIONARY_LIST, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsIgnoreControlCharacters() override
{ return getPropertyBool(UPN_IS_IGNORE_CONTROL_CHARACTERS); }
virtual void SAL_CALL setIsIgnoreControlCharacters(sal_Bool p1) override
{ setProperty(UPN_IS_IGNORE_CONTROL_CHARACTERS, (bool) p1); }
{ setProperty(UPN_IS_IGNORE_CONTROL_CHARACTERS, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsSpellUpperCase() override
{ return getPropertyBool(UPN_IS_SPELL_UPPER_CASE); }
virtual void SAL_CALL setIsSpellUpperCase(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_UPPER_CASE, (bool) p1); }
{ setProperty(UPN_IS_SPELL_UPPER_CASE, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsSpellWithDigits() override
{ return getPropertyBool(UPN_IS_SPELL_WITH_DIGITS); }
virtual void SAL_CALL setIsSpellWithDigits(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_WITH_DIGITS, (bool) p1); }
{ setProperty(UPN_IS_SPELL_WITH_DIGITS, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsSpellCapitalization() override
{ return getPropertyBool(UPN_IS_SPELL_CAPITALIZATION); }
virtual void SAL_CALL setIsSpellCapitalization(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_CAPITALIZATION, (bool) p1); }
{ setProperty(UPN_IS_SPELL_CAPITALIZATION, static_cast<bool>(p1)); }
virtual sal_Int16 SAL_CALL getHyphMinLeading() override
{ return getPropertyInt16(UPN_HYPH_MIN_LEADING); }
virtual void SAL_CALL setHyphMinLeading(sal_Int16 p1) override
......@@ -147,23 +147,23 @@ public:
virtual sal_Bool SAL_CALL getIsHyphAuto() override
{ return getPropertyBool(UPN_IS_HYPH_AUTO); }
virtual void SAL_CALL setIsHyphAuto(sal_Bool p1) override
{ setProperty(UPN_IS_HYPH_AUTO, (bool) p1); }
{ setProperty(UPN_IS_HYPH_AUTO, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsHyphSpecial() override
{ return getPropertyBool(UPN_IS_HYPH_SPECIAL); }
virtual void SAL_CALL setIsHyphSpecial(sal_Bool p1) override
{ setProperty(UPN_IS_HYPH_SPECIAL, (bool) p1); }
{ setProperty(UPN_IS_HYPH_SPECIAL, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsSpellAuto() override
{ return getPropertyBool(UPN_IS_SPELL_AUTO); }
virtual void SAL_CALL setIsSpellAuto(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_AUTO, (bool) p1); }
{ setProperty(UPN_IS_SPELL_AUTO, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsSpellSpecial() override
{ return getPropertyBool(UPN_IS_SPELL_SPECIAL); }
virtual void SAL_CALL setIsSpellSpecial(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_SPECIAL, (bool) p1); }
{ setProperty(UPN_IS_SPELL_SPECIAL, static_cast<bool>(p1)); }
virtual sal_Bool SAL_CALL getIsWrapReverse() override
{ return getPropertyBool(UPN_IS_WRAP_REVERSE); }
virtual void SAL_CALL setIsWrapReverse(sal_Bool p1) override
{ setProperty(UPN_IS_WRAP_REVERSE, (bool) p1); }
{ setProperty(UPN_IS_WRAP_REVERSE, static_cast<bool>(p1)); }
virtual css::lang::Locale SAL_CALL getDefaultLocale_CJK() override
{ return getPropertyLocale(UPN_DEFAULT_LOCALE_CJK); }
virtual void SAL_CALL setDefaultLocale_CJK(const css::lang::Locale& p1) override
......
......@@ -400,7 +400,7 @@ uno::Sequence< sal_Int16 >
sal_Int16 *pLang = aLangs.getArray();
for (sal_Int32 i = 0; i < nCount; ++i)
{
pLang[i] = (sal_uInt16)LinguLocaleToLanguage( pLocale[i] );
pLang[i] = static_cast<sal_uInt16>(LinguLocaleToLanguage( pLocale[i] ));
}
return aLangs;
......
......@@ -401,7 +401,7 @@ bool SpellCheckerDispatcher::isValid_Impl(
if (bTmpResValid)
bRes = bTmpRes;
pEntry->nLastTriedSvcIndex = (sal_Int16) i;
pEntry->nLastTriedSvcIndex = static_cast<sal_Int16>(i);
++i;
}
......@@ -603,7 +603,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
nNumSugestions = nTmpNumSugestions;
}
pEntry->nLastTriedSvcIndex = (sal_Int16) i;
pEntry->nLastTriedSvcIndex = static_cast<sal_Int16>(i);
++i;
}
......
......@@ -140,7 +140,7 @@ std::vector< OUString > MergeProposalSeqs(
size_t nAltCount1 = rAlt1.size();
size_t nAltCount2 = rAlt2.size();
sal_Int32 nCountNew = std::min<sal_Int32>( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS );
sal_Int32 nCountNew = std::min<sal_Int32>( nAltCount1 + nAltCount2, sal_Int32(MAX_PROPOSALS) );
aMerged.resize( nCountNew );
sal_Int32 nIndex = 0;
......@@ -209,7 +209,7 @@ sal_Int16 SAL_CALL SpellAlternatives::getFailureType()
sal_Int16 SAL_CALL SpellAlternatives::getAlternativesCount()
{
MutexGuard aGuard( GetLinguMutex() );
return (sal_Int16) aAlt.getLength();
return static_cast<sal_Int16>(aAlt.getLength());
}
......
......@@ -179,7 +179,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
if (xThes.is() && xThes->hasLocale( rLocale ))
aMeanings = xThes->queryMeanings( aChkWord, rLocale, rProperties );
pEntry->nLastTriedSvcIndex = (sal_Int16) i;
pEntry->nLastTriedSvcIndex = static_cast<sal_Int16>(i);
++i;
}
......
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