linguistic: sal_Bool->bool

Change-Id: Ie2366b25a1f81a5b25142e8b9a727bcc2f585c14
This commit is contained in:
Noel Grandin
2014-03-31 14:35:18 +02:00
parent 95d7ebd22d
commit cb66ea3604
13 changed files with 123 additions and 123 deletions

View File

@@ -586,7 +586,7 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl)
SvxPrepareAutoCorrect( aOldWord, aString ); SvxPrepareAutoCorrect( aOldWord, aString );
Reference<XDictionary> aXDictionary( SvxGetChangeAllList(), UNO_QUERY ); Reference<XDictionary> aXDictionary( SvxGetChangeAllList(), UNO_QUERY );
sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary, sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary,
aOldWord , sal_True, aOldWord, true,
aString, eLang ); aString, eLang );
if(nAdded == DIC_ERR_NONE) if(nAdded == DIC_ERR_NONE)
@@ -635,7 +635,7 @@ IMPL_LINK( SpellDialog, IgnoreAllHdl, Button *, pButton )
{ {
OUString sErrorText(m_pSentenceED->GetErrorText()); OUString sErrorText(m_pSentenceED->GetErrorText());
sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary, sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary,
sErrorText, sal_False, sErrorText, false,
OUString(), LANGUAGE_NONE ); OUString(), LANGUAGE_NONE );
if(nAdded == DIC_ERR_NONE) if(nAdded == DIC_ERR_NONE)
{ {
@@ -917,7 +917,7 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu )
sal_Int16 nAddRes = DIC_ERR_UNKNOWN; sal_Int16 nAddRes = DIC_ERR_UNKNOWN;
if (xDic.is()) if (xDic.is())
{ {
nAddRes = linguistic::AddEntryToDic( xDic, aNewWord, sal_False, OUString(), LANGUAGE_NONE ); nAddRes = linguistic::AddEntryToDic( xDic, aNewWord, false, OUString(), LANGUAGE_NONE );
// save modified user-dictionary if it is persistent // save modified user-dictionary if it is persistent
uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY ); uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
if (xSavDic.is()) if (xSavDic.is())

View File

@@ -621,7 +621,7 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn)
nAddRes = linguistic::AddEntryToDic( xDic, nAddRes = linguistic::AddEntryToDic( xDic,
aNewWord, bIsNegEntry, aNewWord, bIsNegEntry,
aRplcText, LanguageTag( xDic->getLocale() ).getLanguageType(), sal_False ); aRplcText, LanguageTag( xDic->getLocale() ).getLanguageType(), false );
} }
} }
if (DIC_ERR_NONE != nAddRes) if (DIC_ERR_NONE != nAddRes)

View File

