diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-18 10:06:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-19 21:11:01 +0000 |
commit | 7b6fd204fae7c61e9527412ee3f56b9314f6ad6f (patch) | |
tree | a0cf133e4c1ce3ab271c5c975b75f3094ce8c7ce /linguistic | |
parent | 705e5fe94769415cfca60c73eebb8232464645b2 (diff) |
make workben example build again
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/workben/sprophelp.cxx | 76 | ||||
-rw-r--r-- | linguistic/workben/sprophelp.hxx | 38 | ||||
-rw-r--r-- | linguistic/workben/sspellimp.cxx | 50 | ||||
-rw-r--r-- | linguistic/workben/sspellimp.hxx | 4 |
4 files changed, 84 insertions, 84 deletions
diff --git a/linguistic/workben/sprophelp.cxx b/linguistic/workben/sprophelp.cxx index 62f4b215ecba..2a3977bec40e 100644 --- a/linguistic/workben/sprophelp.cxx +++ b/linguistic/workben/sprophelp.cxx @@ -59,14 +59,14 @@ using ::rtl::OUString; PropertyChgHelper::PropertyChgHelper( const Reference< XInterface > & rxSource, Reference< XPropertySet > &rxPropSet, - const char *pPropNames[], USHORT nPropCount ) : - xMyEvtObj (rxSource), - xPropSet (rxPropSet), - aPropNames (nPropCount), - aLngSvcEvtListeners (GetLinguMutex()) + const char *pPropNames[], sal_uInt16 nPropCount ) + : aPropNames(nPropCount) + , xMyEvtObj(rxSource) + , aLngSvcEvtListeners(GetLinguMutex()) + , xPropSet(rxPropSet) { OUString *pName = aPropNames.getArray(); - for (INT32 i = 0; i < nPropCount; ++i) + for (sal_Int32 i = 0; i < nPropCount; ++i) { pName[i] = ::rtl::OUString::createFromAscii( pPropNames[i] ); } @@ -93,9 +93,9 @@ void PropertyChgHelper::AddAsPropListener() { if (xPropSet.is()) { - INT32 nLen = aPropNames.getLength(); + sal_Int32 nLen = aPropNames.getLength(); const OUString *pPropName = aPropNames.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { if (pPropName[i].getLength()) xPropSet->addPropertyChangeListener( pPropName[i], this ); @@ -107,9 +107,9 @@ void PropertyChgHelper::RemoveAsPropListener() { if (xPropSet.is()) { - INT32 nLen = aPropNames.getLength(); + sal_Int32 nLen = aPropNames.getLength(); const OUString *pPropName = aPropNames.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { if (pPropName[i].getLength()) xPropSet->removePropertyChangeListener( pPropName[i], this ); @@ -150,10 +150,10 @@ sal_Bool SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rxListener.is()) { - INT32 nCount = aLngSvcEvtListeners.getLength(); + sal_Int32 nCount = aLngSvcEvtListeners.getLength(); bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount; } return bRes; @@ -167,10 +167,10 @@ sal_Bool SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rxListener.is()) { - INT32 nCount = aLngSvcEvtListeners.getLength(); + sal_Int32 nCount = aLngSvcEvtListeners.getLength(); bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount; } return bRes; @@ -194,13 +194,13 @@ PropertyHelper_Spell::PropertyHelper_Spell( PropertyChgHelper ( rxSource, rxPropSet, aSP, SAL_N_ELEMENTS(aSP)) { SetDefault(); - INT32 nLen = GetPropNames().getLength(); + sal_Int32 nLen = GetPropNames().getLength(); if (rxPropSet.is() && nLen) { const OUString *pPropName = GetPropNames().getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { - BOOL *pbVal = NULL, + sal_Bool *pbVal = NULL, *pbResVal = NULL; if (A2OU( UPN_IS_GERMAN_PRE_REFORM ) == pPropName[i]) @@ -251,12 +251,12 @@ PropertyHelper_Spell::~PropertyHelper_Spell() void PropertyHelper_Spell::SetDefault() { - bResIsGermanPreReform = bIsGermanPreReform = FALSE; - bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE; - bResIsUseDictionaryList = bIsUseDictionaryList = TRUE; - bResIsSpellUpperCase = bIsSpellUpperCase = FALSE; - bResIsSpellWithDigits = bIsSpellWithDigits = FALSE; - bResIsSpellCapitalization = bIsSpellCapitalization = TRUE; + bResIsGermanPreReform = bIsGermanPreReform = sal_False; + bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = sal_True; + bResIsUseDictionaryList = bIsUseDictionaryList = sal_True; + bResIsSpellUpperCase = bIsSpellUpperCase = sal_False; + bResIsSpellWithDigits = bIsSpellWithDigits = sal_False; + bResIsSpellCapitalization = bIsSpellCapitalization = sal_True; } @@ -268,11 +268,11 @@ void SAL_CALL if (GetPropSet().is() && rEvt.Source == GetPropSet()) { - INT16 nLngSvcFlags = 0; - BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? - bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? + sal_Int16 nLngSvcFlags = 0; + sal_Bool bSCWA = sal_False, // SPELL_CORRECT_WORDS_AGAIN ? + bSWWA = sal_False; // SPELL_WRONG_WORDS_AGAIN ? - BOOL *pbVal = NULL; + sal_Bool *pbVal = NULL; switch (rEvt.PropertyHandle) { case UPH_IS_IGNORE_CONTROL_CHARACTERS : @@ -283,34 +283,34 @@ void SAL_CALL case UPH_IS_GERMAN_PRE_REFORM : { pbVal = &bIsGermanPreReform; - bSCWA = bSWWA = TRUE; + bSCWA = bSWWA = sal_True; break; } case UPH_IS_USE_DICTIONARY_LIST : { pbVal = &bIsUseDictionaryList; - bSCWA = bSWWA = TRUE; + bSCWA = bSWWA = sal_True; break; } case UPH_IS_SPELL_UPPER_CASE : { pbVal = &bIsSpellUpperCase; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = sal_False == *pbVal; // sal_False->sal_True change? + bSWWA = !bSCWA; // sal_True->sal_False change? break; } case UPH_IS_SPELL_WITH_DIGITS : { pbVal = &bIsSpellWithDigits; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = sal_False == *pbVal; // sal_False->sal_True change? + bSWWA = !bSCWA; // sal_True->sal_False change? break; } case UPH_IS_SPELL_CAPITALIZATION : { pbVal = &bIsSpellCapitalization; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = sal_False == *pbVal; // sal_False->sal_True change? + bSWWA = !bSCWA; // sal_True->sal_False change? break; } default: @@ -343,13 +343,13 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) bResIsSpellWithDigits = bIsSpellWithDigits; bResIsSpellCapitalization = bIsSpellCapitalization; - INT32 nLen = rPropVals.getLength(); + sal_Int32 nLen = rPropVals.getLength(); if (nLen) { const PropertyValue *pVal = rPropVals.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { - BOOL *pbResVal = NULL; + sal_Bool *pbResVal = NULL; switch (pVal[i].Handle) { case UPH_IS_GERMAN_PRE_REFORM : pbResVal = &bResIsGermanPreReform; break; diff --git a/linguistic/workben/sprophelp.hxx b/linguistic/workben/sprophelp.hxx index b5cf94f84a48..10c25de0bc63 100644 --- a/linguistic/workben/sprophelp.hxx +++ b/linguistic/workben/sprophelp.hxx @@ -79,7 +79,7 @@ public: PropertyChgHelper( const Reference< XInterface > &rxSource, Reference< XPropertySet > &rxPropSet, - const char *pPropNames[], USHORT nPropCount ); + const char *pPropNames[], sal_uInt16 nPropCount ); virtual ~PropertyChgHelper(); // XEventListener @@ -122,20 +122,20 @@ class PropertyHelper_Spell : public PropertyChgHelper { // default values - BOOL bIsGermanPreReform; - BOOL bIsIgnoreControlCharacters; - BOOL bIsUseDictionaryList; - BOOL bIsSpellUpperCase; - BOOL bIsSpellWithDigits; - BOOL bIsSpellCapitalization; + sal_Bool bIsGermanPreReform; + sal_Bool bIsIgnoreControlCharacters; + sal_Bool bIsUseDictionaryList; + sal_Bool bIsSpellUpperCase; + sal_Bool bIsSpellWithDigits; + sal_Bool bIsSpellCapitalization; // return values, will be set to default value or current temporary value - BOOL bResIsGermanPreReform; - BOOL bResIsIgnoreControlCharacters; - BOOL bResIsUseDictionaryList; - BOOL bResIsSpellUpperCase; - BOOL bResIsSpellWithDigits; - BOOL bResIsSpellCapitalization; + sal_Bool bResIsGermanPreReform; + sal_Bool bResIsIgnoreControlCharacters; + sal_Bool bResIsUseDictionaryList; + sal_Bool bResIsSpellUpperCase; + sal_Bool bResIsSpellWithDigits; + sal_Bool bResIsSpellCapitalization; // disallow use of copy-constructor and assignment-operator @@ -157,12 +157,12 @@ public: void SetTmpPropVals( const PropertyValues &rPropVals ); - BOOL IsGermanPreReform() const { return bResIsGermanPreReform; } - BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } - BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } - BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } - BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } - BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } + sal_Bool IsGermanPreReform() const { return bResIsGermanPreReform; } + sal_Bool IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } + sal_Bool IsUseDictionaryList() const { return bResIsUseDictionaryList; } + sal_Bool IsSpellUpperCase() const { return bResIsSpellUpperCase; } + sal_Bool IsSpellWithDigits() const { return bResIsSpellWithDigits; } + sal_Bool IsSpellCapitalization() const { return bResIsSpellCapitalization; } }; diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx index aa3c8d2ec5d3..d051bd3ee9c9 100644 --- a/linguistic/workben/sspellimp.cxx +++ b/linguistic/workben/sspellimp.cxx @@ -54,7 +54,7 @@ using namespace linguistic; using ::rtl::OUString; -BOOL operator == ( const Locale &rL1, const Locale &rL2 ) +sal_Bool operator == ( const Locale &rL1, const Locale &rL2 ) { return rL1.Language == rL2.Language && rL1.Country == rL2.Country && @@ -66,7 +66,7 @@ BOOL operator == ( const Locale &rL1, const Locale &rL2 ) SpellChecker::SpellChecker() : aEvtListeners ( GetLinguMutex() ) { - bDisposing = FALSE; + bDisposing = sal_False; pPropHelper = NULL; } @@ -115,16 +115,16 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!aSuppLocales.getLength()) getLocales(); - INT32 nLen = aSuppLocales.getLength(); - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nLen = aSuppLocales.getLength(); + for (sal_Int32 i = 0; i < nLen; ++i) { const Locale *pLocale = aSuppLocales.getConstArray(); if (rLocale == pLocale[i]) { - bRes = TRUE; + bRes = sal_True; break; } } @@ -132,7 +132,7 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) } -INT16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocale ) +sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale & ) { // Checks wether a word is OK in a given language (Locale) or not, and // provides a failure type for the incorrect ones. @@ -141,7 +141,7 @@ INT16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocal // - words with 's' or 'S' as first letter will have the wrong caption. // - all other words will be OK. - INT16 nRes = -1; + sal_Int16 nRes = -1; String aTmp( rWord ); if (aTmp.Len()) @@ -175,13 +175,13 @@ sal_Bool SAL_CALL MutexGuard aGuard( GetLinguMutex() ); if (rLocale == Locale() || !rWord.getLength()) - return TRUE; + return sal_True; if (!hasLocale( rLocale )) #ifdef LINGU_EXCEPTIONS throw( IllegalArgumentException() ); #else - return TRUE; + return sal_True; #endif // Get property values to be used. @@ -193,10 +193,10 @@ sal_Bool SAL_CALL PropertyHelper_Spell &rHelper = GetPropHelper(); rHelper.SetTmpPropVals( rProperties ); - INT16 nFailure = GetSpellFailure( rWord, rLocale ); + sal_Int16 nFailure = GetSpellFailure( rWord, rLocale ); if (nFailure != -1) { - INT16 nLang = LocaleToLanguage( rLocale ); + sal_Int16 nLang = LocaleToLanguage( rLocale ); // postprocess result for errors that should be ignored if ( (!rHelper.IsSpellUpperCase() && IsUpper( rWord, nLang )) || (!rHelper.IsSpellWithDigits() && HasDigits( rWord )) @@ -225,13 +225,13 @@ Reference< XSpellAlternatives > String aTmp( rWord ); if (aTmp.Len()) { - INT16 nLang = LocaleToLanguage( rLocale ); + sal_Int16 nLang = LocaleToLanguage( rLocale ); if (STRING_NOTFOUND != aTmp.SearchAscii( "liss" )) { aTmp.SearchAndReplaceAllAscii( "liss", A2OU("liz") ); xRes = new SpellAlternatives( aTmp, nLang, - SpellFailure::IS_NEGATIVE_WORD, aTmp ); + SpellFailure::IS_NEGATIVE_WORD, ::com::sun::star::uno::Sequence< ::rtl::OUString >() ); } else if (STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'x' ) || STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'X' )) @@ -263,7 +263,7 @@ Reference< XSpellAlternatives > (sal_Unicode) 'S': (sal_Unicode) 's'; aTmp.GetBufferAccess()[0] = cNewChar; xRes = new SpellAlternatives( aTmp, nLang, - SpellFailure::CAPTION_ERROR, aTmp ); + SpellFailure::CAPTION_ERROR, ::com::sun::star::uno::Sequence< ::rtl::OUString >() ); } } } @@ -299,7 +299,7 @@ Reference< XSpellAlternatives > SAL_CALL Reference< XInterface > SAL_CALL SpellChecker_CreateInstance( - const Reference< XMultiServiceFactory > & rSMgr ) + const Reference< XMultiServiceFactory > & ) throw(Exception) { Reference< XInterface > xService = (cppu::OWeakObject*) new SpellChecker; @@ -314,7 +314,7 @@ sal_Bool SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!bDisposing && rxLstnr.is()) { bRes = GetPropHelper().addLinguServiceEventListener( rxLstnr ); @@ -330,7 +330,7 @@ sal_Bool SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!bDisposing && rxLstnr.is()) { DBG_ASSERT( xPropHelper.is(), "xPropHelper non existent" ); @@ -341,7 +341,7 @@ sal_Bool SAL_CALL OUString SAL_CALL - SpellChecker::getServiceDisplayName( const Locale& rLocale ) + SpellChecker::getServiceDisplayName( const Locale& ) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -357,7 +357,7 @@ void SAL_CALL if (!pPropHelper) { - INT32 nLen = rArguments.getLength(); + sal_Int32 nLen = rArguments.getLength(); if (2 == nLen) { Reference< XPropertySet > xPropSet; @@ -385,7 +385,7 @@ void SAL_CALL if (!bDisposing) { - bDisposing = TRUE; + bDisposing = sal_True; EventObject aEvtObj( (XSpellChecker *) this ); aEvtListeners.disposeAndClear( aEvtObj ); } @@ -431,10 +431,10 @@ sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName ) Sequence< OUString > aSNL = getSupportedServiceNames(); const OUString * pArray = aSNL.getConstArray(); - for( INT32 i = 0; i < aSNL.getLength(); i++ ) + for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) if( pArray[i] == ServiceName ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } @@ -469,7 +469,7 @@ sal_Bool SAL_CALL SpellChecker_writeInfo( pRegistryKey->createKey( aImpl ); Sequence< OUString > aServices = SpellChecker::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) + for( sal_Int32 i = 0; i < aServices.getLength(); i++ ) xNewKey->createKey( aServices.getConstArray()[i] ); return sal_True; diff --git a/linguistic/workben/sspellimp.hxx b/linguistic/workben/sspellimp.hxx index bc85186a07d0..5e839b446a10 100644 --- a/linguistic/workben/sspellimp.hxx +++ b/linguistic/workben/sspellimp.hxx @@ -69,7 +69,7 @@ class SpellChecker : ::cppu::OInterfaceContainerHelper aEvtListeners; Reference< XPropertyChangeListener > xPropHelper; PropertyHelper_Spell * pPropHelper; - BOOL bDisposing; + sal_Bool bDisposing; // disallow copy-constructor and assignment-operator for now SpellChecker(const SpellChecker &); @@ -81,7 +81,7 @@ class SpellChecker : return pPropHelper ? *pPropHelper : GetPropHelper_Impl(); } - INT16 GetSpellFailure( const OUString &rWord, const Locale &rLocale ); + sal_Int16 GetSpellFailure( const OUString &rWord, const Locale &rLocale ); Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale ); |