@@ -36,10 +36,10 @@ class HyphenatedWord :
{ {
OUString aWord; OUString aWord;
OUString aHyphenatedWord; OUString aHyphenatedWord;
sal_Int16 nHyphPos; sal_Int16 nHyphPos;
sal_Int16 nHyphenationPos; sal_Int16 nHyphenationPos;
sal_Int16 nLanguage; sal_Int16 nLanguage;
sal_Bool bIsAltSpelling; bool bIsAltSpelling;
// disallow copy-constructor and assignment-operator for now // disallow copy-constructor and assignment-operator for now
HyphenatedWord(const HyphenatedWord &); HyphenatedWord(const HyphenatedWord &);

View File

@@ -68,12 +68,12 @@ class PropertyChgHelper :
int nEvtFlags; // flags for event types allowed to be launched int nEvtFlags; // flags for event types allowed to be launched
// default values // default values
sal_Bool bIsIgnoreControlCharacters; bool bIsIgnoreControlCharacters;
sal_Bool bIsUseDictionaryList; bool bIsUseDictionaryList;
// return values, will be set to default value or current temporary value // return values, will be set to default value or current temporary value
sal_Bool bResIsIgnoreControlCharacters; bool bResIsIgnoreControlCharacters;
sal_Bool bResIsUseDictionaryList; bool bResIsUseDictionaryList;
// disallow use of copy-constructor and assignment-operator // disallow use of copy-constructor and assignment-operator
@@ -92,7 +92,7 @@ protected:
void AddPropNames( const char *pNewNames[], sal_Int32 nCount ); void AddPropNames( const char *pNewNames[], sal_Int32 nCount );
virtual sal_Bool propertyChange_Impl( virtual bool propertyChange_Impl(
const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
public: public:
@@ -143,8 +143,8 @@ public:
::com::sun::star::uno::XInterface > & ::com::sun::star::uno::XInterface > &
GetEvtObj() const { return xMyEvtObj; } GetEvtObj() const { return xMyEvtObj; }
sal_Bool IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } bool IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; }
sal_Bool IsUseDictionaryList() const { return bResIsUseDictionaryList; } bool IsUseDictionaryList() const { return bResIsUseDictionaryList; }
}; };
@@ -195,15 +195,15 @@ class LNG_DLLPUBLIC PropertyHelper_Spell :
public PropertyChgHelper public PropertyChgHelper
{ {
// default values // default values
sal_Bool bIsSpellUpperCase; bool bIsSpellUpperCase;
sal_Bool bIsSpellWithDigits; bool bIsSpellWithDigits;
sal_Bool bIsSpellCapitalization; bool bIsSpellCapitalization;
// return values, will be set to default value or current temporary value // return values, will be set to default value or current temporary value
sal_Int16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently sal_Int16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently
sal_Bool bResIsSpellUpperCase; bool bResIsSpellUpperCase;
sal_Bool bResIsSpellWithDigits; bool bResIsSpellWithDigits;
sal_Bool bResIsSpellCapitalization; bool bResIsSpellCapitalization;
// disallow use of copy-constructor and assignment-operator // disallow use of copy-constructor and assignment-operator
@@ -214,7 +214,7 @@ protected:
// PropertyChgHelper // PropertyChgHelper
virtual void SetDefaultValues() SAL_OVERRIDE; virtual void SetDefaultValues() SAL_OVERRIDE;
virtual void GetCurrentValues() SAL_OVERRIDE; virtual void GetCurrentValues() SAL_OVERRIDE;
virtual sal_Bool propertyChange_Impl( virtual bool propertyChange_Impl(
const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) SAL_OVERRIDE; const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) SAL_OVERRIDE;
public: public:
@@ -235,9 +235,9 @@ public:
virtual sal_Int16 GetDefaultNumberOfSuggestions() const; virtual sal_Int16 GetDefaultNumberOfSuggestions() const;
sal_Int16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; } sal_Int16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; }
sal_Bool IsSpellUpperCase() const { return bResIsSpellUpperCase; } bool IsSpellUpperCase() const { return bResIsSpellUpperCase; }
sal_Bool IsSpellWithDigits() const { return bResIsSpellWithDigits; } bool IsSpellWithDigits() const { return bResIsSpellWithDigits; }
sal_Bool IsSpellCapitalization() const { return bResIsSpellCapitalization; } bool IsSpellCapitalization() const { return bResIsSpellCapitalization; }
}; };
@@ -260,15 +260,15 @@ public:
void AddAsPropListener(); void AddAsPropListener();
void RemoveAsPropListener(); void RemoveAsPropListener();
void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
sal_Bool IsSpellUpperCase() const; bool IsSpellUpperCase() const;
sal_Bool IsSpellWithDigits() const; bool IsSpellWithDigits() const;
sal_Bool IsSpellCapitalization() const; bool IsSpellCapitalization() const;
sal_Bool addLinguServiceEventListener( bool addLinguServiceEventListener(
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
throw(::com::sun::star::uno::RuntimeException); throw(::com::sun::star::uno::RuntimeException);
sal_Bool removeLinguServiceEventListener( bool removeLinguServiceEventListener(
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
throw(::com::sun::star::uno::RuntimeException); throw(::com::sun::star::uno::RuntimeException);
@@ -296,7 +296,7 @@ protected:
// PropertyChgHelper // PropertyChgHelper
virtual void SetDefaultValues() SAL_OVERRIDE; virtual void SetDefaultValues() SAL_OVERRIDE;
virtual void GetCurrentValues() SAL_OVERRIDE; virtual void GetCurrentValues() SAL_OVERRIDE;
virtual sal_Bool propertyChange_Impl( virtual bool propertyChange_Impl(
const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) SAL_OVERRIDE; const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) SAL_OVERRIDE;
public: public:

View File

@@ -120,10 +120,10 @@ LNG_DLLPUBLIC bool LinguIsUnspecified( const OUString & rBcp47 );
// checks if file pointed to by rURL is readonly // checks if file pointed to by rURL is readonly
// and may also check return if such a file exists or not // and may also check return if such a file exists or not
sal_Bool IsReadOnly( const OUString &rURL, sal_Bool *pbExist = 0 ); bool IsReadOnly( const OUString &rURL, bool *pbExist = 0 );
// checks if a file with the given URL exists // checks if a file with the given URL exists
sal_Bool FileExists( const OUString &rURL ); bool FileExists( const OUString &rURL );
OUString GetDictionaryWriteablePath(); OUString GetDictionaryWriteablePath();
@@ -142,14 +142,14 @@ LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPo
::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord ); ::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord );
LNG_DLLPUBLIC sal_Bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, sal_Int16 nLanguage ); LNG_DLLPUBLIC bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, sal_Int16 nLanguage );
inline sal_Bool IsUpper( const OUString &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.getLength(), nLanguage ); } inline bool IsUpper( const OUString &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.getLength(), nLanguage ); }
LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass *); LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass *);
OUString ToLower( const OUString &rText, sal_Int16 nLanguage ); OUString ToLower( const OUString &rText, sal_Int16 nLanguage );
LNG_DLLPUBLIC sal_Bool HasDigits( const OUString &rText ); LNG_DLLPUBLIC bool HasDigits( const OUString &rText );
LNG_DLLPUBLIC sal_Bool IsNumeric( const OUString &rText ); LNG_DLLPUBLIC bool IsNumeric( const OUString &rText );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName );
@@ -158,11 +158,11 @@ LNG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::X
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList(); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
sal_Bool IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties, bool IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties,
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > &rxPropSet ); ::com::sun::star::beans::XPropertySet > &rxPropSet );
sal_Bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rProperties, bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rProperties,
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > &rxPropSet ); ::com::sun::star::beans::XPropertySet > &rxPropSet );
@@ -171,15 +171,15 @@ sal_Bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rP
SearchDicList( SearchDicList(
const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList >& rDicList, const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList >& rDicList,
const OUString& rWord, sal_Int16 nLanguage, const OUString& rWord, sal_Int16 nLanguage,
sal_Bool bSearchPosDics, sal_Bool bSearchSpellEntry ); bool bSearchPosDics, bool bSearchSpellEntry );
LNG_DLLPUBLIC sal_uInt8 AddEntryToDic( LNG_DLLPUBLIC sal_uInt8 AddEntryToDic(
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > &rxDic, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > &rxDic,
const OUString &rWord, sal_Bool bIsNeg, const OUString &rWord, bool bIsNeg,
const OUString &rRplcTxt, sal_Int16 nRplcLang, const OUString &rRplcTxt, sal_Int16 nRplcLang,
sal_Bool bStripDot = sal_True ); bool bStripDot = true );
LNG_DLLPUBLIC sal_Bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > &xDicList ); LNG_DLLPUBLIC bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > &xDicList );
// AppExitLstnr: // AppExitLstnr:
// virtual base class that calls it AtExit function when the application // virtual base class that calls it AtExit function when the application

View File

@@ -42,7 +42,7 @@ namespace linguistic
MergeProposalSeqs( MergeProposalSeqs(
::com::sun::star::uno::Sequence< OUString > &rAlt1, ::com::sun::star::uno::Sequence< OUString > &rAlt1,
::com::sun::star::uno::Sequence< OUString > &rAlt2, ::com::sun::star::uno::Sequence< OUString > &rAlt2,
sal_Bool bAllowDuplicates ); bool bAllowDuplicates );
void SeqRemoveNegEntries( void SeqRemoveNegEntries(
::com::sun::star::uno::Sequence< OUString > &rSeq, ::com::sun::star::uno::Sequence< OUString > &rSeq,
@@ -50,7 +50,7 @@ void SeqRemoveNegEntries(
::com::sun::star::linguistic2::XSearchableDictionaryList > &rxDicList, ::com::sun::star::linguistic2::XSearchableDictionaryList > &rxDicList,
sal_Int16 nLanguage ); sal_Int16 nLanguage );
sal_Bool SeqHasEntry( bool SeqHasEntry(
const ::com::sun::star::uno::Sequence< OUString > &rSeq, const ::com::sun::star::uno::Sequence< OUString > &rSeq,
const OUString &rTxt); const OUString &rTxt);

View File

@@ -189,7 +189,7 @@ ConvDic::ConvDic(
if( !rMainURL.isEmpty() ) if( !rMainURL.isEmpty() )
{ {
sal_Bool bExists = sal_False; bool bExists = false;
bIsReadonly = IsReadOnly( rMainURL, &bExists ); bIsReadonly = IsReadOnly( rMainURL, &bExists );
if( !bExists ) // new empty dictionary if( !bExists ) // new empty dictionary

View File

@@ -114,8 +114,8 @@ void PropertyChgHelper::AddPropNames( const char *pNewNames[], sal_Int32 nCount
void PropertyChgHelper::SetDefaultValues() void PropertyChgHelper::SetDefaultValues()
{ {
bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = sal_True; bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = true;
bResIsUseDictionaryList = bIsUseDictionaryList = sal_True; bResIsUseDictionaryList = bIsUseDictionaryList = true;
} }
@@ -127,7 +127,7 @@ void PropertyChgHelper::GetCurrentValues()
const OUString *pPropName = GetPropNames().getConstArray(); const OUString *pPropName = GetPropNames().getConstArray();
for (sal_Int32 i = 0; i < nLen; ++i) for (sal_Int32 i = 0; i < nLen; ++i)
{ {
sal_Bool *pbVal = NULL, bool *pbVal = NULL,
*pbResVal = NULL; *pbResVal = NULL;
if ( pPropName[i] == UPN_IS_IGNORE_CONTROL_CHARACTERS ) if ( pPropName[i] == UPN_IS_IGNORE_CONTROL_CHARACTERS )
@@ -164,7 +164,7 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
const PropertyValue *pVal = rPropVals.getConstArray(); const PropertyValue *pVal = rPropVals.getConstArray();
for (sal_Int32 i = 0; i < nLen; ++i) for (sal_Int32 i = 0; i < nLen; ++i)
{ {
sal_Bool *pbResVal = NULL; bool *pbResVal = NULL;
switch (pVal[i].Handle) switch (pVal[i].Handle)
{ {
case UPH_IS_IGNORE_CONTROL_CHARACTERS : case UPH_IS_IGNORE_CONTROL_CHARACTERS :
@@ -181,18 +181,18 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
} }
sal_Bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt )
{ {
sal_Bool bRes = sal_False; bool bRes = false;
if (GetPropSet().is() && rEvt.Source == GetPropSet()) if (GetPropSet().is() && rEvt.Source == GetPropSet())
{ {
sal_Int16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ? sal_Int16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ?
LinguServiceEventFlags::HYPHENATE_AGAIN : 0; LinguServiceEventFlags::HYPHENATE_AGAIN : 0;
sal_Bool bSCWA = sal_False, // SPELL_CORRECT_WORDS_AGAIN ? bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
bSWWA = sal_False; // SPELL_WRONG_WORDS_AGAIN ? bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
sal_Bool *pbVal = NULL; bool *pbVal = NULL;
switch (rEvt.PropertyHandle) switch (rEvt.PropertyHandle)
{ {
case UPH_IS_IGNORE_CONTROL_CHARACTERS : case UPH_IS_IGNORE_CONTROL_CHARACTERS :
@@ -204,12 +204,12 @@ sal_Bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt
case UPH_IS_USE_DICTIONARY_LIST : case UPH_IS_USE_DICTIONARY_LIST :
{ {
pbVal = &bIsUseDictionaryList; pbVal = &bIsUseDictionaryList;
bSCWA = bSWWA = sal_True; bSCWA = bSWWA = true;
break; break;
} }
default: default:
{ {
bRes = sal_False; bRes = false;
} }
} }
if (pbVal) if (pbVal)
@@ -218,7 +218,7 @@ sal_Bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt
bRes = 0 != pbVal; // sth changed? bRes = 0 != pbVal; // sth changed?
if (bRes) if (bRes)
{ {
sal_Bool bSpellEvts = (nEvtFlags & AE_SPELLCHECKER) ? sal_True : sal_False; bool bSpellEvts = (nEvtFlags & AE_SPELLCHECKER);
if (bSCWA && bSpellEvts) if (bSCWA && bSpellEvts)
nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN; nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
if (bSWWA && bSpellEvts) if (bSWWA && bSpellEvts)
@@ -390,9 +390,9 @@ void PropertyHelper_Spell::SetDefaultValues()
{ {
PropertyChgHelper::SetDefaultValues(); PropertyChgHelper::SetDefaultValues();
bResIsSpellUpperCase = bIsSpellUpperCase = sal_False; bResIsSpellUpperCase = bIsSpellUpperCase = false;
bResIsSpellWithDigits = bIsSpellWithDigits = sal_False; bResIsSpellWithDigits = bIsSpellWithDigits = false;
bResIsSpellCapitalization = bIsSpellCapitalization = sal_True; bResIsSpellCapitalization = bIsSpellCapitalization = true;
} }
@@ -406,7 +406,7 @@ void PropertyHelper_Spell::GetCurrentValues()
const OUString *pPropName = GetPropNames().getConstArray(); const OUString *pPropName = GetPropNames().getConstArray();
for (sal_Int32 i = 0; i < nLen; ++i) for (sal_Int32 i = 0; i < nLen; ++i)
{ {
sal_Bool *pbVal = NULL, bool *pbVal = NULL,
*pbResVal = NULL; *pbResVal = NULL;
if ( pPropName[i] == UPN_IS_SPELL_UPPER_CASE ) if ( pPropName[i] == UPN_IS_SPELL_UPPER_CASE )
@@ -435,36 +435,36 @@ void PropertyHelper_Spell::GetCurrentValues()
} }
sal_Bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt ) bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt )
{ {
sal_Bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt ); bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet()) if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
{ {
sal_Bool bSCWA = sal_False, // SPELL_CORRECT_WORDS_AGAIN ? bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
bSWWA = sal_False; // SPELL_WRONG_WORDS_AGAIN ? bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
sal_Bool *pbVal = NULL; bool *pbVal = NULL;
switch (rEvt.PropertyHandle) switch (rEvt.PropertyHandle)
{ {
case UPH_IS_SPELL_UPPER_CASE : case UPH_IS_SPELL_UPPER_CASE :
{ {
pbVal = &bIsSpellUpperCase; pbVal = &bIsSpellUpperCase;
bSCWA = sal_False == *pbVal; // sal_False->sal_True change? bSCWA = ! *pbVal; // sal_False->sal_True change?
bSWWA = !bSCWA; // sal_True->sal_False change? bSWWA = !bSCWA; // sal_True->sal_False change?
break; break;
} }
case UPH_IS_SPELL_WITH_DIGITS : case UPH_IS_SPELL_WITH_DIGITS :
{ {
pbVal = &bIsSpellWithDigits; pbVal = &bIsSpellWithDigits;
bSCWA = sal_False == *pbVal; // sal_False->sal_True change? bSCWA = ! *pbVal; // sal_False->sal_True change?
bSWWA = !bSCWA; // sal_True->sal_False change? bSWWA = !bSCWA; // sal_True->sal_False change?
break; break;
} }
case UPH_IS_SPELL_CAPITALIZATION : case UPH_IS_SPELL_CAPITALIZATION :
{ {
pbVal = &bIsSpellCapitalization; pbVal = &bIsSpellCapitalization;
bSCWA = sal_False == *pbVal; // sal_False->sal_True change? bSCWA = ! *pbVal; // sal_False->sal_True change?
bSWWA = !bSCWA; // sal_True->sal_False change? bSWWA = !bSCWA; // sal_True->sal_False change?
break; break;
} }
@@ -526,7 +526,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
} }
else else
{ {
sal_Bool *pbResVal = NULL; bool *pbResVal = NULL;
switch (pVal[i].Handle) switch (pVal[i].Handle)
{ {
case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break; case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;
@@ -621,9 +621,9 @@ void PropertyHelper_Hyphen::GetCurrentValues()
} }
sal_Bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt ) bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt )
{ {
sal_Bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt ); bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet()) if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
{ {
@@ -817,22 +817,22 @@ void PropertyHelper_Spelling::SetTmpPropVals( const com::sun::star::beans::Prope
pInst->SetTmpPropVals( rPropVals ); pInst->SetTmpPropVals( rPropVals );
} }
sal_Bool PropertyHelper_Spelling::IsSpellUpperCase() const bool PropertyHelper_Spelling::IsSpellUpperCase() const
{ {
return pInst->IsSpellUpperCase(); return pInst->IsSpellUpperCase();
} }
sal_Bool PropertyHelper_Spelling::IsSpellWithDigits() const bool PropertyHelper_Spelling::IsSpellWithDigits() const
{ {
return pInst->IsSpellWithDigits(); return pInst->IsSpellWithDigits();
} }
sal_Bool PropertyHelper_Spelling::IsSpellCapitalization() const bool PropertyHelper_Spelling::IsSpellCapitalization() const
{ {
return pInst->IsSpellCapitalization(); return pInst->IsSpellCapitalization();
} }
sal_Bool PropertyHelper_Spelling::addLinguServiceEventListener( bool PropertyHelper_Spelling::addLinguServiceEventListener(
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
throw(::com::sun::star::uno::RuntimeException) throw(::com::sun::star::uno::RuntimeException)
@@ -840,7 +840,7 @@ sal_Bool PropertyHelper_Spelling::addLinguServiceEventListener(
return pInst->addLinguServiceEventListener( rxListener ); return pInst->addLinguServiceEventListener( rxListener );
} }
sal_Bool PropertyHelper_Spelling::removeLinguServiceEventListener( bool PropertyHelper_Spelling::removeLinguServiceEventListener(
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
throw(::com::sun::star::uno::RuntimeException) throw(::com::sun::star::uno::RuntimeException)

View File

@@ -203,10 +203,10 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 )
return nDist; return nDist;
} }
sal_Bool IsUseDicList( const PropertyValues &rProperties, bool IsUseDicList( const PropertyValues &rProperties,
const uno::Reference< XPropertySet > &rxProp ) const uno::Reference< XPropertySet > &rxProp )
{ {
sal_Bool bRes = sal_True; bool bRes = true;
sal_Int32 nLen = rProperties.getLength(); sal_Int32 nLen = rProperties.getLength();
const PropertyValue *pVal = rProperties.getConstArray(); const PropertyValue *pVal = rProperties.getConstArray();
@@ -230,10 +230,10 @@ sal_Bool IsUseDicList( const PropertyValues &rProperties,
return bRes; return bRes;
} }
sal_Bool IsIgnoreControlChars( const PropertyValues &rProperties, bool IsIgnoreControlChars( const PropertyValues &rProperties,
const uno::Reference< XPropertySet > &rxProp ) const uno::Reference< XPropertySet > &rxProp )
{ {
sal_Bool bRes = sal_True; bool bRes = true;
sal_Int32 nLen = rProperties.getLength(); sal_Int32 nLen = rProperties.getLength();
const PropertyValue *pVal = rProperties.getConstArray(); const PropertyValue *pVal = rProperties.getConstArray();
@@ -257,9 +257,9 @@ sal_Bool IsIgnoreControlChars( const PropertyValues &rProperties,
return bRes; return bRes;
} }
static sal_Bool lcl_HasHyphInfo( const uno::Reference<XDictionaryEntry> &xEntry ) static bool lcl_HasHyphInfo( const uno::Reference<XDictionaryEntry> &xEntry )
{ {
sal_Bool bRes = sal_False; bool bRes = false;
if (xEntry.is()) if (xEntry.is())
{ {
// there has to be (at least one) '=' or '[' denoting a hyphenation position // there has to be (at least one) '=' or '[' denoting a hyphenation position
@@ -275,7 +275,7 @@ static sal_Bool lcl_HasHyphInfo( const uno::Reference<XDictionaryEntry> &xEntry
uno::Reference< XDictionaryEntry > SearchDicList( uno::Reference< XDictionaryEntry > SearchDicList(
const uno::Reference< XSearchableDictionaryList > &xDicList, const uno::Reference< XSearchableDictionaryList > &xDicList,
const OUString &rWord, sal_Int16 nLanguage, const OUString &rWord, sal_Int16 nLanguage,
sal_Bool bSearchPosDics, sal_Bool bSearchSpellEntry ) bool bSearchPosDics, bool bSearchSpellEntry )
{ {
MutexGuard aGuard( GetLinguMutex() ); MutexGuard aGuard( GetLinguMutex() );
@@ -320,12 +320,12 @@ uno::Reference< XDictionaryEntry > SearchDicList(
return xEntry; return xEntry;
} }
sal_Bool SaveDictionaries( const uno::Reference< XSearchableDictionaryList > &xDicList ) bool SaveDictionaries( const uno::Reference< XSearchableDictionaryList > &xDicList )
{ {
if (!xDicList.is()) if (!xDicList.is())
return sal_True; return true;
sal_Bool bRet = sal_True; bool bRet = true;
Sequence< uno::Reference< XDictionary > > aDics( xDicList->getDictionaries() ); Sequence< uno::Reference< XDictionary > > aDics( xDicList->getDictionaries() );
const uno::Reference< XDictionary > *pDic = aDics.getConstArray(); const uno::Reference< XDictionary > *pDic = aDics.getConstArray();
@@ -343,7 +343,7 @@ sal_Bool SaveDictionaries( const uno::Reference< XSearchableDictionaryList > &xD
} }
catch(uno::Exception &) catch(uno::Exception &)
{ {
bRet = sal_False; bRet = false;
} }
} }
@@ -352,9 +352,9 @@ sal_Bool SaveDictionaries( const uno::Reference< XSearchableDictionaryList > &xD
sal_uInt8 AddEntryToDic( sal_uInt8 AddEntryToDic(
uno::Reference< XDictionary > &rxDic, uno::Reference< XDictionary > &rxDic,
const OUString &rWord, sal_Bool bIsNeg, const OUString &rWord, bool bIsNeg,
const OUString &rRplcTxt, sal_Int16 /* nRplcLang */, const OUString &rRplcTxt, sal_Int16 /* nRplcLang */,
sal_Bool bStripDot ) bool bStripDot )
{ {
if (!rxDic.is()) if (!rxDic.is())
return DIC_ERR_NOT_EXISTS; return DIC_ERR_NOT_EXISTS;
@@ -370,7 +370,7 @@ sal_uInt8 AddEntryToDic(
aTmp = aTmp.copy( 0, nLen - 1 ); aTmp = aTmp.copy( 0, nLen - 1 );
} }
} }
sal_Bool bAddOk = rxDic->add( aTmp, bIsNeg, rRplcTxt ); bool bAddOk = rxDic->add( aTmp, bIsNeg, rRplcTxt );
sal_uInt8 nRes = DIC_ERR_NONE; sal_uInt8 nRes = DIC_ERR_NONE;
if (!bAddOk) if (!bAddOk)
@@ -406,10 +406,10 @@ uno::Sequence< sal_Int16 >
return aLangs; return aLangs;
} }
sal_Bool IsReadOnly( const OUString &rURL, sal_Bool *pbExist ) bool IsReadOnly( const OUString &rURL, bool *pbExist )
{ {
sal_Bool bRes = sal_False; bool bRes = false;
sal_Bool bExists = sal_False; bool bExists = false;
if (!rURL.isEmpty()) if (!rURL.isEmpty())
{ {
@@ -427,7 +427,7 @@ sal_Bool IsReadOnly( const OUString &rURL, sal_Bool *pbExist )
} }
catch (Exception &) catch (Exception &)
{ {
bRes = sal_True; bRes = true;
} }
} }
@@ -436,10 +436,10 @@ sal_Bool IsReadOnly( const OUString &rURL, sal_Bool *pbExist )
return bRes; return bRes;
} }
static sal_Bool GetAltSpelling( sal_Int16 &rnChgPos, sal_Int16 &rnChgLen, OUString &rRplc, static bool GetAltSpelling( sal_Int16 &rnChgPos, sal_Int16 &rnChgLen, OUString &rRplc,
uno::Reference< XHyphenatedWord > &rxHyphWord ) uno::Reference< XHyphenatedWord > &rxHyphWord )
{ {
sal_Bool bRes = rxHyphWord->isAlternativeSpelling(); bool bRes = rxHyphWord->isAlternativeSpelling();
if (bRes) if (bRes)
{ {
OUString aWord( rxHyphWord->getWord() ), OUString aWord( rxHyphWord->getWord() ),
@@ -495,7 +495,7 @@ static sal_Int16 GetOrigWordPos( const OUString &rOrigWord, sal_Int16 nPos )
while (nPos >= 0 && i++ < nLen) while (nPos >= 0 && i++ < nLen)
{ {
sal_Unicode cChar = rOrigWord[i]; sal_Unicode cChar = rOrigWord[i];
sal_Bool bSkip = IsHyphen( cChar ) || IsControlChar( cChar ); bool bSkip = IsHyphen( cChar ) || IsControlChar( cChar );
if (!bSkip) if (!bSkip)
--nPos; --nPos;
} }
@@ -512,7 +512,7 @@ sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPos )
for (sal_Int32 i = 0; i < nPos; ++i) for (sal_Int32 i = 0; i < nPos; ++i)
{ {
sal_Unicode cChar = rTxt[i]; sal_Unicode cChar = rTxt[i];
sal_Bool bSkip = IsHyphen( cChar ) || IsControlChar( cChar ); bool bSkip = IsHyphen( cChar ) || IsControlChar( cChar );
if (!bSkip) if (!bSkip)
++nRes; ++nRes;
} }
@@ -530,7 +530,7 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars(
sal_Int16 nChgPos = 0, sal_Int16 nChgPos = 0,
nChgLen = 0; nChgLen = 0;
OUString aRplc; OUString aRplc;
sal_Bool bAltSpelling = GetAltSpelling( nChgPos, nChgLen, aRplc, rxHyphWord ); bool bAltSpelling = GetAltSpelling( nChgPos, nChgLen, aRplc, rxHyphWord );
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
OUString aWord( rxHyphWord->getWord() ); OUString aWord( rxHyphWord->getWord() );
#endif #endif
@@ -597,7 +597,7 @@ osl::Mutex & lcl_GetCharClassMutex()
return aMutex; return aMutex;
} }
sal_Bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, sal_Int16 nLanguage ) bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, sal_Int16 nLanguage )
{ {
MutexGuard aGuard( lcl_GetCharClassMutex() ); MutexGuard aGuard( lcl_GetCharClassMutex() );
@@ -682,7 +682,7 @@ static const sal_uInt32 the_aDigitZeroes [] =
0x0001D7CE //1D7FF ; Decimal # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE 0x0001D7CE //1D7FF ; Decimal # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
}; };
sal_Bool HasDigits( const OUString &rText ) bool HasDigits( const OUString &rText )
{ {
static const int nNumDigitZeroes = sizeof(the_aDigitZeroes) / sizeof(the_aDigitZeroes[0]); static const int nNumDigitZeroes = sizeof(the_aDigitZeroes) / sizeof(the_aDigitZeroes[0]);
const sal_Int32 nLen = rText.getLength(); const sal_Int32 nLen = rText.getLength();
@@ -697,25 +697,25 @@ sal_Bool HasDigits( const OUString &rText )
if (nDigitZero > nCodePoint) if (nDigitZero > nCodePoint)
break; break;
if (/*nDigitZero <= nCodePoint &&*/ nCodePoint <= nDigitZero + 9) if (/*nDigitZero <= nCodePoint &&*/ nCodePoint <= nDigitZero + 9)
return sal_True; return true;
} }
} }
return sal_False; return false;
} }
sal_Bool IsNumeric( const OUString &rText ) bool IsNumeric( const OUString &rText )
{ {
sal_Bool bRes = sal_False; bool bRes = false;
if (!rText.isEmpty()) if (!rText.isEmpty())
{ {
sal_Int32 nLen = rText.getLength(); sal_Int32 nLen = rText.getLength();
bRes = sal_True; bRes = true;
for(sal_Int32 i = 0; i < nLen; ++i) for(sal_Int32 i = 0; i < nLen; ++i)
{ {
sal_Unicode cChar = rText[ i ]; sal_Unicode cChar = rText[ i ];
if ( !((sal_Unicode)'0' <= cChar && cChar <= (sal_Unicode)'9') ) if ( !((sal_Unicode)'0' <= cChar && cChar <= (sal_Unicode)'9') )
{ {
bRes = sal_False; bRes = false;
break; break;
} }
} }

View File

@@ -40,9 +40,9 @@ namespace linguistic
{ {
sal_Bool FileExists( const OUString &rMainURL ) bool FileExists( const OUString &rMainURL )
{ {
sal_Bool bExists = sal_False; bool bExists = false;
if (!rMainURL.isEmpty()) if (!rMainURL.isEmpty())
{ {
try try

View File

@@ -262,13 +262,13 @@ static Reference< XDictionaryEntry > lcl_GetRulingDictionaryEntry(
{ {
Reference< XSearchableDictionaryList > xDList( GetDictionaryList() ); Reference< XSearchableDictionaryList > xDList( GetDictionaryList() );
Reference< XDictionaryEntry > xNegEntry( SearchDicList( xDList, Reference< XDictionaryEntry > xNegEntry( SearchDicList( xDList,
rWord, nLanguage, sal_False, sal_True ) ); rWord, nLanguage, false, true ) );
if (xNegEntry.is()) if (xNegEntry.is())
xRes = xNegEntry; xRes = xNegEntry;
else else
{ {
Reference< XDictionaryEntry > xPosEntry( SearchDicList( xDList, Reference< XDictionaryEntry > xPosEntry( SearchDicList( xDList,
rWord, nLanguage, sal_True, sal_True ) ); rWord, nLanguage, true, true ) );
if (xPosEntry.is()) if (xPosEntry.is())
xRes = xPosEntry; xRes = xPosEntry;
} }
@@ -660,7 +660,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
// replacement text must not be in negative dictionary itself // replacement text must not be in negative dictionary itself
if (!aAddRplcTxt.isEmpty() && if (!aAddRplcTxt.isEmpty() &&
!SearchDicList( xDList, aAddRplcTxt, nLanguage, sal_False, sal_True ).is()) !SearchDicList( xDList, aAddRplcTxt, nLanguage, false, true ).is())
{ {
aProposalList.Prepend( aAddRplcTxt ); aProposalList.Prepend( aAddRplcTxt );
} }

View File

@@ -44,17 +44,17 @@ namespace linguistic
#define MAX_PROPOSALS 40 #define MAX_PROPOSALS 40
sal_Bool SeqHasEntry( bool SeqHasEntry(
const Sequence< OUString > &rSeq, const Sequence< OUString > &rSeq,
const OUString &rTxt) const OUString &rTxt)
{ {
sal_Bool bRes = sal_False; bool bRes = false;
sal_Int32 nLen = rSeq.getLength(); sal_Int32 nLen = rSeq.getLength();
const OUString *pEntry = rSeq.getConstArray(); const OUString *pEntry = rSeq.getConstArray();
for (sal_Int32 i = 0; i < nLen && !bRes; ++i) for (sal_Int32 i = 0; i < nLen && !bRes; ++i)
{ {
if (rTxt == pEntry[i]) if (rTxt == pEntry[i])
bRes = sal_True; bRes = true;
} }
return bRes; return bRes;
} }
@@ -117,7 +117,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq,
for (sal_Int32 i = 0; i < nLen; ++i) for (sal_Int32 i = 0; i < nLen; ++i)
{ {
Reference< XDictionaryEntry > xNegEntry( SearchDicList( rxDicList, Reference< XDictionaryEntry > xNegEntry( SearchDicList( rxDicList,
pEntries[i], nLanguage, sal_False, sal_True ) ); pEntries[i], nLanguage, false, true ) );
if (xNegEntry.is()) if (xNegEntry.is())
{ {
pEntries[i] = aEmpty; pEntries[i] = aEmpty;
@@ -128,7 +128,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq,
{ {
Sequence< OUString > aNew; Sequence< OUString > aNew;
// merge sequence without duplicates and empty strings in new empty sequence // merge sequence without duplicates and empty strings in new empty sequence
aNew = MergeProposalSeqs( aNew, rSeq, sal_False ); aNew = MergeProposalSeqs( aNew, rSeq, false );
rSeq = aNew; rSeq = aNew;
} }
} }
@@ -137,7 +137,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq,
Sequence< OUString > MergeProposalSeqs( Sequence< OUString > MergeProposalSeqs(
Sequence< OUString > &rAlt1, Sequence< OUString > &rAlt1,
Sequence< OUString > &rAlt2, Sequence< OUString > &rAlt2,
sal_Bool bAllowDuplicates ) bool bAllowDuplicates )
{ {
Sequence< OUString > aMerged; Sequence< OUString > aMerged;

View File

@@ -754,7 +754,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
} }
} else { } else {
linguistic::AddEntryToDic( xDictionary, linguistic::AddEntryToDic( xDictionary,
m_xSpellAlt->getWord(), sal_False, OUString(), LANGUAGE_NONE ); m_xSpellAlt->getWord(), false, OUString(), LANGUAGE_NONE );
} }
} }
else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == MN_ADD_TO_DIC_SINGLE) else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == MN_ADD_TO_DIC_SINGLE)
@@ -777,7 +777,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
if (xDic.is()) if (xDic.is())
{ {
sal_Int16 nAddRes = linguistic::AddEntryToDic( xDic, aWord, sal_False, OUString(), LANGUAGE_NONE ); sal_Int16 nAddRes = linguistic::AddEntryToDic( xDic, aWord, false, OUString(), LANGUAGE_NONE );
// save modified user-dictionary if it is persistent // save modified user-dictionary if it is persistent
uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY ); uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
if (xSavDic.is()) if (xSavDic.is())