diff options
author | Mathias Bauer <mba@openoffice.org> | 2011-02-08 11:49:29 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2011-02-08 11:49:29 +0100 |
commit | 40953e8bab7710063353f70ffd4d66a4782b5425 (patch) | |
tree | 7575a84f0d2e6a7110e64b45d999dff045b23d3f /linguistic/source | |
parent | b31ae53bd29953d09dbda1e37e3ec8aeec81807b (diff) | |
parent | 642c1ee8fac66996d2c500c5e247d17c198c6405 (diff) |
CWS gnumake3: pull in cws removetooltypes01
Diffstat (limited to 'linguistic/source')
30 files changed, 723 insertions, 723 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index e7c52b500817..2f2fa78b8f72 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -110,7 +110,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xIn ) ); - ULONG nError = sal::static_int_cast< ULONG >(-1); + sal_uLong nError = sal::static_int_cast< sal_uLong >(-1); // prepare ParserInputSource xml::sax::InputSource aParserInput; @@ -162,9 +162,9 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) } } -BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) +sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rFileURL.Len() == 0) return bRes; @@ -205,9 +205,9 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) ConvDic::ConvDic( const String &rName, - INT16 nLang, + sal_Int16 nLang, sal_Int16 nConvType, - BOOL bBiDirectional, + sal_Bool bBiDirectional, const String &rMainURL) : aFlushListeners( GetLinguMutex() ) { @@ -222,30 +222,30 @@ ConvDic::ConvDic( pConvPropType = std::auto_ptr< PropTypeMap >( new PropTypeMap ); nMaxLeftCharCount = nMaxRightCharCount = 0; - bMaxCharCountIsValid = TRUE; + bMaxCharCountIsValid = sal_True; - bNeedEntries = TRUE; - bIsModified = bIsActive = FALSE; - bIsReadonly = FALSE; + bNeedEntries = sal_True; + bIsModified = bIsActive = sal_False; + bIsReadonly = sal_False; if( rMainURL.Len() > 0 ) { - BOOL bExists = FALSE; + sal_Bool bExists = sal_False; bIsReadonly = IsReadOnly( rMainURL, &bExists ); if( !bExists ) // new empty dictionary { - bNeedEntries = FALSE; + bNeedEntries = sal_False; //! create physical representation of an **empty** dictionary //! that could be found by the dictionary-list implementation // (Note: empty dictionaries are not just empty files!) Save(); - bIsReadonly = IsReadOnly( rMainURL ); // will be FALSE if Save was succesfull + bIsReadonly = IsReadOnly( rMainURL ); // will be sal_False if Save was succesfull } } else { - bNeedEntries = FALSE; + bNeedEntries = sal_False; } } @@ -260,12 +260,12 @@ void ConvDic::Load() DBG_ASSERT( !bIsModified, "dictionary is modified. Really do 'Load'?" ); //!! prevent function from being called recursively via HasEntry, AddEntry - bNeedEntries = FALSE; + bNeedEntries = sal_False; ConvDicXMLImport *pImport = new ConvDicXMLImport( this, aMainURL ); //!! keep a first reference to ensure the lifetime of the object !! uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY ); ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries - bIsModified = FALSE; + bIsModified = sal_False; } @@ -326,7 +326,7 @@ void ConvDic::Save() sal_Bool bRet = pExport->Export(); // write entries to file DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); if (bRet) - bIsModified = FALSE; + bIsModified = sal_False; } DBG_ASSERT( !bIsModified, "dictionary still modified after save. Save failed?" ); } @@ -348,7 +348,7 @@ ConvMap::iterator ConvDic::GetEntry( ConvMap &rMap, const rtl::OUString &rFirstT } -BOOL ConvDic::HasEntry( const OUString &rLeftText, const OUString &rRightText ) +sal_Bool ConvDic::HasEntry( const OUString &rLeftText, const OUString &rRightText ) { if (bNeedEntries) Load(); @@ -375,7 +375,7 @@ void ConvDic::AddEntry( const OUString &rLeftText, const OUString &rRightText ) nMaxRightCharCount = (sal_Int16) rRightText.getLength(); } - bIsModified = TRUE; + bIsModified = sal_True; } @@ -395,8 +395,8 @@ void ConvDic::RemoveEntry( const OUString &rLeftText, const OUString &rRightText pFromRight->erase( aRightIt ); } - bIsModified = TRUE; - bMaxCharCountIsValid = FALSE; + bIsModified = sal_True; + bMaxCharCountIsValid = sal_False; } @@ -447,11 +447,11 @@ void SAL_CALL ConvDic::clear( ) aFromLeft .clear(); if (pFromRight.get()) pFromRight->clear(); - bNeedEntries = FALSE; - bIsModified = TRUE; + bNeedEntries = sal_False; + bIsModified = sal_True; nMaxLeftCharCount = 0; nMaxRightCharCount = 0; - bMaxCharCountIsValid = TRUE; + bMaxCharCountIsValid = sal_True; } @@ -477,14 +477,14 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( pair< ConvMap::iterator, ConvMap::iterator > aRange = rConvMap.equal_range( aLookUpText ); - INT32 nCount = 0; + sal_Int32 nCount = 0; ConvMap::iterator aIt; for (aIt = aRange.first; aIt != aRange.second; ++aIt) ++nCount; uno::Sequence< OUString > aRes( nCount ); OUString *pRes = aRes.getArray(); - INT32 i = 0; + sal_Int32 i = 0; for (aIt = aRange.first; aIt != aRange.second; ++aIt) pRes[i++] = (*aIt).second; @@ -492,19 +492,19 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( } -static BOOL lcl_SeqHasEntry( +static sal_Bool lcl_SeqHasEntry( const OUString *pSeqStart, // first element to check - INT32 nToCheck, // number of elements to check + sal_Int32 nToCheck, // number of elements to check const OUString &rText) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (pSeqStart && nToCheck > 0) { const OUString *pDone = pSeqStart + nToCheck; // one behind last to check while (!bRes && pSeqStart != pDone) { if (*pSeqStart++ == rText) - bRes = TRUE; + bRes = sal_True; } } return bRes; @@ -527,7 +527,7 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( uno::Sequence< OUString > aRes( rConvMap.size() ); OUString *pRes = aRes.getArray(); ConvMap::iterator aIt = rConvMap.begin(); - INT32 nIdx = 0; + sal_Int32 nIdx = 0; while (aIt != rConvMap.end()) { OUString aCurEntry( (*aIt).first ); @@ -612,7 +612,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) } } - bMaxCharCountIsValid = TRUE; + bMaxCharCountIsValid = sal_True; } sal_Int16 nRes = eDirection == ConversionDirection_FROM_LEFT ? nMaxLeftCharCount : nMaxRightCharCount; diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx index 983b06704653..77346927df9b 100644 --- a/linguistic/source/convdic.hxx +++ b/linguistic/source/convdic.hxx @@ -52,7 +52,7 @@ class SvStream; /////////////////////////////////////////////////////////////////////////// -BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ); +sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType ); /////////////////////////////////////////////////////////////////////////// @@ -104,15 +104,15 @@ protected: String aMainURL; // URL to file rtl::OUString aName; - INT16 nLanguage; + sal_Int16 nLanguage; sal_Int16 nConversionType; sal_Int16 nMaxLeftCharCount; sal_Int16 nMaxRightCharCount; - BOOL bMaxCharCountIsValid; - BOOL bNeedEntries; - BOOL bIsModified; - BOOL bIsActive; - BOOL bIsReadonly; + sal_Bool bMaxCharCountIsValid; + sal_Bool bNeedEntries; + sal_Bool bIsModified; + sal_Bool bIsActive; + sal_Bool bIsReadonly; // disallow copy-constructor and assignment-operator for now ConvDic(const ConvDic &); @@ -124,9 +124,9 @@ protected: public: ConvDic( const String &rName, - INT16 nLanguage, + sal_Int16 nLanguage, sal_Int16 nConversionType, - BOOL bBiDirectional, + sal_Bool bBiDirectional, const String &rMainURL); virtual ~ConvDic(); @@ -163,7 +163,7 @@ public: static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); - BOOL HasEntry( const rtl::OUString &rLeftText, const rtl::OUString &rRightText ); + sal_Bool HasEntry( const rtl::OUString &rLeftText, const rtl::OUString &rRightText ); void AddEntry( const rtl::OUString &rLeftText, const rtl::OUString &rRightText ); void RemoveEntry( const rtl::OUString &rLeftText, const rtl::OUString &rRightText ); }; diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 7f4dc8a913a0..f1af7ea597df 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -113,7 +113,7 @@ class ConvDicNameContainer : ConvDicNameContainer(const ConvDicNameContainer &); ConvDicNameContainer & operator = (const ConvDicNameContainer &); - INT32 GetIndexByName_Impl( const OUString& rName ); + sal_Int32 GetIndexByName_Impl( const OUString& rName ); public: ConvDicNameContainer( ConvDicList &rMyConvDicList ); @@ -143,10 +143,10 @@ public: // calls Flush for the dictionaries that support XFlushable void FlushDics() const; - INT32 GetCount() const { return aConvDics.getLength(); } + sal_Int32 GetCount() const { return aConvDics.getLength(); } uno::Reference< XConversionDictionary > GetByName( const OUString& rName ); - const uno::Reference< XConversionDictionary > GetByIndex( INT32 nIdx ) + const uno::Reference< XConversionDictionary > GetByIndex( sal_Int32 nIdx ) { return aConvDics.getConstArray()[nIdx]; } @@ -166,9 +166,9 @@ ConvDicNameContainer::~ConvDicNameContainer() void ConvDicNameContainer::FlushDics() const { - INT32 nLen = aConvDics.getLength(); + sal_Int32 nLen = aConvDics.getLength(); const uno::Reference< XConversionDictionary > *pDic = aConvDics.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Reference< util::XFlushable > xFlush( pDic[i] , UNO_QUERY ); if (xFlush.is()) @@ -186,13 +186,13 @@ void ConvDicNameContainer::FlushDics() const } -INT32 ConvDicNameContainer::GetIndexByName_Impl( +sal_Int32 ConvDicNameContainer::GetIndexByName_Impl( const OUString& rName ) { - INT32 nRes = -1; - INT32 nLen = aConvDics.getLength(); + sal_Int32 nRes = -1; + sal_Int32 nLen = aConvDics.getLength(); const uno::Reference< XConversionDictionary > *pDic = aConvDics.getConstArray(); - for (INT32 i = 0; i < nLen && nRes == -1; ++i) + for (sal_Int32 i = 0; i < nLen && nRes == -1; ++i) { if (rName == pDic[i]->getName()) nRes = i; @@ -205,7 +205,7 @@ uno::Reference< XConversionDictionary > ConvDicNameContainer::GetByName( const OUString& rName ) { uno::Reference< XConversionDictionary > xRes; - INT32 nIdx = GetIndexByName_Impl( rName ); + sal_Int32 nIdx = GetIndexByName_Impl( rName ); if ( nIdx != -1) xRes = aConvDics.getArray()[nIdx]; return xRes; @@ -244,11 +244,11 @@ uno::Sequence< OUString > SAL_CALL ConvDicNameContainer::getElementNames( ) { MutexGuard aGuard( GetLinguMutex() ); - INT32 nLen = aConvDics.getLength(); + sal_Int32 nLen = aConvDics.getLength(); uno::Sequence< OUString > aRes( nLen ); OUString *pName = aRes.getArray(); const uno::Reference< XConversionDictionary > *pDic = aConvDics.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) pName[i] = pDic[i]->getName(); return aRes; } @@ -269,7 +269,7 @@ void SAL_CALL ConvDicNameContainer::replaceByName( { MutexGuard aGuard( GetLinguMutex() ); - INT32 nRplcIdx = GetIndexByName_Impl( rName ); + sal_Int32 nRplcIdx = GetIndexByName_Impl( rName ); if (nRplcIdx == -1) throw NoSuchElementException(); uno::Reference< XConversionDictionary > xNew; @@ -294,7 +294,7 @@ void SAL_CALL ConvDicNameContainer::insertByName( if (!xNew.is() || xNew->getName() != rName) throw IllegalArgumentException(); - INT32 nLen = aConvDics.getLength(); + sal_Int32 nLen = aConvDics.getLength(); aConvDics.realloc( nLen + 1 ); aConvDics.getArray()[ nLen ] = xNew; } @@ -305,7 +305,7 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) { MutexGuard aGuard( GetLinguMutex() ); - INT32 nRplcIdx = GetIndexByName_Impl( rName ); + sal_Int32 nRplcIdx = GetIndexByName_Impl( rName ); if (nRplcIdx == -1) throw NoSuchElementException(); @@ -333,9 +333,9 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) } } - INT32 nLen = aConvDics.getLength(); + sal_Int32 nLen = aConvDics.getLength(); uno::Reference< XConversionDictionary > *pDic = aConvDics.getArray(); - for (INT32 i = nRplcIdx; i < nLen - 1; ++i) + for (sal_Int32 i = nRplcIdx; i < nLen - 1; ++i) pDic[i] = pDic[i + 1]; aConvDics.realloc( nLen - 1 ); } @@ -346,11 +346,11 @@ void ConvDicNameContainer::AddConvDics( const String &rExtension ) { const Sequence< OUString > aDirCnt( - utl::LocalFileHelper::GetFolderContents( rSearchDirPathURL, FALSE ) ); + utl::LocalFileHelper::GetFolderContents( rSearchDirPathURL, sal_False ) ); const OUString *pDirCnt = aDirCnt.getConstArray(); - INT32 nEntries = aDirCnt.getLength(); + sal_Int32 nEntries = aDirCnt.getLength(); - for (INT32 i = 0; i < nEntries; ++i) + for (sal_Int32 i = 0; i < nEntries; ++i) { String aURL( pDirCnt[i] ); @@ -362,7 +362,7 @@ void ConvDicNameContainer::AddConvDics( if(aExt != aSearchExt) continue; // skip other files - INT16 nLang; + sal_Int16 nLang; sal_Int16 nConvType; if (IsConvDic( aURL, nLang, nConvType )) { @@ -381,7 +381,7 @@ void ConvDicNameContainer::AddConvDics( else if ((nLang == LANGUAGE_CHINESE_SIMPLIFIED || nLang == LANGUAGE_CHINESE_TRADITIONAL) && nConvType == ConversionDictionaryType::SCHINESE_TCHINESE) { - xDic = new ConvDic( aDicName, nLang, nConvType, FALSE, aURL ); + xDic = new ConvDic( aDicName, nLang, nConvType, sal_False, aURL ); } if (xDic.is()) @@ -417,7 +417,7 @@ ConvDicList::ConvDicList() : aEvtListeners( GetLinguMutex() ) { pNameContainer = 0; - bDisposing = FALSE; + bDisposing = sal_False; pExitListener = new MyAppExitListener( *this ); xExitListener = pExitListener; @@ -459,9 +459,9 @@ ConvDicNameContainer & ConvDicList::GetNameContainer() // access list of text conversion dictionaries to activate SvtLinguOptions aOpt; SvtLinguConfig().GetOptions( aOpt ); - INT32 nLen = aOpt.aActiveConvDics.getLength(); + sal_Int32 nLen = aOpt.aActiveConvDics.getLength(); const OUString *pActiveConvDics = aOpt.aActiveConvDics.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Reference< XConversionDictionary > xDic = pNameContainer->GetByName( pActiveConvDics[i] ); @@ -502,7 +502,7 @@ uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary( { MutexGuard aGuard( GetLinguMutex() ); - INT16 nLang = LocaleToLanguage( rLocale ); + sal_Int16 nLang = LocaleToLanguage( rLocale ); if (GetNameContainer().hasByName( rName )) throw ElementExistException(); @@ -517,7 +517,7 @@ uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary( else if ((nLang == LANGUAGE_CHINESE_SIMPLIFIED || nLang == LANGUAGE_CHINESE_TRADITIONAL) && nConvDicType == ConversionDictionaryType::SCHINESE_TCHINESE) { - xRes = new ConvDic( rName, nLang, nConvDicType, FALSE, aDicMainURL ); + xRes = new ConvDic( rName, nLang, nConvDicType, sal_False, aDicMainURL ); } if (!xRes.is()) @@ -545,15 +545,15 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions( { MutexGuard aGuard( GetLinguMutex() ); - /*INT16 nLang = LocaleToLanguage( rLocale );*/ + /*sal_Int16 nLang = LocaleToLanguage( rLocale );*/ - INT32 nCount = 0; + sal_Int32 nCount = 0; uno::Sequence< OUString > aRes( 20 ); OUString *pRes = aRes.getArray(); sal_Bool bSupported = sal_False; - INT32 nLen = GetNameContainer().GetCount(); - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nLen = GetNameContainer().GetCount(); + for (sal_Int32 i = 0; i < nLen; ++i) { const uno::Reference< XConversionDictionary > xDic( GetNameContainer().GetByIndex(i) ); sal_Bool bMatch = xDic.is() && @@ -565,7 +565,7 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions( Sequence< OUString > aNewConv( xDic->getConversions( rText, nStartPos, nLength, eDirection, nTextConversionOptions ) ); - INT32 nNewLen = aNewConv.getLength(); + sal_Int32 nNewLen = aNewConv.getLength(); if (nNewLen > 0) { if (nCount + nNewLen > aRes.getLength()) @@ -574,7 +574,7 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions( pRes = aRes.getArray(); } const OUString *pNewConv = aNewConv.getConstArray(); - for (INT32 k = 0; k < nNewLen; ++k) + for (sal_Int32 k = 0; k < nNewLen; ++k) pRes[nCount++] = pNewConv[k]; } } @@ -598,8 +598,8 @@ sal_Int16 SAL_CALL ConvDicList::queryMaxCharCount( sal_Int16 nRes = 0; GetNameContainer(); - INT32 nLen = GetNameContainer().GetCount(); - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nLen = GetNameContainer().GetCount(); + for (sal_Int32 i = 0; i < nLen; ++i) { const uno::Reference< XConversionDictionary > xDic( GetNameContainer().GetByIndex(i) ); if (xDic.is() && @@ -621,7 +621,7 @@ void SAL_CALL ConvDicList::dispose( ) MutexGuard aGuard( GetLinguMutex() ); if (!bDisposing) { - bDisposing = TRUE; + bDisposing = sal_True; EventObject aEvtObj( (XConversionDictionaryList *) this ); aEvtListeners.disposeAndClear( aEvtObj ); diff --git a/linguistic/source/convdiclist.hxx b/linguistic/source/convdiclist.hxx index dec9103d1d51..206f88bf1c22 100644 --- a/linguistic/source/convdiclist.hxx +++ b/linguistic/source/convdiclist.hxx @@ -73,7 +73,7 @@ class ConvDicList : ::com::sun::star::uno::Reference< ::com::sun::star::frame:: XTerminateListener > xExitListener; - BOOL bDisposing; + sal_Bool bDisposing; // disallow copy-constructor and assignment-operator for now ConvDicList( const ConvDicList & ); diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index 30ced3ca02cb..64e6f7a071bd 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -129,7 +129,7 @@ public: class ConvDicXMLDictionaryContext_Impl : public ConvDicXMLImportContext { - INT16 nLanguage; + sal_Int16 nLanguage; sal_Int16 nConversionType; public: @@ -145,7 +145,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &rxAttrList ); - INT16 GetLanguage() const { return nLanguage; } + sal_Int16 GetLanguage() const { return nLanguage; } sal_Int16 GetConversionType() const { return nConversionType; } }; diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index d005d51a4b28..edf5ebe104d1 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -89,7 +89,7 @@ class ConvDicXMLImport : public SvXMLImport // but the language and conversion type will // still be determined! - INT16 nLanguage; // language of the dictionary + sal_Int16 nLanguage; // language of the dictionary sal_Int16 nConversionType; // conversion type the dictionary is used for sal_Bool bSuccess; @@ -120,11 +120,11 @@ public: const com::sun::star::uno::Reference < com::sun::star::xml::sax::XAttributeList > &rxAttrList ); ConvDic * GetDic() { return pDic; } - INT16 GetLanguage() const { return nLanguage; } + sal_Int16 GetLanguage() const { return nLanguage; } sal_Int16 GetConversionType() const { return nConversionType; } sal_Bool GetSuccess() const { return bSuccess; } - void SetLanguage( INT16 nLang ) { nLanguage = nLang; } + void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; } void SetConversionType( sal_Int16 nType ) { nConversionType = nType; } }; diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 01c6838a4d3d..05924609384f 100755 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -74,32 +74,32 @@ static const sal_Char* pVerStr5 = "WBSWG5"; static const sal_Char* pVerStr6 = "WBSWG6"; static const sal_Char* pVerOOo7 = "OOoUserDict1"; -static const INT16 DIC_VERSION_DONTKNOW = -1; -static const INT16 DIC_VERSION_2 = 2; -static const INT16 DIC_VERSION_5 = 5; -static const INT16 DIC_VERSION_6 = 6; -static const INT16 DIC_VERSION_7 = 7; +static const sal_Int16 DIC_VERSION_DONTKNOW = -1; +static const sal_Int16 DIC_VERSION_2 = 2; +static const sal_Int16 DIC_VERSION_5 = 5; +static const sal_Int16 DIC_VERSION_6 = 6; +static const sal_Int16 DIC_VERSION_7 = 7; static sal_Bool getTag(const ByteString &rLine, const sal_Char *pTagName, ByteString &rTagValue) { xub_StrLen nPos = rLine.Search( pTagName ); if (nPos == STRING_NOTFOUND) - return FALSE; + return sal_False; rTagValue = rLine.Copy( nPos + sal::static_int_cast< xub_StrLen >(strlen( pTagName )) ).EraseLeadingAndTrailingChars(); - return TRUE; + return sal_True; } -INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) +sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNeg ) { // Sniff the header - INT16 nDicVersion = DIC_VERSION_DONTKNOW; + sal_Int16 nDicVersion = DIC_VERSION_DONTKNOW; sal_Char pMagicHeader[MAX_HEADER_LENGTH]; nLng = LANGUAGE_NONE; - bNeg = FALSE; + bNeg = sal_False; if (!rpStream.get() || rpStream->GetError()) return -1; @@ -140,9 +140,9 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) if (getTag(aLine, "type: ", aTagValue)) { if (aTagValue == "negative") - bNeg = TRUE; + bNeg = sal_True; else - bNeg = FALSE; + bNeg = sal_False; } if (aLine.Search ("---") != STRING_NOTFOUND) // end of header @@ -153,7 +153,7 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) } else { - USHORT nLen; + sal_uInt16 nLen; rpStream->Seek (nSniffPos ); @@ -187,7 +187,7 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) // Negative Flag sal_Char nTmp; *rpStream >> nTmp; - bNeg = (BOOL)nTmp; + bNeg = (sal_Bool)nTmp; } } @@ -210,15 +210,15 @@ DictionaryNeo::DictionaryNeo() : { nCount = 0; nDicVersion = DIC_VERSION_DONTKNOW; - bNeedEntries = FALSE; - bIsModified = bIsActive = FALSE; - bIsReadonly = FALSE; + bNeedEntries = sal_False; + bIsModified = bIsActive = sal_False; + bIsReadonly = sal_False; } DictionaryNeo::DictionaryNeo(const OUString &rName, - INT16 nLang, DictionaryType eType, + sal_Int16 nLang, DictionaryType eType, const OUString &rMainURL, - BOOL bWriteable) : + sal_Bool bWriteable) : aDicEvtListeners( GetLinguMutex() ), aDicName (rName), aMainURL (rMainURL), @@ -227,13 +227,13 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, { nCount = 0; nDicVersion = DIC_VERSION_DONTKNOW; - bNeedEntries = TRUE; - bIsModified = bIsActive = FALSE; + bNeedEntries = sal_True; + bIsModified = bIsActive = sal_False; bIsReadonly = !bWriteable; if( rMainURL.getLength() > 0 ) { - BOOL bExists = FileExists( rMainURL ); + sal_Bool bExists = FileExists( rMainURL ); if( !bExists ) { // save new dictionaries with in Format 7 (UTF8 plain text) @@ -246,14 +246,14 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, "DictionaryNeo: dictionaries should be writeable if they are to be saved" ); if (!bIsReadonly) saveEntries( rMainURL ); - bNeedEntries = FALSE; + bNeedEntries = sal_False; } } else { // non persistent dictionaries (like IgnoreAllList) should always be writable - bIsReadonly = FALSE; - bNeedEntries = FALSE; + bIsReadonly = sal_False; + bNeedEntries = sal_False; } } @@ -261,16 +261,16 @@ DictionaryNeo::~DictionaryNeo() { } -ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) +sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) { MutexGuard aGuard( GetLinguMutex() ); - // counter check that it is safe to set bIsModified to FALSE at + // counter check that it is safe to set bIsModified to sal_False at // the end of the function DBG_ASSERT(!bIsModified, "lng : dictionary already modified!"); // function should only be called once in order to load entries from file - bNeedEntries = FALSE; + bNeedEntries = sal_False; if (rMainURL.getLength() == 0) return 0; @@ -291,15 +291,15 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) (void) e; } if (!xStream.is()) - return static_cast< ULONG >(-1); + return static_cast< sal_uLong >(-1); SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - ULONG nErr = sal::static_int_cast< ULONG >(-1); + sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1); // Header einlesen - BOOL bNegativ; - USHORT nLang; + sal_Bool bNegativ; + sal_uInt16 nLang; nDicVersion = ReadDicVersion(pStream, nLang, bNegativ); if (0 != (nErr = pStream->GetError())) return nErr; @@ -317,7 +317,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) DIC_VERSION_5 == nDicVersion || DIC_VERSION_2 == nDicVersion) { - USHORT nLen = 0; + sal_uInt16 nLen = 0; sal_Char aWordBuf[ BUFSIZE ]; // Das erste Wort einlesen @@ -345,7 +345,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) String aText( aDummy, eEnc ); uno::Reference< XDictionaryEntry > xEntry = new DicEntry( aText, bNegativ ); - addEntry_Impl( xEntry , TRUE ); //! don't launch events here + addEntry_Impl( xEntry , sal_True ); //! don't launch events here } *pStream >> nLen; @@ -382,7 +382,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) rtl::OUString aText = rtl::OStringToOUString (aLine, RTL_TEXTENCODING_UTF8); uno::Reference< XDictionaryEntry > xEntry = new DicEntry( aText, eDicType == DictionaryType_NEGATIVE ); - addEntry_Impl( xEntry , TRUE ); //! don't launch events here + addEntry_Impl( xEntry , sal_True ); //! don't launch events here } } @@ -391,7 +391,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) // since this routine should be called only initialy (prior to any // modification to be saved) we reset the bIsModified flag here that // was implicitly set by addEntry_Impl - bIsModified = FALSE; + bIsModified = sal_False; return pStream->GetError(); } @@ -411,7 +411,7 @@ static ByteString formatForSave( } -ULONG DictionaryNeo::saveEntries(const OUString &rURL) +sal_uLong DictionaryNeo::saveEntries(const OUString &rURL) { MutexGuard aGuard( GetLinguMutex() ); @@ -435,10 +435,10 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) (void) e; } if (!xStream.is()) - return static_cast< ULONG >(-1); + return static_cast< sal_uLong >(-1); SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - ULONG nErr = sal::static_int_cast< ULONG >(-1); + sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1); // // Always write as the latest version, i.e. DIC_VERSION_7 @@ -467,7 +467,7 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) if (0 != (nErr = pStream->GetError())) return nErr; const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - for (INT32 i = 0; i < nCount; i++) + for (sal_Int32 i = 0; i < nCount; i++) { ByteString aOutStr = formatForSave(pEntry[i], eEnc); pStream->WriteLine (aOutStr); @@ -482,7 +482,7 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) return nErr; } -void DictionaryNeo::launchEvent(INT16 nEvent, +void DictionaryNeo::launchEvent(sal_Int16 nEvent, uno::Reference< XDictionaryEntry > xEntry) { MutexGuard aGuard( GetLinguMutex() ); @@ -503,7 +503,7 @@ void DictionaryNeo::launchEvent(INT16 nEvent, int DictionaryNeo::cmpDicEntry(const OUString& rWord1, const OUString &rWord2, - BOOL bSimilarOnly) + sal_Bool bSimilarOnly) { MutexGuard aGuard( GetLinguMutex() ); @@ -515,7 +515,7 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1, OUString aWord1( rWord1 ), aWord2( rWord2 ); - INT32 nLen1 = aWord1.getLength(), + sal_Int32 nLen1 = aWord1.getLength(), nLen2 = aWord2.getLength(); if (bSimilarOnly) { @@ -527,7 +527,7 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1, } const sal_Unicode cIgnChar = '='; - INT32 nIdx1 = 0, + sal_Int32 nIdx1 = 0, nIdx2 = 0, nNumIgnChar1 = 0, nNumIgnChar2 = 0; @@ -578,17 +578,17 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1, nNumIgnChar2++; } - nRes = ((INT32) nLen1 - nNumIgnChar1) - ((INT32) nLen2 - nNumIgnChar2); + nRes = ((sal_Int32) nLen1 - nNumIgnChar1) - ((sal_Int32) nLen2 - nNumIgnChar2); } return nRes; } -BOOL DictionaryNeo::seekEntry(const OUString &rWord, - INT32 *pPos, BOOL bSimilarOnly) +sal_Bool DictionaryNeo::seekEntry(const OUString &rWord, + sal_Int32 *pPos, sal_Bool bSimilarOnly) { // look for entry with binary search. - // return TRUE if found FALSE else. + // return sal_True if found sal_False else. // if pPos != NULL it will become the position of the found entry, or // if that was not found the position where it has to be inserted // to keep the entries sorted @@ -596,7 +596,7 @@ BOOL DictionaryNeo::seekEntry(const OUString &rWord, MutexGuard aGuard( GetLinguMutex() ); const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - INT32 nUpperIdx = getCount(), + sal_Int32 nUpperIdx = getCount(), nMidIdx, nLowerIdx = 0; if( nUpperIdx > 0 ) @@ -612,66 +612,66 @@ BOOL DictionaryNeo::seekEntry(const OUString &rWord, if(nCmp == 0) { if( pPos ) *pPos = nMidIdx; - return TRUE; + return sal_True; } else if(nCmp > 0) nLowerIdx = nMidIdx + 1; else if( nMidIdx == 0 ) { if( pPos ) *pPos = nLowerIdx; - return FALSE; + return sal_False; } else nUpperIdx = nMidIdx - 1; } } if( pPos ) *pPos = nLowerIdx; - return FALSE; + return sal_False; } -BOOL DictionaryNeo::isSorted() +sal_Bool DictionaryNeo::isSorted() { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - INT32 nEntries = getCount(); - INT32 i; + sal_Int32 nEntries = getCount(); + sal_Int32 i; for (i = 1; i < nEntries; i++) { if (cmpDicEntry( pEntry[i-1]->getDictionaryWord(), pEntry[i]->getDictionaryWord() ) > 0) { - bRes = FALSE; + bRes = sal_False; break; } } return bRes; } -BOOL DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicEntry, - BOOL bIsLoadEntries) +sal_Bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicEntry, + sal_Bool bIsLoadEntries) { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if ( bIsLoadEntries || (!bIsReadonly && xDicEntry.is()) ) { - BOOL bIsNegEntry = xDicEntry->isNegative(); - BOOL bAddEntry = !isFull() && + sal_Bool bIsNegEntry = xDicEntry->isNegative(); + sal_Bool bAddEntry = !isFull() && ( ( eDicType == DictionaryType_POSITIVE && !bIsNegEntry ) || ( eDicType == DictionaryType_NEGATIVE && bIsNegEntry ) || ( eDicType == DictionaryType_MIXED ) ); // look for position to insert entry at // if there is already an entry do not insert the new one - INT32 nPos = 0; - BOOL bFound = FALSE; + sal_Int32 nPos = 0; + sal_Bool bFound = sal_False; if (bAddEntry) { bFound = seekEntry( xDicEntry->getDictionaryWord(), &nPos ); if (bFound) - bAddEntry = FALSE; + bAddEntry = sal_False; } if (bAddEntry) @@ -683,7 +683,7 @@ BOOL DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicE uno::Reference< XDictionaryEntry > *pEntry = aEntries.getArray(); // shift old entries right - INT32 i; + sal_Int32 i; for (i = nCount - 1; i >= nPos; i--) pEntry[ i+1 ] = pEntry[ i ]; // insert new entry at specified position @@ -692,8 +692,8 @@ BOOL DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicE nCount++; - bIsModified = TRUE; - bRes = TRUE; + bIsModified = sal_True; + bRes = sal_True; if (!bIsLoadEntries) launchEvent( DictionaryEventFlags::ADD_ENTRY, xDicEntry ); @@ -748,13 +748,13 @@ void SAL_CALL DictionaryNeo::setActive( sal_Bool bActivate ) if (bIsActive != bActivate) { bIsActive = bActivate != 0; - INT16 nEvent = bIsActive ? + sal_Int16 nEvent = bIsActive ? DictionaryEventFlags::ACTIVATE_DIC : DictionaryEventFlags::DEACTIVATE_DIC; // remove entries from memory if dictionary is deactivated - if (bIsActive == FALSE) + if (bIsActive == sal_False) { - BOOL bIsEmpty = nCount == 0; + sal_Bool bIsEmpty = nCount == 0; // save entries first if necessary if (bIsModified && hasLocation() && !isReadonly()) @@ -802,11 +802,11 @@ void SAL_CALL DictionaryNeo::setLocale( const Locale& aLocale ) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - INT16 nLanguageP = LocaleToLanguage( aLocale ); + sal_Int16 nLanguageP = LocaleToLanguage( aLocale ); if (!bIsReadonly && nLanguage != nLanguageP) { nLanguage = nLanguageP; - bIsModified = TRUE; // new language needs to be saved with dictionary + bIsModified = sal_True; // new language needs to be saved with dictionary launchEvent( DictionaryEventFlags::CHG_LANGUAGE, NULL ); } @@ -821,8 +821,8 @@ uno::Reference< XDictionaryEntry > SAL_CALL DictionaryNeo::getEntry( if (bNeedEntries) loadEntries( aMainURL ); - INT32 nPos; - BOOL bFound = seekEntry( aWord, &nPos, TRUE ); + sal_Int32 nPos; + sal_Bool bFound = seekEntry( aWord, &nPos, sal_True ); DBG_ASSERT( nCount <= aEntries.getLength(), "lng : wrong number of entries"); DBG_ASSERT(!bFound || nPos < nCount, "lng : index out of range"); @@ -836,7 +836,7 @@ sal_Bool SAL_CALL DictionaryNeo::addEntry( { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!bIsReadonly) { @@ -855,7 +855,7 @@ sal_Bool SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!bIsReadonly) { @@ -892,15 +892,15 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord ) { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRemoved = FALSE; + sal_Bool bRemoved = sal_False; if (!bIsReadonly) { if (bNeedEntries) loadEntries( aMainURL ); - INT32 nPos; - BOOL bFound = seekEntry( aWord, &nPos ); + sal_Int32 nPos; + sal_Bool bFound = seekEntry( aWord, &nPos ); DBG_ASSERT( nCount < aEntries.getLength(), "lng : wrong number of entries"); DBG_ASSERT(!bFound || nPos < nCount, "lng : index out of range"); @@ -917,7 +917,7 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord ) //! the following call reduces the length of the sequence by 1 also lcl_SequenceRemoveElementAt( aEntries, nPos ); - bRemoved = bIsModified = TRUE; + bRemoved = bIsModified = sal_True; launchEvent( DictionaryEventFlags::DEL_ENTRY, xDicEntry ); } @@ -962,8 +962,8 @@ void SAL_CALL DictionaryNeo::clear( ) aEntries = uno::Sequence< uno::Reference< XDictionaryEntry > > ( 32 ); nCount = 0; - bNeedEntries = FALSE; - bIsModified = TRUE; + bNeedEntries = sal_False; + bIsModified = sal_True; launchEvent( DictionaryEventFlags::ENTRIES_CLEARED , NULL ); } @@ -975,10 +975,10 @@ sal_Bool SAL_CALL DictionaryNeo::addDictionaryEventListener( { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xListener.is()) { - INT32 nLen = aDicEvtListeners.getLength(); + sal_Int32 nLen = aDicEvtListeners.getLength(); bRes = aDicEvtListeners.addInterface( xListener ) != nLen; } return bRes; @@ -990,10 +990,10 @@ sal_Bool SAL_CALL DictionaryNeo::removeDictionaryEventListener( { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xListener.is()) { - INT32 nLen = aDicEvtListeners.getLength(); + sal_Int32 nLen = aDicEvtListeners.getLength(); bRes = aDicEvtListeners.removeInterface( xListener ) != nLen; } return bRes; @@ -1036,7 +1036,7 @@ void SAL_CALL DictionaryNeo::store() #endif } else - bIsModified = FALSE; + bIsModified = sal_False; } } @@ -1056,7 +1056,7 @@ void SAL_CALL DictionaryNeo::storeAsURL( else { aMainURL = aURL; - bIsModified = FALSE; + bIsModified = sal_False; bIsReadonly = IsReadOnly( getLocation() ); } } @@ -1080,18 +1080,18 @@ void SAL_CALL DictionaryNeo::storeToURL( DicEntry::DicEntry() { - bIsNegativ = FALSE; + bIsNegativ = sal_False; } DicEntry::DicEntry(const OUString &rDicFileWord, - BOOL bIsNegativWord) + sal_Bool bIsNegativWord) { if (rDicFileWord.getLength()) splitDicFileWord( rDicFileWord, aDicWord, aReplacement ); bIsNegativ = bIsNegativWord; } -DicEntry::DicEntry(const OUString &rDicWord, BOOL bNegativ, +DicEntry::DicEntry(const OUString &rDicWord, sal_Bool bNegativ, const OUString &rRplcText) : aDicWord (rDicWord), aReplacement (rRplcText), diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx index 5952c6ca0247..d6b4653db28e 100644 --- a/linguistic/source/dicimp.hxx +++ b/linguistic/source/dicimp.hxx @@ -47,7 +47,7 @@ #define DIC_MAX_ENTRIES 30000 -INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ); +sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNeg ); const String GetDicExtension(); /////////////////////////////////////////////////////////////////////////// @@ -67,41 +67,41 @@ class DictionaryNeo : ::rtl::OUString aDicName; ::rtl::OUString aMainURL; ::com::sun::star::linguistic2::DictionaryType eDicType; - INT16 nCount; - INT16 nLanguage; - INT16 nDicVersion; - BOOL bNeedEntries; - BOOL bIsModified; - BOOL bIsActive; - BOOL bIsReadonly; + sal_Int16 nCount; + sal_Int16 nLanguage; + sal_Int16 nDicVersion; + sal_Bool bNeedEntries; + sal_Bool bIsModified; + sal_Bool bIsActive; + sal_Bool bIsReadonly; // disallow copy-constructor and assignment-operator for now DictionaryNeo(const DictionaryNeo &); DictionaryNeo & operator = (const DictionaryNeo &); - void launchEvent(INT16 nEvent, + void launchEvent(sal_Int16 nEvent, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry > xEntry); - ULONG loadEntries(const ::rtl::OUString &rMainURL); - ULONG saveEntries(const ::rtl::OUString &rMainURL); + sal_uLong loadEntries(const ::rtl::OUString &rMainURL); + sal_uLong saveEntries(const ::rtl::OUString &rMainURL); int cmpDicEntry(const ::rtl::OUString &rWord1, const ::rtl::OUString &rWord2, - BOOL bSimilarOnly = FALSE); - BOOL seekEntry(const ::rtl::OUString &rWord, INT32 *pPos, - BOOL bSimilarOnly = FALSE); - BOOL isSorted(); + sal_Bool bSimilarOnly = sal_False); + sal_Bool seekEntry(const ::rtl::OUString &rWord, sal_Int32 *pPos, + sal_Bool bSimilarOnly = sal_False); + sal_Bool isSorted(); - BOOL addEntry_Impl(const ::com::sun::star::uno::Reference< + sal_Bool addEntry_Impl(const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry > xDicEntry, - BOOL bIsLoadEntries = FALSE); + sal_Bool bIsLoadEntries = sal_False); public: DictionaryNeo(); - DictionaryNeo(const ::rtl::OUString &rName, INT16 nLang, + DictionaryNeo(const ::rtl::OUString &rName, sal_Int16 nLang, ::com::sun::star::linguistic2::DictionaryType eType, const ::rtl::OUString &rMainURL, - BOOL bWriteable ); + sal_Bool bWriteable ); virtual ~DictionaryNeo(); // XNamed @@ -205,7 +205,7 @@ class DicEntry : { ::rtl::OUString aDicWord, // including hyphen positions represented by "=" aReplacement; // including hyphen positions represented by "=" - BOOL bIsNegativ; + sal_Bool bIsNegativ; // disallow copy-constructor and assignment-operator for now DicEntry(const DicEntry &); @@ -217,8 +217,8 @@ class DicEntry : public: DicEntry(); - DicEntry(const ::rtl::OUString &rDicFileWord, BOOL bIsNegativ); - DicEntry(const ::rtl::OUString &rDicWord, BOOL bIsNegativ, + DicEntry(const ::rtl::OUString &rDicFileWord, sal_Bool bIsNegativ); + DicEntry(const ::rtl::OUString &rDicWord, sal_Bool bIsNegativ, const ::rtl::OUString &rRplcText); virtual ~DicEntry(); diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 0e1a045bb98e..e8e6ef4e15fd 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -70,7 +70,7 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// -static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ); +static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ); static void AddInternal( const uno::Reference< XDictionary > &rDic, const rtl::OUString& rNew ); @@ -88,8 +88,8 @@ class DicEvtListenerHelper : uno::Sequence< DictionaryEvent > aCollectDicEvt; uno::Reference< XDictionaryList > xMyDicList; - INT16 nCondensedEvt; - INT16 nNumCollectEvtListeners, + sal_Int16 nCondensedEvt; + sal_Int16 nNumCollectEvtListeners, nNumVerboseListeners; public: @@ -109,14 +109,14 @@ public: // non-UNO functions void DisposeAndClear( const EventObject &rEvtObj ); - BOOL AddDicListEvtListener( + sal_Bool AddDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& rxListener, - BOOL bReceiveVerbose ); - BOOL RemoveDicListEvtListener( + sal_Bool bReceiveVerbose ); + sal_Bool RemoveDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& rxListener ); - INT16 BeginCollectEvents(); - INT16 EndCollectEvents(); - INT16 FlushEvents(); + sal_Int16 BeginCollectEvents(); + sal_Int16 EndCollectEvents(); + sal_Int16 FlushEvents(); void ClearEvents() { nCondensedEvt = 0; } }; @@ -183,7 +183,7 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent( || xDicEntry.is(), "lng : missing dictionary entry" ); - /*BOOL bActiveDicsModified = FALSE;*/ + /*sal_Bool bActiveDicsModified = sal_False;*/ // // evaluate DictionaryEvents and update data for next DictionaryListEvent // @@ -220,7 +220,7 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent( // update list of collected events if needs to be if (nNumVerboseListeners > 0) { - INT32 nColEvts = aCollectDicEvt.getLength(); + sal_Int32 nColEvts = aCollectDicEvt.getLength(); aCollectDicEvt.realloc( nColEvts + 1 ); aCollectDicEvt.getArray()[ nColEvts ] = rDicEvent; } @@ -230,32 +230,32 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent( } -BOOL DicEvtListenerHelper::AddDicListEvtListener( +sal_Bool DicEvtListenerHelper::AddDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& xListener, - BOOL /*bReceiveVerbose*/ ) + sal_Bool /*bReceiveVerbose*/ ) { DBG_ASSERT( xListener.is(), "empty reference" ); - INT32 nCount = aDicListEvtListeners.getLength(); + sal_Int32 nCount = aDicListEvtListeners.getLength(); return aDicListEvtListeners.addInterface( xListener ) != nCount; } -BOOL DicEvtListenerHelper::RemoveDicListEvtListener( +sal_Bool DicEvtListenerHelper::RemoveDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& xListener ) { DBG_ASSERT( xListener.is(), "empty reference" ); - INT32 nCount = aDicListEvtListeners.getLength(); + sal_Int32 nCount = aDicListEvtListeners.getLength(); return aDicListEvtListeners.removeInterface( xListener ) != nCount; } -INT16 DicEvtListenerHelper::BeginCollectEvents() +sal_Int16 DicEvtListenerHelper::BeginCollectEvents() { return ++nNumCollectEvtListeners; } -INT16 DicEvtListenerHelper::EndCollectEvents() +sal_Int16 DicEvtListenerHelper::EndCollectEvents() { DBG_ASSERT(nNumCollectEvtListeners > 0, "lng: mismatched function call"); if (nNumCollectEvtListeners > 0) @@ -268,7 +268,7 @@ INT16 DicEvtListenerHelper::EndCollectEvents() } -INT16 DicEvtListenerHelper::FlushEvents() +sal_Int16 DicEvtListenerHelper::FlushEvents() { if (0 != nCondensedEvt) { @@ -310,8 +310,8 @@ DicList::DicList() : { pDicEvtLstnrHelper = new DicEvtListenerHelper( this ); xDicEvtLstnrHelper = pDicEvtLstnrHelper; - bDisposing = FALSE; - bInCreation = FALSE; + bDisposing = sal_False; + bInCreation = sal_False; pExitListener = new MyAppExitListener( *this ); xExitListener = pExitListener; @@ -327,22 +327,22 @@ DicList::~DicList() void DicList::SearchForDictionaries( DictionaryVec_t&rDicList, const String &rDicDirURL, - BOOL bIsWriteablePath ) + sal_Bool bIsWriteablePath ) { osl::MutexGuard aGuard( GetLinguMutex() ); const uno::Sequence< rtl::OUString > aDirCnt( utl::LocalFileHelper:: - GetFolderContents( rDicDirURL, FALSE ) ); + GetFolderContents( rDicDirURL, sal_False ) ); const rtl::OUString *pDirCnt = aDirCnt.getConstArray(); - INT32 nEntries = aDirCnt.getLength(); + sal_Int32 nEntries = aDirCnt.getLength(); String aDCN( String::CreateFromAscii( "dcn" ) ); String aDCP( String::CreateFromAscii( "dcp" ) ); - for (INT32 i = 0; i < nEntries; ++i) + for (sal_Int32 i = 0; i < nEntries; ++i) { String aURL( pDirCnt[i] ); - USHORT nLang = LANGUAGE_NONE; - BOOL bNeg = FALSE; + sal_uInt16 nLang = LANGUAGE_NONE; + sal_Bool bNeg = sal_False; if(!::IsVers2OrNewer( aURL, nLang, bNeg )) { @@ -352,9 +352,9 @@ void DicList::SearchForDictionaries( aExt.ToLowerAscii(); if(aExt == aDCN) // negativ - bNeg = TRUE; + bNeg = sal_True; else if(aExt == aDCP) // positiv - bNeg = FALSE; + bNeg = sal_False; else continue; // andere Files } @@ -362,7 +362,7 @@ void DicList::SearchForDictionaries( // Aufnehmen in die Liste der Dictionaries // Wenn existent nicht aufnehmen // - INT16 nSystemLanguage = MsLangId::getSystemLanguage(); + sal_Int16 nSystemLanguage = MsLangId::getSystemLanguage(); String aTmp1 = ToLower( aURL, nSystemLanguage ); xub_StrLen nPos = aTmp1.SearchBackward( '/' ); if (STRING_NOTFOUND != nPos) @@ -396,11 +396,11 @@ void DicList::SearchForDictionaries( } -INT32 DicList::GetDicPos(const uno::Reference< XDictionary > &xDic) +sal_Int32 DicList::GetDicPos(const uno::Reference< XDictionary > &xDic) { osl::MutexGuard aGuard( GetLinguMutex() ); - INT32 nPos = -1; + sal_Int32 nPos = -1; DictionaryVec_t& rDicList = GetOrCreateDicList(); size_t n = rDicList.size(); for (size_t i = 0; i < n; i++) @@ -437,8 +437,8 @@ uno::Sequence< uno::Reference< XDictionary > > SAL_CALL uno::Sequence< uno::Reference< XDictionary > > aDics( rDicList.size() ); uno::Reference< XDictionary > *pDic = aDics.getArray(); - INT32 n = (USHORT) aDics.getLength(); - for (INT32 i = 0; i < n; i++) + sal_Int32 n = (sal_uInt16) aDics.getLength(); + for (sal_Int32 i = 0; i < n; i++) pDic[i] = rDicList[i]; return aDics; @@ -473,14 +473,14 @@ sal_Bool SAL_CALL DicList::addDictionary( osl::MutexGuard aGuard( GetLinguMutex() ); if (bDisposing) - return FALSE; + return sal_False; - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xDictionary.is()) { DictionaryVec_t& rDicList = GetOrCreateDicList(); rDicList.push_back( xDictionary ); - bRes = TRUE; + bRes = sal_True; // add listener helper to the dictionaries listener lists xDictionary->addDictionaryEventListener( xDicEvtLstnrHelper ); @@ -495,10 +495,10 @@ sal_Bool SAL_CALL osl::MutexGuard aGuard( GetLinguMutex() ); if (bDisposing) - return FALSE; + return sal_False; - BOOL bRes = FALSE; - INT32 nPos = GetDicPos( xDictionary ); + sal_Bool bRes = sal_False; + sal_Int32 nPos = GetDicPos( xDictionary ); if (nPos >= 0) { // remove dictionary list from the dictionaries listener lists @@ -508,14 +508,14 @@ sal_Bool SAL_CALL if (xDic.is()) { // deactivate dictionary if not already done - xDic->setActive( FALSE ); + xDic->setActive( sal_False ); xDic->removeDictionaryEventListener( xDicEvtLstnrHelper ); } // remove element at nPos rDicList.erase( rDicList.begin() + nPos ); - bRes = TRUE; + bRes = sal_True; } return bRes; } @@ -528,11 +528,11 @@ sal_Bool SAL_CALL DicList::addDictionaryListEventListener( osl::MutexGuard aGuard( GetLinguMutex() ); if (bDisposing) - return FALSE; + return sal_False; DBG_ASSERT(!bReceiveVerbose, "lng : not yet supported"); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xListener.is()) //! don't add empty references { bRes = pDicEvtLstnrHelper-> @@ -548,9 +548,9 @@ sal_Bool SAL_CALL DicList::removeDictionaryListEventListener( osl::MutexGuard aGuard( GetLinguMutex() ); if (bDisposing) - return FALSE; + return sal_False; - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if(xListener.is()) { bRes = pDicEvtLstnrHelper->RemoveDicListEvtListener( xListener ); @@ -583,7 +583,7 @@ uno::Reference< XDictionary > SAL_CALL { osl::MutexGuard aGuard( GetLinguMutex() ); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); bool bIsWriteablePath = rURL.match( GetDictionaryWriteablePath(), 0 ); return new DictionaryNeo( rName, nLanguage, eDicType, rURL, bIsWriteablePath ); } @@ -608,7 +608,7 @@ void SAL_CALL if (!bDisposing) { - bDisposing = TRUE; + bDisposing = sal_True; EventObject aEvtObj( (XDictionaryList *) this ); aEvtListeners.disposeAndClear( aEvtObj ); @@ -669,7 +669,7 @@ void SAL_CALL void DicList::_CreateDicList() { - bInCreation = TRUE; + bInCreation = sal_True; // look for dictionaries const rtl::OUString aWriteablePath( GetDictionaryWriteablePath() ); @@ -677,7 +677,7 @@ void DicList::_CreateDicList() const rtl::OUString *pPaths = aPaths.getConstArray(); for (sal_Int32 i = 0; i < aPaths.getLength(); ++i) { - const BOOL bIsWriteablePath = (pPaths[i] == aWriteablePath); + const sal_Bool bIsWriteablePath = (pPaths[i] == aWriteablePath); SearchForDictionaries( aDicList, pPaths[i], bIsWriteablePath ); } @@ -690,7 +690,7 @@ void DicList::_CreateDicList() if (xIgnAll.is()) { AddUserData( xIgnAll ); - xIgnAll->setActive( TRUE ); + xIgnAll->setActive( sal_True ); addDictionary( xIgnAll ); } @@ -704,14 +704,14 @@ void DicList::_CreateDicList() // const uno::Sequence< rtl::OUString > aActiveDics( aOpt.GetActiveDics() ); const rtl::OUString *pActiveDic = aActiveDics.getConstArray(); - INT32 nLen = aActiveDics.getLength(); - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nLen = aActiveDics.getLength(); + for (sal_Int32 i = 0; i < nLen; ++i) { if (pActiveDic[i].getLength()) { uno::Reference< XDictionary > xDic( getDictionaryByName( pActiveDic[i] ) ); if (xDic.is()) - xDic->setActive( TRUE ); + xDic->setActive( sal_True ); } } @@ -721,7 +721,7 @@ void DicList::_CreateDicList() pDicEvtLstnrHelper->EndCollectEvents(); - bInCreation = FALSE; + bInCreation = sal_False; } @@ -772,10 +772,10 @@ sal_Bool SAL_CALL DicList::supportsService( const rtl::OUString& ServiceName ) uno::Sequence< rtl::OUString > aSNL = getSupportedServiceNames(); const rtl::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; } @@ -842,7 +842,7 @@ xub_StrLen lcl_GetToken( String &rToken, if (i >= rText.Len()) // delimeter not found rToken = rText.Copy( nPos ); else - rToken = rText.Copy( nPos, sal::static_int_cast< xub_StrLen >((INT32) i - nPos) ); + rToken = rText.Copy( nPos, sal::static_int_cast< xub_StrLen >((sal_Int32) i - nPos) ); nRes = i + 1; // continue after found delimeter } @@ -870,7 +870,7 @@ static void AddInternal( { if( aToken.Len() && !IsNumeric( aToken ) ) { - rDic->add( aToken, FALSE, rtl::OUString() ); + rDic->add( aToken, sal_False, rtl::OUString() ); } } } @@ -897,10 +897,10 @@ static void AddUserData( const uno::Reference< XDictionary > &rDic ) #pragma optimize("g",off) #endif -static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) +static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ) { if (rFileURL.Len() == 0) - return FALSE; + return sal_False; String aDIC( GetDicExtension() ); String aExt; xub_StrLen nPos = rFileURL.SearchBackward( '.' ); @@ -909,7 +909,7 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) aExt.ToLowerAscii(); if(aExt != aDIC) - return FALSE; + return sal_False; // get stream to be used uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() ); @@ -929,15 +929,15 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) } DBG_ASSERT( xStream.is(), "failed to get stream for read" ); if (!xStream.is()) - return FALSE; + return sal_False; SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); int nDicVersion = ReadDicVersion(pStream, nLng, bNeg); if (2 == nDicVersion || nDicVersion >= 5) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/dlistimp.hxx b/linguistic/source/dlistimp.hxx index 0674210d8494..ca88be6660ca 100644 --- a/linguistic/source/dlistimp.hxx +++ b/linguistic/source/dlistimp.hxx @@ -80,8 +80,8 @@ class DicList : XTerminateListener > xExitListener; MyAppExitListener *pExitListener; - BOOL bDisposing; - BOOL bInCreation; + sal_Bool bDisposing; + sal_Bool bInCreation; // disallow copy-constructor and assignment-operator for now DicList( const DicList & ); @@ -95,11 +95,11 @@ class DicList : return aDicList; } - void LaunchEvent(INT16 nEvent, com::sun::star::uno::Sequence< + void LaunchEvent(sal_Int16 nEvent, com::sun::star::uno::Sequence< ::com::sun::star::linguistic2::XDictionary > xDic); void SearchForDictionaries( DictionaryVec_t &rDicList, - const String &rDicDir, BOOL bIsWritePath ); - INT32 GetDicPos(const com::sun::star::uno::Reference< + const String &rDicDir, sal_Bool bIsWritePath ); + sal_Int32 GetDicPos(const com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > &xDic); public: diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 56e96df65d7b..19972d641492 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -1220,10 +1220,10 @@ throw(uno::RuntimeException) { uno::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] == rServiceName ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 4de68ab1f9af..6f4b1c5d3da8 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -249,10 +249,10 @@ sal_Bool SAL_CALL GrammarChecker::supportsService( const OUString& ServiceName ) uno::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; } uno::Sequence< OUString > GrammarChecker::getSupportedServiceNames_Static( ) throw() diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 8f0e1f8736b8..d54bdbe4bbfa 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -88,13 +88,13 @@ sal_Int16 SAL_CALL checkScriptType(sal_Unicode c) throw (RuntimeException) -BOOL TextIsAllScriptType( const OUString &rTxt, INT16 nScriptType ) +sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType ) { - BOOL bIsAll = TRUE; - for (INT32 i = 0; i < rTxt.getLength() && bIsAll; ++i) + sal_Bool bIsAll = sal_True; + for (sal_Int32 i = 0; i < rTxt.getLength() && bIsAll; ++i) { if (checkScriptType( rTxt.getStr()[i]) != nScriptType) - bIsAll = FALSE; + bIsAll = sal_False; } return bIsAll; } @@ -103,7 +103,7 @@ BOOL TextIsAllScriptType( const OUString &rTxt, INT16 nScriptType ) /////////////////////////////////////////////////////////////////////////// HHConvDic::HHConvDic( const String &rName, const String &rMainURL ) : - ConvDic( rName, LANGUAGE_KOREAN, ConversionDictionaryType::HANGUL_HANJA, TRUE, rMainURL ) + ConvDic( rName, LANGUAGE_KOREAN, ConversionDictionaryType::HANGUL_HANJA, sal_True, rMainURL ) { } diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index 2d234fdc15fa..d296a8a56bfb 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -82,7 +82,7 @@ void HyphenatorDispatcher::ClearSvcList() Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( const OUString rOrigWord, const Reference<XDictionaryEntry> &xEntry, - INT16 nLang, INT16 nMaxLeading ) + sal_Int16 nLang, sal_Int16 nMaxLeading ) { MutexGuard aGuard( GetLinguMutex() ); @@ -91,25 +91,25 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( if (xEntry.is()) { OUString aText( xEntry->getDictionaryWord() ); - INT32 nTextLen = aText.getLength(); + sal_Int32 nTextLen = aText.getLength(); // trailing '=' means "hyphenation should not be possible" if (nTextLen > 0 && aText[ nTextLen - 1 ] != '=') { - INT16 nHyphenationPos = -1; + sal_Int16 nHyphenationPos = -1; OUStringBuffer aTmp( nTextLen ); - BOOL bSkip = FALSE; - INT32 nHyphIdx = -1; - INT32 nLeading = 0; - for (INT32 i = 0; i < nTextLen; i++) + sal_Bool bSkip = sal_False; + sal_Int32 nHyphIdx = -1; + sal_Int32 nLeading = 0; + for (sal_Int32 i = 0; i < nTextLen; i++) { sal_Unicode cTmp = aText[i]; if (cTmp != '=') { aTmp.append( cTmp ); nLeading++; - bSkip = FALSE; + bSkip = sal_False; nHyphIdx++; } else @@ -117,9 +117,9 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( if (!bSkip && nHyphIdx >= 0) { if (nLeading <= nMaxLeading) - nHyphenationPos = (INT16) nHyphIdx; + nHyphenationPos = (sal_Int16) nHyphIdx; } - bSkip = TRUE; //! multiple '=' should count as one only + bSkip = sal_True; //! multiple '=' should count as one only } } @@ -169,7 +169,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( - const Reference< XDictionaryEntry > &xEntry, INT16 nLanguage ) + const Reference< XDictionaryEntry > &xEntry, sal_Int16 nLanguage ) { MutexGuard aGuard( GetLinguMutex() ); @@ -179,33 +179,33 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( { // text with hyphenation info OUString aText( xEntry->getDictionaryWord() ); - INT32 nTextLen = aText.getLength(); + sal_Int32 nTextLen = aText.getLength(); // trailing '=' means "hyphenation should not be possible" if (nTextLen > 0 && aText[ nTextLen - 1 ] != '=') { // sequence to hold hyphenation positions - Sequence< INT16 > aHyphPos( nTextLen ); - INT16 *pPos = aHyphPos.getArray(); - INT32 nHyphCount = 0; + Sequence< sal_Int16 > aHyphPos( nTextLen ); + sal_Int16 *pPos = aHyphPos.getArray(); + sal_Int32 nHyphCount = 0; OUStringBuffer aTmp( nTextLen ); - BOOL bSkip = FALSE; - INT32 nHyphIdx = -1; - for (INT32 i = 0; i < nTextLen; i++) + sal_Bool bSkip = sal_False; + sal_Int32 nHyphIdx = -1; + for (sal_Int32 i = 0; i < nTextLen; i++) { sal_Unicode cTmp = aText[i]; if (cTmp != '=') { aTmp.append( cTmp ); - bSkip = FALSE; + bSkip = sal_False; nHyphIdx++; } else { if (!bSkip && nHyphIdx >= 0) - pPos[ nHyphCount++ ] = (INT16) nHyphIdx; - bSkip = TRUE; //! multiple '=' should count as one only + pPos[ nHyphCount++ ] = (sal_Int16) nHyphIdx; + bSkip = sal_True; //! multiple '=' should count as one only } } @@ -245,7 +245,7 @@ Sequence< Locale > SAL_CALL HyphenatorDispatcher::getLocales() } -BOOL SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale) +sal_Bool SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -264,8 +264,8 @@ Reference< XHyphenatedWord > SAL_CALL Reference< XHyphenatedWord > xRes; - INT32 nWordLen = rWord.getLength(); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int32 nWordLen = rWord.getLength(); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !nWordLen || nMaxLeading == 0 || nMaxLeading == nWordLen) return xRes; @@ -274,7 +274,7 @@ Reference< XHyphenatedWord > SAL_CALL HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - BOOL bWordModified = FALSE; + sal_Bool bWordModified = sal_False; if (!pEntry || (nMaxLeading < 0 || nMaxLeading > nWordLen)) { #ifdef LINGU_EXCEPTIONS @@ -296,7 +296,7 @@ Reference< XHyphenatedWord > SAL_CALL bWordModified |= RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) bWordModified |= RemoveControlChars( aChkWord ); - INT16 nChkMaxLeading = (INT16) GetPosInWordToCheck( rWord, nMaxLeading ); + sal_Int16 nChkMaxLeading = (sal_Int16) GetPosInWordToCheck( rWord, nMaxLeading ); // check for results from (positive) dictionaries which have precedence! Reference< XDictionaryEntry > xEntry; @@ -304,7 +304,7 @@ Reference< XHyphenatedWord > SAL_CALL if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { xEntry = GetDicList()->queryDictionaryEntry( aChkWord, rLocale, - TRUE, FALSE ); + sal_True, sal_False ); } if (xEntry.is()) @@ -318,11 +318,11 @@ Reference< XHyphenatedWord > SAL_CALL } else { - INT32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; + sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XHyphenator > xHyph; if (pEntry->aSvcRefs.getLength() > 0) xHyph = pEntry->aSvcRefs[0]; @@ -373,7 +373,7 @@ Reference< XHyphenatedWord > SAL_CALL xRes = xHyph->hyphenate( aChkWord, rLocale, nChkMaxLeading, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; // if language is not supported by the services @@ -409,8 +409,8 @@ Reference< XHyphenatedWord > SAL_CALL Reference< XHyphenatedWord > xRes; - INT32 nWordLen = rWord.getLength(); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int32 nWordLen = rWord.getLength(); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !nWordLen) return xRes; @@ -418,7 +418,7 @@ Reference< XHyphenatedWord > SAL_CALL HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - BOOL bWordModified = FALSE; + sal_Bool bWordModified = sal_False; if (!pEntry || !(0 <= nIndex && nIndex <= nWordLen - 2)) { #ifdef LINGU_EXCEPTIONS @@ -440,7 +440,7 @@ Reference< XHyphenatedWord > SAL_CALL bWordModified |= RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) bWordModified |= RemoveControlChars( aChkWord ); - INT16 nChkIndex = (INT16) GetPosInWordToCheck( rWord, nIndex ); + sal_Int16 nChkIndex = (sal_Int16) GetPosInWordToCheck( rWord, nIndex ); // check for results from (positive) dictionaries which have precedence! Reference< XDictionaryEntry > xEntry; @@ -448,7 +448,7 @@ Reference< XHyphenatedWord > SAL_CALL if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { xEntry = GetDicList()->queryDictionaryEntry( aChkWord, rLocale, - TRUE, FALSE ); + sal_True, sal_False ); } if (xEntry.is()) @@ -457,11 +457,11 @@ Reference< XHyphenatedWord > SAL_CALL } else { - INT32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; + sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XHyphenator > xHyph; if (pEntry->aSvcRefs.getLength() > 0) xHyph = pEntry->aSvcRefs[0]; @@ -512,7 +512,7 @@ Reference< XHyphenatedWord > SAL_CALL xRes = xHyph->queryAlternativeSpelling( aChkWord, rLocale, nChkIndex, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; // if language is not supported by the services @@ -548,7 +548,7 @@ Reference< XPossibleHyphens > SAL_CALL Reference< XPossibleHyphens > xRes; - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !rWord.getLength()) return xRes; @@ -582,7 +582,7 @@ Reference< XPossibleHyphens > SAL_CALL if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { xEntry = GetDicList()->queryDictionaryEntry( aChkWord, rLocale, - TRUE, FALSE ); + sal_True, sal_False ); } if (xEntry.is()) @@ -591,11 +591,11 @@ Reference< XPossibleHyphens > SAL_CALL } else { - INT32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; + sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0; DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XHyphenator > xHyph; if (pEntry->aSvcRefs.getLength() > 0) xHyph = pEntry->aSvcRefs[0]; @@ -646,7 +646,7 @@ Reference< XPossibleHyphens > SAL_CALL xRes = xHyph->createPossibleHyphens( aChkWord, rLocale, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; // if language is not supported by the services @@ -674,9 +674,9 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale, { MutexGuard aGuard( GetLinguMutex() ); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); - INT32 nLen = rSvcImplNames.getLength(); + sal_Int32 nLen = rSvcImplNames.getLength(); if (0 == nLen) // remove entry aSvcMap.erase( nLanguage ); @@ -711,7 +711,7 @@ Sequence< OUString > Sequence< OUString > aRes; // search for entry with that language and use data from that - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this; const HyphSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); const LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; diff --git a/linguistic/source/hyphdsp.hxx b/linguistic/source/hyphdsp.hxx index 416715943c9e..8271c5f08969 100644 --- a/linguistic/source/hyphdsp.hxx +++ b/linguistic/source/hyphdsp.hxx @@ -88,13 +88,13 @@ class HyphenatorDispatcher : buildHyphWord( const rtl::OUString rOrigWord, const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry> &xEntry, - INT16 nLang, INT16 nMaxLeading ); + sal_Int16 nLang, sal_Int16 nMaxLeading ); com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XPossibleHyphens > buildPossHyphens( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry > &xEntry, - INT16 nLanguage ); + sal_Int16 nLanguage ); public: HyphenatorDispatcher( LngSvcMgr &rLngSvcMgr ); diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index 503d646de117..32c755ad7758 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -53,8 +53,8 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -HyphenatedWord::HyphenatedWord(const OUString &rWord, INT16 nLang, INT16 nHPos, - const OUString &rHyphWord, INT16 nPos ) : +HyphenatedWord::HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16 nHPos, + const OUString &rHyphWord, sal_Int16 nPos ) : aWord (rWord), aHyphenatedWord (rHyphWord), nHyphPos (nPos), @@ -136,9 +136,9 @@ sal_Bool SAL_CALL HyphenatedWord::isAlternativeSpelling() /////////////////////////////////////////////////////////////////////////// -PossibleHyphens::PossibleHyphens(const OUString &rWord, INT16 nLang, +PossibleHyphens::PossibleHyphens(const OUString &rWord, sal_Int16 nLang, const OUString &rHyphWord, - const Sequence< INT16 > &rPositions) : + const Sequence< sal_Int16 > &rPositions) : aWord (rWord), aWordWithHyphens(rHyphWord), aOrigHyphenPos (rPositions), diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index 6556fc71d052..bdde4e6851ff 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.cxx @@ -79,7 +79,7 @@ namespace linguistic static const struct { const char *pPropName; - INT32 nPropHdl; + sal_Int32 nPropHdl; } aFlushProperties[ NUM_FLUSH_PROPS ] = { { UPN_IS_USE_DICTIONARY_LIST, UPH_IS_USE_DICTIONARY_LIST }, @@ -120,7 +120,7 @@ static void lcl_RemoveAsPropertyChangeListener( } -static BOOL lcl_IsFlushProperty( INT32 nHandle ) +static sal_Bool lcl_IsFlushProperty( sal_Int32 nHandle ) { int i; for (i = 0; i < NUM_FLUSH_PROPS; ++i) @@ -154,7 +154,7 @@ void FlushListener::SetDicList( Reference<XDictionaryList> &rDL ) xDicList = rDL; if (xDicList.is()) - xDicList->addDictionaryListEventListener( this, FALSE ); + xDicList->addDictionaryListEventListener( this, sal_False ); } } @@ -201,13 +201,13 @@ void SAL_CALL FlushListener::processDictionaryListEvent( if (rDicListEvent.Source == xDicList) { - INT16 nEvt = rDicListEvent.nCondensedEvent; - INT16 nFlushFlags = + sal_Int16 nEvt = rDicListEvent.nCondensedEvent; + sal_Int16 nFlushFlags = DictionaryListEventFlags::ADD_NEG_ENTRY | DictionaryListEventFlags::DEL_POS_ENTRY | DictionaryListEventFlags::ACTIVATE_NEG_DIC | DictionaryListEventFlags::DEACTIVATE_POS_DIC; - BOOL bFlush = 0 != (nEvt & nFlushFlags); + sal_Bool bFlush = 0 != (nEvt & nFlushFlags); DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" ); if (bFlush && pFlushObj != NULL) @@ -224,7 +224,7 @@ void SAL_CALL FlushListener::propertyChange( if (rEvt.Source == xPropSet) { - BOOL bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle ); + sal_Bool bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle ); DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" ); if (bFlush && pFlushObj != NULL) diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index f00f4f439451..95cde6a32812 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -98,33 +98,33 @@ LinguOptions::~LinguOptions() } -BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal, sal_Int16 nType) +sal_Bool LinguOptions::SetLocale_Impl( sal_Int16 &rLanguage, Any &rOld, const Any &rVal, sal_Int16 nType) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; Locale aNew; rVal >>= aNew; - INT16 nNew = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aNew), nType); + sal_Int16 nNew = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aNew), nType); if (nNew != rLanguage) { Locale aLocale( CreateLocale( rLanguage ) ); rOld.setValue( &aLocale, ::getCppuType((Locale*)0 )); rLanguage = nNew; - bRes = TRUE; + bRes = sal_True; } return bRes; } -BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) +sal_Bool LinguOptions::SetValue( Any &rOld, const Any &rVal, sal_Int32 nWID ) { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; - INT16 *pnVal = 0; - BOOL *pbVal = 0; + sal_Int16 *pnVal = 0; + sal_Bool *pbVal = 0; switch( nWID ) { @@ -163,30 +163,30 @@ BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) default : { DBG_ASSERT( 0,"lng : unknown WID"); - bRes = FALSE; + bRes = sal_False; } } if (pbVal) { - BOOL bNew = FALSE; + sal_Bool bNew = sal_False; rVal >>= bNew; if (bNew != *pbVal) { rOld <<= *pbVal; *pbVal = bNew; - bRes = TRUE; + bRes = sal_True; } } if (pnVal) { - INT16 nNew = 0; + sal_Int16 nNew = 0; rVal >>= nNew; if (nNew != *pnVal) { rOld <<= *pnVal; *pnVal = nNew; - bRes = TRUE; + bRes = sal_True; } } @@ -196,13 +196,13 @@ BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) return bRes; } -void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const +void LinguOptions::GetValue( Any &rVal, sal_Int32 nWID ) const { MutexGuard aGuard( GetLinguMutex() ); - INT16 *pnVal = 0; - BOOL *pbVal = 0; - BOOL bDummy = FALSE; + sal_Int16 *pnVal = 0; + sal_Bool *pbVal = 0; + sal_Bool bDummy = sal_False; switch( nWID ) { @@ -256,7 +256,7 @@ void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const struct WID_Name { - INT32 nWID; + sal_Int32 nWID; const char *pPropertyName; }; @@ -291,13 +291,13 @@ WID_Name aWID_Name[] = }; -OUString LinguOptions::GetName( INT32 nWID ) +OUString LinguOptions::GetName( sal_Int32 nWID ) { MutexGuard aGuard( GetLinguMutex() ); OUString aRes; - INT32 nLen = sizeof( aWID_Name ) / sizeof( aWID_Name[0] ); + sal_Int32 nLen = sizeof( aWID_Name ) / sizeof( aWID_Name[0] ); if (0 <= nWID && nWID < nLen && aWID_Name[ nWID ].nWID == nWID) { @@ -369,7 +369,7 @@ LinguProps::LinguProps() : aPropListeners (GetLinguMutex()), aPropertyMap(lcl_GetLinguProps()) { - bDisposing = FALSE; + bDisposing = sal_False; } void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const @@ -420,7 +420,7 @@ void SAL_CALL LinguProps::setPropertyValue( if (aOld != rValue && aConfig.SetProperty( pCur->nWID, rValue )) { PropertyChangeEvent aChgEvt( (XPropertySet *) this, rPropertyName, - FALSE, pCur->nWID, aOld, rValue ); + sal_False, pCur->nWID, aOld, rValue ); launchEvent( aChgEvt ); } } @@ -523,7 +523,7 @@ void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rV if (aOld != rValue && aConfig.SetProperty( nHandle, rValue )) { PropertyChangeEvent aChgEvt( (XPropertySet *) this, - LinguOptions::GetName( nHandle ), FALSE, nHandle, aOld, rValue ); + LinguOptions::GetName( nHandle ), sal_False, nHandle, aOld, rValue ); launchEvent( aChgEvt ); } } @@ -545,12 +545,12 @@ Sequence< PropertyValue > SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - INT32 nLen = aPropertyMap.getSize(); + sal_Int32 nLen = aPropertyMap.getSize(); Sequence< PropertyValue > aProps( nLen ); PropertyValue *pProp = aProps.getArray(); PropertyEntryVector_t aPropEntries = aPropertyMap.getPropertyEntries(); PropertyEntryVector_t::const_iterator aIt = aPropEntries.begin(); - for (INT32 i = 0; i < nLen; ++i, ++aIt) + for (sal_Int32 i = 0; i < nLen; ++i, ++aIt) { PropertyValue &rVal = pProp[i]; Any aAny( aConfig.GetProperty( aIt->nWID ) ); @@ -570,9 +570,9 @@ void SAL_CALL { MutexGuard aGuard( GetLinguMutex() ); - INT32 nLen = rProps.getLength(); + sal_Int32 nLen = rProps.getLength(); const PropertyValue *pVal = rProps.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { const PropertyValue &rVal = pVal[i]; setPropertyValue( rVal.Name, rVal.Value ); @@ -587,7 +587,7 @@ void SAL_CALL if (!bDisposing) { - bDisposing = TRUE; + bDisposing = sal_True; //! its too late to save the options here! // (see AppExitListener for saving) @@ -640,10 +640,10 @@ sal_Bool SAL_CALL LinguProps::supportsService( const OUString& ServiceName ) uno::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; } // XServiceInfo diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index 7f14142a4519..ecfa5461e2c3 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -72,7 +72,7 @@ class LinguOptions //! uses default assignment-operator - BOOL SetLocale_Impl( INT16 &rLanguage, + sal_Bool SetLocale_Impl( sal_Int16 &rLanguage, ::com::sun::star::uno::Any &rOld, const ::com::sun::star::uno::Any &rVal, sal_Int16 nType ); @@ -81,11 +81,11 @@ public: LinguOptions(const LinguOptions &rOpt); ~LinguOptions(); - BOOL SetValue( ::com::sun::star::uno::Any &rOld, - const ::com::sun::star::uno::Any &rVal, INT32 nWID ); - void GetValue( ::com::sun::star::uno::Any &rVal, INT32 nWID ) const; + sal_Bool SetValue( ::com::sun::star::uno::Any &rOld, + const ::com::sun::star::uno::Any &rVal, sal_Int32 nWID ); + void GetValue( ::com::sun::star::uno::Any &rVal, sal_Int32 nWID ) const; - static ::rtl::OUString GetName( INT32 nWID ); + static ::rtl::OUString GetName( sal_Int32 nWID ); const ::com::sun::star::uno::Sequence< rtl::OUString > GetActiveDics() const { return pData->aActiveDics; } @@ -103,14 +103,14 @@ public: // helper function call class struct PropHashType_Impl { - size_t operator()(const INT32 &s) const { return s; } + size_t operator()(const sal_Int32 &s) const { return s; } }; typedef cppu::OMultiTypeInterfaceContainerHelperVar < - INT32, + sal_Int32, PropHashType_Impl, - std::equal_to< INT32 > + std::equal_to< sal_Int32 > > OPropertyListenerContainerHelper; /////////////////////////////////////////////////////////////////////////// @@ -132,7 +132,7 @@ class LinguProps : SfxItemPropertyMap aPropertyMap; SvtLinguConfig aConfig; - BOOL bDisposing; + sal_Bool bDisposing; // disallow copy-constructor and assignment-operator for now LinguProps(const LinguProps &); diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index 0efcf94a0b13..88c5c7829cee 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -78,7 +78,7 @@ PropertyChgHelper::PropertyChgHelper( nEvtFlags (nAllowedEvents) { OUString *pName = aPropNames.getArray(); - for (INT32 i = 0; i < nCHCount; ++i) + for (sal_Int32 i = 0; i < nCHCount; ++i) { pName[i] = A2OU( aCH[i] ); } @@ -108,14 +108,14 @@ PropertyChgHelper::~PropertyChgHelper() } -void PropertyChgHelper::AddPropNames( const char *pNewNames[], INT32 nCount ) +void PropertyChgHelper::AddPropNames( const char *pNewNames[], sal_Int32 nCount ) { if (pNewNames && nCount) { - INT32 nLen = GetPropNames().getLength(); + sal_Int32 nLen = GetPropNames().getLength(); GetPropNames().realloc( nLen + nCount ); OUString *pName = GetPropNames().getArray(); - for (INT32 i = 0; i < nCount; ++i) + for (sal_Int32 i = 0; i < nCount; ++i) { pName[ nLen + i ] = A2OU( pNewNames[ i ] ); } @@ -125,20 +125,20 @@ void PropertyChgHelper::AddPropNames( const char *pNewNames[], INT32 nCount ) void PropertyChgHelper::SetDefaultValues() { - bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE; - bResIsUseDictionaryList = bIsUseDictionaryList = TRUE; + bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = sal_True; + bResIsUseDictionaryList = bIsUseDictionaryList = sal_True; } void PropertyChgHelper::GetCurrentValues() { - INT32 nLen = GetPropNames().getLength(); + sal_Int32 nLen = GetPropNames().getLength(); if (GetPropSet().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 (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_IGNORE_CONTROL_CHARACTERS ) )) @@ -169,13 +169,13 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals ) bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters; bResIsUseDictionaryList = bIsUseDictionaryList; // - 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_IGNORE_CONTROL_CHARACTERS : @@ -193,18 +193,18 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals ) } -BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) +sal_Bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (GetPropSet().is() && rEvt.Source == GetPropSet()) { - INT16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ? + sal_Int16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ? LinguServiceEventFlags::HYPHENATE_AGAIN : 0; - BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? - bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? + 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 : @@ -216,12 +216,12 @@ BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) case UPH_IS_USE_DICTIONARY_LIST : { pbVal = &bIsUseDictionaryList; - bSCWA = bSWWA = TRUE; + bSCWA = bSWWA = sal_True; break; } default: { - bRes = FALSE; + bRes = sal_False; //DBG_ASSERT( 0, "unknown property" ); } } @@ -231,7 +231,7 @@ BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) bRes = 0 != pbVal; // sth changed? if (bRes) { - BOOL bSpellEvts = (nEvtFlags & AE_SPELLCHECKER) ? TRUE : FALSE; + sal_Bool bSpellEvts = (nEvtFlags & AE_SPELLCHECKER) ? sal_True : sal_False; if (bSCWA && bSpellEvts) nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN; if (bSWWA && bSpellEvts) @@ -261,9 +261,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 ); @@ -275,9 +275,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 ); @@ -318,10 +318,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; @@ -335,10 +335,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; @@ -405,9 +405,9 @@ void PropertyHelper_Spell::SetDefaultValues() { PropertyChgHelper::SetDefaultValues(); - bResIsSpellUpperCase = bIsSpellUpperCase = FALSE; - bResIsSpellWithDigits = bIsSpellWithDigits = FALSE; - bResIsSpellCapitalization = bIsSpellCapitalization = TRUE; + bResIsSpellUpperCase = bIsSpellUpperCase = sal_False; + bResIsSpellWithDigits = bIsSpellWithDigits = sal_False; + bResIsSpellCapitalization = bIsSpellCapitalization = sal_True; } @@ -415,13 +415,13 @@ void PropertyHelper_Spell::GetCurrentValues() { PropertyChgHelper::GetCurrentValues(); - INT32 nLen = GetPropNames().getLength(); + sal_Int32 nLen = GetPropNames().getLength(); if (GetPropSet().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 (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_UPPER_CASE ) )) @@ -450,38 +450,38 @@ void PropertyHelper_Spell::GetCurrentValues() } -BOOL PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt ) +sal_Bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt ) { - BOOL bRes = PropertyChgHelper::propertyChange_Impl( rEvt ); + sal_Bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt ); if (!bRes && 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_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: @@ -528,11 +528,11 @@ 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) { if (pVal[i].Name.equalsAscii( UPN_MAX_NUMBER_OF_SUGGESTIONS )) { @@ -540,7 +540,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) } else { - BOOL *pbResVal = NULL; + sal_Bool *pbResVal = NULL; switch (pVal[i].Handle) { case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break; @@ -556,7 +556,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) } } -INT16 PropertyHelper_Spell::GetDefaultNumberOfSuggestions() const +sal_Int16 PropertyHelper_Spell::GetDefaultNumberOfSuggestions() const { return 16; } @@ -601,13 +601,13 @@ void PropertyHelper_Hyphen::GetCurrentValues() { PropertyChgHelper::GetCurrentValues(); - INT32 nLen = GetPropNames().getLength(); + sal_Int32 nLen = GetPropNames().getLength(); if (GetPropSet().is() && nLen) { const OUString *pPropName = GetPropNames().getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { - INT16 *pnVal = NULL, + sal_Int16 *pnVal = NULL, *pnResVal = NULL; if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_LEADING ) )) @@ -636,15 +636,15 @@ void PropertyHelper_Hyphen::GetCurrentValues() } -BOOL PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt ) +sal_Bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt ) { - BOOL bRes = PropertyChgHelper::propertyChange_Impl( rEvt ); + sal_Bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt ); if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet()) { - INT16 nLngSvcFlags = LinguServiceEventFlags::HYPHENATE_AGAIN; + sal_Int16 nLngSvcFlags = LinguServiceEventFlags::HYPHENATE_AGAIN; - INT16 *pnVal = NULL; + sal_Int16 *pnVal = NULL; switch (rEvt.PropertyHandle) { case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break; @@ -690,13 +690,13 @@ void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals ) nResHyphMinTrailing = nHyphMinTrailing; nResHyphMinWordLength = nHyphMinWordLength; // - 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) { - INT16 *pnResVal = NULL; + sal_Int16 *pnResVal = NULL; switch (pVal[i].Handle) { case UPH_HYPH_MIN_LEADING : pnResVal = &nResHyphMinLeading; break; diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 00e71628bd70..2b88947aa9ee 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -66,19 +66,19 @@ uno::Sequence< OUString > static GetLangSvc( const uno::Any &rVal ); /////////////////////////////////////////////////////////////////////////// -static BOOL lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const OUString &rText ) +static sal_Bool lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const OUString &rText ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; - INT32 nLen = rSeq.getLength(); + sal_Int32 nLen = rSeq.getLength(); if (nLen == 0 || rText.getLength() == 0) return bRes; const OUString *pSeq = rSeq.getConstArray(); - for (INT32 i = 0; i < nLen && !bRes; ++i) + for (sal_Int32 i = 0; i < nLen && !bRes; ++i) { if (rText == pSeq[i]) - bRes = TRUE; + bRes = sal_True; } return bRes; } @@ -91,7 +91,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales( uno::Sequence< lang::Locale > aRes; uno::Reference< lang::XMultiServiceFactory > xFac( utl::getProcessServiceFactory() ); - INT32 nNames = rSvcImplNames.getLength(); + sal_Int32 nNames = rSvcImplNames.getLength(); if (nNames && xFac.is()) { std::set< LanguageType > aLanguages; @@ -104,7 +104,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales( // check all services for the supported languages and new // languages to the result const OUString *pImplNames = rSvcImplNames.getConstArray(); - INT32 i; + sal_Int32 i; for (i = 0; i < nNames; ++i) { @@ -122,8 +122,8 @@ static uno::Sequence< lang::Locale > GetAvailLocales( if (xSuppLoc.is()) { uno::Sequence< lang::Locale > aLoc( xSuppLoc->getLocales() ); - INT32 nLoc = aLoc.getLength(); - for (INT32 k = 0; k < nLoc; ++k) + sal_Int32 nLoc = aLoc.getLength(); + for (sal_Int32 k = 0; k < nLoc; ++k) { const lang::Locale *pLoc = aLoc.getConstArray(); LanguageType nLang = LocaleToLanguage( pLoc[k] ); @@ -140,7 +140,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales( } // build return sequence - INT32 nLanguages = static_cast< INT32 >(aLanguages.size()); + sal_Int32 nLanguages = static_cast< sal_Int32 >(aLanguages.size()); aRes.realloc( nLanguages ); lang::Locale *pRes = aRes.getArray(); std::set< LanguageType >::const_iterator aIt( aLanguages.begin() ); @@ -159,24 +159,24 @@ static uno::Sequence< lang::Locale > GetAvailLocales( struct SvcInfo { const OUString aSvcImplName; - const uno::Sequence< INT16 > aSuppLanguages; + const uno::Sequence< sal_Int16 > aSuppLanguages; SvcInfo( const OUString &rSvcImplName, - const uno::Sequence< INT16 > &rSuppLanguages ) : + const uno::Sequence< sal_Int16 > &rSuppLanguages ) : aSvcImplName (rSvcImplName), aSuppLanguages (rSuppLanguages) { } - BOOL HasLanguage( INT16 nLanguage ) const; + sal_Bool HasLanguage( sal_Int16 nLanguage ) const; }; -BOOL SvcInfo::HasLanguage( INT16 nLanguage ) const +sal_Bool SvcInfo::HasLanguage( sal_Int16 nLanguage ) const { - INT32 nCnt = aSuppLanguages.getLength(); - const INT16 *pLang = aSuppLanguages.getConstArray(); - INT32 i; + sal_Int32 nCnt = aSuppLanguages.getLength(); + const sal_Int16 *pLang = aSuppLanguages.getConstArray(); + sal_Int32 i; for ( i = 0; i < nCnt; ++i) { @@ -195,15 +195,15 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, { // get list of nodenames to look at for their service list const char *pEntryName = 0; - BOOL bHasLangSvcList = TRUE; + sal_Bool bHasLangSvcList = sal_True; switch (rDispatcher.GetDspType()) { case LinguDispatcher::DSP_SPELL : pEntryName = "ServiceManager/SpellCheckerList"; break; case LinguDispatcher::DSP_GRAMMAR : pEntryName = "ServiceManager/GrammarCheckerList"; - bHasLangSvcList = FALSE; + bHasLangSvcList = sal_False; break; case LinguDispatcher::DSP_HYPH : pEntryName = "ServiceManager/HyphenatorList"; - bHasLangSvcList = FALSE; + bHasLangSvcList = sal_False; break; case LinguDispatcher::DSP_THES : pEntryName = "ServiceManager/ThesaurusList"; break; default : @@ -213,9 +213,9 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, uno::Sequence < OUString > aNodeNames( /*aCfg.*/GetNodeNames( aNode ) ); - INT32 nLen = aNodeNames.getLength(); + sal_Int32 nLen = aNodeNames.getLength(); const OUString *pNodeNames = aNodeNames.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Sequence< OUString > aSvcImplNames; @@ -238,7 +238,7 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, else aSvcImplNames = GetLangSvc( rValue ); - INT32 nSvcs = aSvcImplNames.getLength(); + sal_Int32 nSvcs = aSvcImplNames.getLength(); if (nSvcs) { const OUString *pImplNames = aSvcImplNames.getConstArray(); @@ -246,10 +246,10 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, LanguageType nLang = MsLangId::convertIsoStringToLanguage( pNodeNames[i] ); // build list of available services from those - INT32 nCnt = 0; + sal_Int32 nCnt = 0; uno::Sequence< OUString > aAvailSvcs( nSvcs ); OUString *pAvailSvcs = aAvailSvcs.getArray(); - for (INT32 k = 0; k < nSvcs; ++k) + for (sal_Int32 k = 0; k < nSvcs; ++k) { // check for availability of the service size_t nAvailSvcs = rAvailSvcs.size(); @@ -295,13 +295,13 @@ class LngSvcMgrListenerHelper : uno::Reference< linguistic2::XDictionaryList > xDicList; uno::Reference< uno::XInterface > xMyEvtObj; - INT16 nCombinedLngSvcEvt; + sal_Int16 nCombinedLngSvcEvt; // disallow copy-constructor and assignment-operator for now LngSvcMgrListenerHelper(const LngSvcMgrListenerHelper &); LngSvcMgrListenerHelper & operator = (const LngSvcMgrListenerHelper &); - void LaunchEvent( INT16 nLngSvcEvtFlags ); + void LaunchEvent( sal_Int16 nLngSvcEvtFlags ); // DECL_LINK( TimeOut, Timer* ); long Timeout(); @@ -327,17 +327,17 @@ public: const linguistic2::DictionaryListEvent& rDicListEvent ) throw(uno::RuntimeException); - inline BOOL AddLngSvcMgrListener( + inline sal_Bool AddLngSvcMgrListener( const uno::Reference< lang::XEventListener >& rxListener ); - inline BOOL RemoveLngSvcMgrListener( + inline sal_Bool RemoveLngSvcMgrListener( const uno::Reference< lang::XEventListener >& rxListener ); void DisposeAndClear( const lang::EventObject &rEvtObj ); - BOOL AddLngSvcEvtBroadcaster( + sal_Bool AddLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); - BOOL RemoveLngSvcEvtBroadcaster( + sal_Bool RemoveLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); - void AddLngSvcEvt( INT16 nLngSvcEvt ); + void AddLngSvcEvt( sal_Int16 nLngSvcEvt ); }; @@ -354,7 +354,7 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( if (xDicList.is()) { xDicList->addDictionaryListEventListener( - (linguistic2::XDictionaryListEventListener *) this, FALSE ); + (linguistic2::XDictionaryListEventListener *) this, sal_False ); } //! The timer is used to 'sum up' different events in order to reduce the @@ -414,7 +414,7 @@ long LngSvcMgrListenerHelper::Timeout() } -void LngSvcMgrListenerHelper::AddLngSvcEvt( INT16 nLngSvcEvt ) +void LngSvcMgrListenerHelper::AddLngSvcEvt( sal_Int16 nLngSvcEvt ) { nCombinedLngSvcEvt |= nLngSvcEvt; // aLaunchTimer.Start(); @@ -439,7 +439,7 @@ void SAL_CALL { osl::MutexGuard aGuard( GetLinguMutex() ); - INT16 nDlEvt = rDicListEvent.nCondensedEvent; + sal_Int16 nDlEvt = rDicListEvent.nCondensedEvent; if (0 == nDlEvt) return; @@ -457,9 +457,9 @@ void SAL_CALL // // "translate" DictionaryList event into linguistic2::LinguServiceEvent // - INT16 nLngSvcEvt = 0; + sal_Int16 nLngSvcEvt = 0; // - INT16 nSpellCorrectFlags = + sal_Int16 nSpellCorrectFlags = linguistic2::DictionaryListEventFlags::ADD_NEG_ENTRY | linguistic2::DictionaryListEventFlags::DEL_POS_ENTRY | linguistic2::DictionaryListEventFlags::ACTIVATE_NEG_DIC | @@ -467,7 +467,7 @@ void SAL_CALL if (0 != (nDlEvt & nSpellCorrectFlags)) nLngSvcEvt |= linguistic2::LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN; // - INT16 nSpellWrongFlags = + sal_Int16 nSpellWrongFlags = linguistic2::DictionaryListEventFlags::ADD_POS_ENTRY | linguistic2::DictionaryListEventFlags::DEL_NEG_ENTRY | linguistic2::DictionaryListEventFlags::ACTIVATE_POS_DIC | @@ -475,7 +475,7 @@ void SAL_CALL if (0 != (nDlEvt & nSpellWrongFlags)) nLngSvcEvt |= linguistic2::LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN; // - INT16 nHyphenateFlags = + sal_Int16 nHyphenateFlags = linguistic2::DictionaryListEventFlags::ADD_POS_ENTRY | linguistic2::DictionaryListEventFlags::DEL_POS_ENTRY | linguistic2::DictionaryListEventFlags::ACTIVATE_POS_DIC | @@ -490,7 +490,7 @@ void SAL_CALL } -void LngSvcMgrListenerHelper::LaunchEvent( INT16 nLngSvcEvtFlags ) +void LngSvcMgrListenerHelper::LaunchEvent( sal_Int16 nLngSvcEvtFlags ) { linguistic2::LinguServiceEvent aEvt( xMyEvtObj, nLngSvcEvtFlags ); @@ -505,19 +505,19 @@ void LngSvcMgrListenerHelper::LaunchEvent( INT16 nLngSvcEvtFlags ) } -inline BOOL LngSvcMgrListenerHelper::AddLngSvcMgrListener( +inline sal_Bool LngSvcMgrListenerHelper::AddLngSvcMgrListener( const uno::Reference< lang::XEventListener >& rxListener ) { aLngSvcMgrListeners.addInterface( rxListener ); - return TRUE; + return sal_True; } -inline BOOL LngSvcMgrListenerHelper::RemoveLngSvcMgrListener( +inline sal_Bool LngSvcMgrListenerHelper::RemoveLngSvcMgrListener( const uno::Reference< lang::XEventListener >& rxListener ) { aLngSvcMgrListeners.removeInterface( rxListener ); - return TRUE; + return sal_True; } @@ -545,10 +545,10 @@ void LngSvcMgrListenerHelper::DisposeAndClear( const lang::EventObject &rEvtObj } -BOOL LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster( +sal_Bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rxBroadcaster.is()) { aLngSvcEvtBroadcasters.addInterface( rxBroadcaster ); @@ -559,10 +559,10 @@ BOOL LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster( } -BOOL LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster( +sal_Bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rxBroadcaster.is()) { aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster ); @@ -584,7 +584,7 @@ LngSvcMgr::LngSvcMgr() : bHasAvailGrammarLocales = bHasAvailHyphLocales = bHasAvailThesLocales = - bDisposing = FALSE; + bDisposing = sal_False; pSpellDsp = 0; pGrammarDsp = 0; @@ -900,7 +900,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl() if (xSvc.is()) { OUString aImplName; - uno::Sequence< INT16 > aLanguages; + uno::Sequence< sal_Int16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) aImplName = xInfo->getImplementationName(); @@ -966,7 +966,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl() if (xSvc.is()) { OUString aImplName; - uno::Sequence< INT16 > aLanguages; + uno::Sequence< sal_Int16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) aImplName = xInfo->getImplementationName(); @@ -1031,7 +1031,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl() if (xSvc.is()) { OUString aImplName; - uno::Sequence< INT16 > aLanguages; + uno::Sequence< sal_Int16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) aImplName = xInfo->getImplementationName(); @@ -1098,7 +1098,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl() if (xSvc.is()) { OUString aImplName; - uno::Sequence< INT16 > aLanguages; + uno::Sequence< sal_Int16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) aImplName = xInfo->getImplementationName(); @@ -1127,7 +1127,7 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) String aNode( String::CreateFromAscii( "ServiceManager/SpellCheckerList" ) ); uno::Sequence< OUString > aNames( /*aCfg.*/GetNodeNames( aNode ) ); OUString *pNames = aNames.getArray(); - INT32 nLen = aNames.getLength(); + sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below String aPrefix( aNode ); @@ -1143,13 +1143,13 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) if (nLen && nLen == aValues.getLength()) { const uno::Any *pValues = aValues.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) { #if OSL_DEBUG_LEVEL > 1 -// INT32 nSvcs = aSvcImplNames.getLength(); +// sal_Int32 nSvcs = aSvcImplNames.getLength(); // const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); #endif String aLocaleStr( pNames[i] ); @@ -1170,7 +1170,7 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) String aNode( String::CreateFromAscii( "ServiceManager/GrammarCheckerList" ) ); uno::Sequence< OUString > aNames( /*aCfg.*/GetNodeNames( aNode ) ); OUString *pNames = aNames.getArray(); - INT32 nLen = aNames.getLength(); + sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below String aPrefix( aNode ); @@ -1186,7 +1186,7 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) if (nLen && nLen == aValues.getLength()) { const uno::Any *pValues = aValues.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) @@ -1196,7 +1196,7 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) aSvcImplNames.realloc(1); #if OSL_DEBUG_LEVEL > 1 -// INT32 nSvcs = aSvcImplNames.getLength(); +// sal_Int32 nSvcs = aSvcImplNames.getLength(); // const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); #endif String aLocaleStr( pNames[i] ); @@ -1217,7 +1217,7 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) String aNode( String::CreateFromAscii( "ServiceManager/HyphenatorList" ) ); uno::Sequence< OUString > aNames( /*aCfg.*/GetNodeNames( aNode ) ); OUString *pNames = aNames.getArray(); - INT32 nLen = aNames.getLength(); + sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below String aPrefix( aNode ); @@ -1233,7 +1233,7 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) if (nLen && nLen == aValues.getLength()) { const uno::Any *pValues = aValues.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) @@ -1243,7 +1243,7 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) aSvcImplNames.realloc(1); #if OSL_DEBUG_LEVEL > 1 -// INT32 nSvcs = aSvcImplNames.getLength(); +// sal_Int32 nSvcs = aSvcImplNames.getLength(); // const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); #endif String aLocaleStr( pNames[i] ); @@ -1264,7 +1264,7 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) String aNode( String::CreateFromAscii( "ServiceManager/ThesaurusList" ) ); uno::Sequence< OUString > aNames( /*aCfg.*/GetNodeNames( aNode ) ); OUString *pNames = aNames.getArray(); - INT32 nLen = aNames.getLength(); + sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below String aPrefix( aNode ); @@ -1280,13 +1280,13 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) if (nLen && nLen == aValues.getLength()) { const uno::Any *pValues = aValues.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) { #if OSL_DEBUG_LEVEL > 1 -// INT32 nSvcs = aSvcImplNames.getLength(); +// sal_Int32 nSvcs = aSvcImplNames.getLength(); // const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); #endif String aLocaleStr( pNames[i] ); @@ -1367,7 +1367,7 @@ sal_Bool SAL_CALL { osl::MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!bDisposing && xListener.is()) { if (!pListenerHelper) @@ -1385,7 +1385,7 @@ sal_Bool SAL_CALL { osl::MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (!bDisposing && xListener.is()) { DBG_ASSERT( pListenerHelper, "listener removed without being added" ); @@ -1448,7 +1448,7 @@ uno::Sequence< OUString > SAL_CALL aRes.realloc( nMaxCnt ); OUString *pImplName = aRes.getArray(); - USHORT nCnt = 0; + sal_uInt16 nCnt = 0; LanguageType nLanguage = LocaleToLanguage( rLocale ); for (size_t i = 0; i < nMaxCnt; ++i) { @@ -1479,7 +1479,7 @@ uno::Sequence< lang::Locale > SAL_CALL uno::Sequence< lang::Locale > aRes; uno::Sequence< lang::Locale > *pAvailLocales = NULL; - BOOL *pHasAvailLocales = NULL; + sal_Bool *pHasAvailLocales = NULL; if (0 == rServiceName.compareToAscii( SN_SPELLCHECKER )) { pAvailLocales = &aAvailSpellLocales; @@ -1510,7 +1510,7 @@ uno::Sequence< lang::Locale > SAL_CALL // { *pAvailLocales = GetAvailLocales( getAvailableServices( rServiceName, lang::Locale() ) ); -// *pHasAvailLocales = TRUE; +// *pHasAvailLocales = sal_True; // } aRes = *pAvailLocales; } @@ -1518,22 +1518,22 @@ uno::Sequence< lang::Locale > SAL_CALL return aRes; } -static BOOL IsEqSvcList( const uno::Sequence< OUString > &rList1, +static sal_Bool IsEqSvcList( const uno::Sequence< OUString > &rList1, const uno::Sequence< OUString > &rList2 ) { - // returns TRUE iff both sequences are equal + // returns sal_True iff both sequences are equal - BOOL bRes = FALSE; - INT32 nLen = rList1.getLength(); + sal_Bool bRes = sal_False; + sal_Int32 nLen = rList1.getLength(); if (rList2.getLength() == nLen) { const OUString *pStr1 = rList1.getConstArray(); const OUString *pStr2 = rList2.getConstArray(); - bRes = TRUE; - for (INT32 i = 0; i < nLen && bRes; ++i) + bRes = sal_True; + for (sal_Int32 i = 0; i < nLen && bRes; ++i) { if (*pStr1++ != *pStr2++) - bRes = FALSE; + bRes = sal_False; } } return bRes; @@ -1562,7 +1562,7 @@ void SAL_CALL { if (!xSpellDsp.is()) GetSpellCheckerDsp_Impl(); - BOOL bChanged = !IsEqSvcList( rServiceImplNames, + sal_Bool bChanged = !IsEqSvcList( rServiceImplNames, pSpellDsp->GetServiceList( rLocale ) ); if (bChanged) { @@ -1579,7 +1579,7 @@ void SAL_CALL { if (!xGrammarDsp.is()) GetGrammarCheckerDsp_Impl(); - BOOL bChanged = !IsEqSvcList( rServiceImplNames, + sal_Bool bChanged = !IsEqSvcList( rServiceImplNames, pGrammarDsp->GetServiceList( rLocale ) ); if (bChanged) { @@ -1595,7 +1595,7 @@ void SAL_CALL { if (!xHyphDsp.is()) GetHyphenatorDsp_Impl(); - BOOL bChanged = !IsEqSvcList( rServiceImplNames, + sal_Bool bChanged = !IsEqSvcList( rServiceImplNames, pHyphDsp->GetServiceList( rLocale ) ); if (bChanged) { @@ -1611,7 +1611,7 @@ void SAL_CALL { if (!xThesDsp.is()) GetThesaurusDsp_Impl(); - BOOL bChanged = !IsEqSvcList( rServiceImplNames, + sal_Bool bChanged = !IsEqSvcList( rServiceImplNames, pThesDsp->GetServiceList( rLocale ) ); if (bChanged) { @@ -1623,11 +1623,11 @@ void SAL_CALL } -BOOL LngSvcMgr::SaveCfgSvcs( const String &rServiceName ) +sal_Bool LngSvcMgr::SaveCfgSvcs( const String &rServiceName ) { RTL_LOGFILE_CONTEXT( aLog, "linguistic: LngSvcMgr::SaveCfgSvcs" ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; LinguDispatcher *pDsp = 0; uno::Sequence< lang::Locale > aLocales; @@ -1663,7 +1663,7 @@ BOOL LngSvcMgr::SaveCfgSvcs( const String &rServiceName ) if (pDsp && aLocales.getLength()) { - INT32 nLen = aLocales.getLength(); + sal_Int32 nLen = aLocales.getLength(); const lang::Locale *pLocale = aLocales.getConstArray(); uno::Sequence< beans::PropertyValue > aValues( nLen ); @@ -1686,15 +1686,15 @@ BOOL LngSvcMgr::SaveCfgSvcs( const String &rServiceName ) } OUString aNodeName( A2OU(pNodeName) ); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { uno::Sequence< OUString > aSvcImplNames; aSvcImplNames = pDsp->GetServiceList( pLocale[i] ); #if OSL_DEBUG_LEVEL > 1 - INT32 nSvcs = aSvcImplNames.getLength(); + sal_Int32 nSvcs = aSvcImplNames.getLength(); const OUString *pSvcImplName = aSvcImplNames.getConstArray(); - for (INT32 j = 0; j < nSvcs; ++j) + for (sal_Int32 j = 0; j < nSvcs; ++j) { OUString aImplName( pSvcImplName[j] ); } @@ -1733,11 +1733,11 @@ static uno::Sequence< OUString > GetLangSvcList( const uno::Any &rVal ) { rVal >>= aRes; #if OSL_DEBUG_LEVEL > 1 - INT32 nSvcs = aRes.getLength(); + sal_Int32 nSvcs = aRes.getLength(); if (nSvcs) { const OUString *pSvcName = aRes.getConstArray(); - for (INT32 j = 0; j < nSvcs; ++j) + for (sal_Int32 j = 0; j < nSvcs; ++j) { OUString aImplName( pSvcName[j] ); DBG_ASSERT( aImplName.getLength(), "service impl-name missing" ); @@ -1879,7 +1879,7 @@ void SAL_CALL if (!bDisposing) { - bDisposing = TRUE; + bDisposing = sal_True; // require listeners to release this object lang::EventObject aEvtObj( (XLinguServiceManager *) this ); @@ -1919,10 +1919,10 @@ void SAL_CALL } -BOOL LngSvcMgr::AddLngSvcEvtBroadcaster( +sal_Bool LngSvcMgr::AddLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rxBroadcaster.is()) { if (!pListenerHelper) @@ -1933,10 +1933,10 @@ BOOL LngSvcMgr::AddLngSvcEvtBroadcaster( } -BOOL LngSvcMgr::RemoveLngSvcEvtBroadcaster( +sal_Bool LngSvcMgr::RemoveLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rxBroadcaster.is()) { DBG_ASSERT( pListenerHelper, "pListenerHelper non existent" ); @@ -1965,10 +1965,10 @@ sal_Bool SAL_CALL uno::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; } diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 1fd74d08acd1..9116b36f767b 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -112,11 +112,11 @@ class LngSvcMgr : SvcInfoArray * pAvailHyphSvcs; SvcInfoArray * pAvailThesSvcs; - BOOL bDisposing; - BOOL bHasAvailSpellLocales; - BOOL bHasAvailGrammarLocales; - BOOL bHasAvailHyphLocales; - BOOL bHasAvailThesLocales; + sal_Bool bDisposing; + sal_Bool bHasAvailSpellLocales; + sal_Bool bHasAvailGrammarLocales; + sal_Bool bHasAvailHyphLocales; + sal_Bool bHasAvailThesLocales; // disallow copy-constructor and assignment-operator for now LngSvcMgr(const LngSvcMgr &); @@ -138,7 +138,7 @@ class LngSvcMgr : void SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ); void SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ); - BOOL SaveCfgSvcs( const String &rServiceName ); + sal_Bool SaveCfgSvcs( const String &rServiceName ); void SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, const SvcInfoArray &rAvailSvcs ); @@ -180,10 +180,10 @@ public: static inline ::rtl::OUString getImplementationName_Static(); static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); - BOOL AddLngSvcEvtBroadcaster( + sal_Bool AddLngSvcEvtBroadcaster( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); - BOOL RemoveLngSvcEvtBroadcaster( + sal_Bool RemoveLngSvcEvtBroadcaster( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); }; diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk index 9bbd456ce89d..49dedeec3e82 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -29,7 +29,7 @@ PRJ=.. PRJNAME=linguistic TARGET=lng -ENABLE_EXCEPTIONS=TRUE +ENABLE_EXCEPTIONS=sal_True #----- Settings --------------------------------------------------------- diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 25c2a7f6b374..f0a26ca50f09 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -86,7 +86,7 @@ osl::Mutex & GetLinguMutex() /////////////////////////////////////////////////////////////////////////// -LocaleDataWrapper & GetLocaleDataWrapper( INT16 nLang ) +LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang ) { static LocaleDataWrapper aLclDtaWrp( getProcessServiceFactory(), @@ -106,10 +106,10 @@ LocaleDataWrapper & GetLocaleDataWrapper( INT16 nLang ) /** returns text-encoding used for ByteString unicode String conversion */ -rtl_TextEncoding GetTextEncoding( INT16 nLanguage ) +rtl_TextEncoding GetTextEncoding( sal_Int16 nLanguage ) { DBG_ASSERT( nLanguage != LANGUAGE_NONE, "invalid language argument" ); - static INT16 nLastLanguage = LANGUAGE_NONE; + static sal_Int16 nLastLanguage = LANGUAGE_NONE; // set default value for unknown languages static rtl_TextEncoding nEncoding = RTL_TEXTENCODING_DONTKNOW; @@ -265,14 +265,14 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 ) /////////////////////////////////////////////////////////////////////////// -BOOL IsUseDicList( const PropertyValues &rProperties, +sal_Bool IsUseDicList( const PropertyValues &rProperties, const uno::Reference< XPropertySet > &rxProp ) { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; - INT32 nLen = rProperties.getLength(); + sal_Int32 nLen = rProperties.getLength(); const PropertyValue *pVal = rProperties.getConstArray(); - INT32 i; + sal_Int32 i; for ( i = 0; i < nLen; ++i) { @@ -293,14 +293,14 @@ BOOL IsUseDicList( const PropertyValues &rProperties, } -BOOL IsIgnoreControlChars( const PropertyValues &rProperties, +sal_Bool IsIgnoreControlChars( const PropertyValues &rProperties, const uno::Reference< XPropertySet > &rxProp ) { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; - INT32 nLen = rProperties.getLength(); + sal_Int32 nLen = rProperties.getLength(); const PropertyValue *pVal = rProperties.getConstArray(); - INT32 i; + sal_Int32 i; for ( i = 0; i < nLen; ++i) { @@ -321,9 +321,9 @@ BOOL IsIgnoreControlChars( const PropertyValues &rProperties, } -static BOOL lcl_HasHyphInfo( const uno::Reference<XDictionaryEntry> &xEntry ) +static sal_Bool lcl_HasHyphInfo( const uno::Reference<XDictionaryEntry> &xEntry ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xEntry.is()) { // there has to be (at least one) '=' denoting a hyphenation position @@ -337,8 +337,8 @@ static BOOL lcl_HasHyphInfo( const uno::Reference<XDictionaryEntry> &xEntry ) uno::Reference< XDictionaryEntry > SearchDicList( const uno::Reference< XDictionaryList > &xDicList, - const OUString &rWord, INT16 nLanguage, - BOOL bSearchPosDics, BOOL bSearchSpellEntry ) + const OUString &rWord, sal_Int16 nLanguage, + sal_Bool bSearchPosDics, sal_Bool bSearchSpellEntry ) { MutexGuard aGuard( GetLinguMutex() ); @@ -351,15 +351,15 @@ uno::Reference< XDictionaryEntry > SearchDicList( aDics( xDicList->getDictionaries() ); const uno::Reference< XDictionary > *pDic = aDics.getConstArray(); - INT32 nDics = xDicList->getCount(); + sal_Int32 nDics = xDicList->getCount(); - INT32 i; + sal_Int32 i; for (i = 0; i < nDics; i++) { uno::Reference< XDictionary > axDic( pDic[i], UNO_QUERY ); DictionaryType eType = axDic->getDictionaryType(); - INT16 nLang = LocaleToLanguage( axDic->getLocale() ); + sal_Int16 nLang = LocaleToLanguage( axDic->getLocale() ); if ( axDic.is() && axDic->isActive() && (nLang == nLanguage || nLang == LANGUAGE_NONE) ) @@ -393,8 +393,8 @@ sal_Bool SaveDictionaries( const uno::Reference< XDictionaryList > &xDicList ) Sequence< uno::Reference< XDictionary > > aDics( xDicList->getDictionaries() ); const uno::Reference< XDictionary > *pDic = aDics.getConstArray(); - INT32 nCount = aDics.getLength(); - for (INT32 i = 0; i < nCount; i++) + sal_Int32 nCount = aDics.getLength(); + for (sal_Int32 i = 0; i < nCount; i++) { try { @@ -485,14 +485,14 @@ Locale CreateLocale( LanguageType eLang ) return aLocale; } -uno::Sequence< Locale > LangSeqToLocaleSeq( const uno::Sequence< INT16 > &rLangSeq ) +uno::Sequence< Locale > LangSeqToLocaleSeq( const uno::Sequence< sal_Int16 > &rLangSeq ) { - const INT16 *pLang = rLangSeq.getConstArray(); - INT32 nCount = rLangSeq.getLength(); + const sal_Int16 *pLang = rLangSeq.getConstArray(); + sal_Int32 nCount = rLangSeq.getLength(); uno::Sequence< Locale > aLocales( nCount ); Locale *pLocale = aLocales.getArray(); - for (INT32 i = 0; i < nCount; ++i) + for (sal_Int32 i = 0; i < nCount; ++i) { LanguageToLocale( pLocale[i], pLang[ i ] ); } @@ -500,15 +500,15 @@ uno::Sequence< Locale > LangSeqToLocaleSeq( const uno::Sequence< INT16 > &rLangS return aLocales; } -uno::Sequence< INT16 > +uno::Sequence< sal_Int16 > LocaleSeqToLangSeq( uno::Sequence< Locale > &rLocaleSeq ) { const Locale *pLocale = rLocaleSeq.getConstArray(); - INT32 nCount = rLocaleSeq.getLength(); + sal_Int32 nCount = rLocaleSeq.getLength(); - uno::Sequence< INT16 > aLangs( nCount ); - INT16 *pLang = aLangs.getArray(); - for (INT32 i = 0; i < nCount; ++i) + uno::Sequence< sal_Int16 > aLangs( nCount ); + sal_Int16 *pLang = aLangs.getArray(); + for (sal_Int32 i = 0; i < nCount; ++i) { pLang[i] = LocaleToLanguage( pLocale[i] ); } @@ -518,10 +518,10 @@ uno::Sequence< INT16 > /////////////////////////////////////////////////////////////////////////// -BOOL IsReadOnly( const String &rURL, BOOL *pbExist ) +sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist ) { - BOOL bRes = FALSE; - BOOL bExists = FALSE; + sal_Bool bRes = sal_False; + sal_Bool bExists = sal_False; if (rURL.Len() > 0) { @@ -539,7 +539,7 @@ BOOL IsReadOnly( const String &rURL, BOOL *pbExist ) } catch (Exception &) { - bRes = TRUE; + bRes = sal_True; } } @@ -551,16 +551,16 @@ BOOL IsReadOnly( const String &rURL, BOOL *pbExist ) /////////////////////////////////////////////////////////////////////////// -static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, +static sal_Bool GetAltSpelling( sal_Int16 &rnChgPos, sal_Int16 &rnChgLen, OUString &rRplc, uno::Reference< XHyphenatedWord > &rxHyphWord ) { - BOOL bRes = rxHyphWord->isAlternativeSpelling(); + sal_Bool bRes = rxHyphWord->isAlternativeSpelling(); if (bRes) { OUString aWord( rxHyphWord->getWord() ), aHyphenatedWord( rxHyphWord->getHyphenatedWord() ); - INT16 nHyphenationPos = rxHyphWord->getHyphenationPos(); - /*INT16 nHyphenPos = rxHyphWord->getHyphenPos()*/; + sal_Int16 nHyphenationPos = rxHyphWord->getHyphenationPos(); + /*sal_Int16 nHyphenPos = rxHyphWord->getHyphenPos()*/; const sal_Unicode *pWord = aWord.getStr(), *pAltWord = aHyphenatedWord.getStr(); @@ -574,7 +574,7 @@ static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, // find first different char from left sal_Int32 nPosL = 0, nAltPosL = 0; - for (INT16 i = 0 ; pWord[ nPosL ] == pAltWord[ nAltPosL ]; nPosL++, nAltPosL++, i++) + for (sal_Int16 i = 0 ; pWord[ nPosL ] == pAltWord[ nAltPosL ]; nPosL++, nAltPosL++, i++) { // restrict changes area beginning to the right to // the char immediately following the hyphen. @@ -592,8 +592,8 @@ static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, nPosR--, nAltPosR--) ; - rnChgPos = sal::static_int_cast< INT16 >(nPosL); - rnChgLen = sal::static_int_cast< INT16 >(nPosR - nPosL + 1); + rnChgPos = sal::static_int_cast< sal_Int16 >(nPosL); + rnChgLen = sal::static_int_cast< sal_Int16 >(nPosR - nPosL + 1); DBG_ASSERT( rnChgLen >= 0, "nChgLen < 0"); sal_Int32 nTxtStart = nPosL; @@ -604,32 +604,32 @@ static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, } -static INT16 GetOrigWordPos( const OUString &rOrigWord, INT16 nPos ) +static sal_Int16 GetOrigWordPos( const OUString &rOrigWord, sal_Int16 nPos ) { - INT32 nLen = rOrigWord.getLength(); - INT32 i = -1; + sal_Int32 nLen = rOrigWord.getLength(); + sal_Int32 i = -1; while (nPos >= 0 && i++ < nLen) { sal_Unicode cChar = rOrigWord[i]; - BOOL bSkip = IsHyphen( cChar ) || IsControlChar( cChar ); + sal_Bool bSkip = IsHyphen( cChar ) || IsControlChar( cChar ); if (!bSkip) --nPos; } - return sal::static_int_cast< INT16 >((0 <= i && i < nLen) ? i : -1); + return sal::static_int_cast< sal_Int16 >((0 <= i && i < nLen) ? i : -1); } -INT32 GetPosInWordToCheck( const OUString &rTxt, INT32 nPos ) +sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPos ) { - INT32 nRes = -1; - INT32 nLen = rTxt.getLength(); + sal_Int32 nRes = -1; + sal_Int32 nLen = rTxt.getLength(); if (0 <= nPos && nPos < nLen) { nRes = 0; - for (INT32 i = 0; i < nPos; ++i) + for (sal_Int32 i = 0; i < nPos; ++i) { sal_Unicode cChar = rTxt[i]; - BOOL bSkip = IsHyphen( cChar ) || IsControlChar( cChar ); + sal_Bool bSkip = IsHyphen( cChar ) || IsControlChar( cChar ); if (!bSkip) ++nRes; } @@ -645,17 +645,17 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( uno::Reference< XHyphenatedWord > xRes; if (rOrigWord.getLength() && rxHyphWord.is()) { - INT16 nChgPos = 0, + sal_Int16 nChgPos = 0, nChgLen = 0; OUString aRplc; - BOOL bAltSpelling = GetAltSpelling( nChgPos, nChgLen, aRplc, rxHyphWord ); + sal_Bool bAltSpelling = GetAltSpelling( nChgPos, nChgLen, aRplc, rxHyphWord ); #if OSL_DEBUG_LEVEL > 1 OUString aWord( rxHyphWord->getWord() ); #endif OUString aOrigHyphenatedWord; - INT16 nOrigHyphenPos = -1; - INT16 nOrigHyphenationPos = -1; + sal_Int16 nOrigHyphenPos = -1; + sal_Int16 nOrigHyphenationPos = -1; if (!bAltSpelling) { aOrigHyphenatedWord = rOrigWord; @@ -668,10 +668,10 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( //! B�-c-k-er and Sc-hif-fah-rt OUString aLeft, aRight; - INT16 nPos = GetOrigWordPos( rOrigWord, nChgPos ); + sal_Int16 nPos = GetOrigWordPos( rOrigWord, nChgPos ); // get words like Sc-hif-fah-rt to work correct - INT16 nHyphenationPos = rxHyphWord->getHyphenationPos(); + sal_Int16 nHyphenationPos = rxHyphWord->getHyphenationPos(); if (nChgPos > nHyphenationPos) --nPos; @@ -682,7 +682,7 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( aOrigHyphenatedWord += aRplc; aOrigHyphenatedWord += aRight; - nOrigHyphenPos = sal::static_int_cast< INT16 >(aLeft.getLength() + + nOrigHyphenPos = sal::static_int_cast< sal_Int16 >(aLeft.getLength() + rxHyphWord->getHyphenPos() - nChgPos); nOrigHyphenationPos = GetOrigWordPos( rOrigWord, nHyphenationPos ); } @@ -693,7 +693,7 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( } else { - INT16 nLang = LocaleToLanguage( rxHyphWord->getLocale() ); + sal_Int16 nLang = LocaleToLanguage( rxHyphWord->getLocale() ); xRes = new HyphenatedWord( rOrigWord, nLang, nOrigHyphenationPos, aOrigHyphenatedWord, nOrigHyphenPos ); @@ -721,7 +721,7 @@ osl::Mutex & lcl_GetCharClassMutex() } -BOOL IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLanguage ) +sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -733,7 +733,7 @@ BOOL IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLang } -BOOL IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLanguage ) +sal_Bool IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -745,7 +745,7 @@ BOOL IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLang } -String ToLower( const String &rText, INT16 nLanguage ) +String ToLower( const String &rText, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -755,7 +755,7 @@ String ToLower( const String &rText, INT16 nLanguage ) } -String ToUpper( const String &rText, INT16 nLanguage ) +String ToUpper( const String &rText, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -765,7 +765,7 @@ String ToUpper( const String &rText, INT16 nLanguage ) } -String ToTitle( const String &rText, INT16 nLanguage ) +String ToTitle( const String &rText, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -775,7 +775,7 @@ String ToTitle( const String &rText, INT16 nLanguage ) } -sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ) +sal_Unicode ToLower( const sal_Unicode cChar, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -785,7 +785,7 @@ sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ) } -sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage ) +sal_Unicode ToUpper( const sal_Unicode cChar, sal_Int16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -833,7 +833,7 @@ static const sal_uInt32 the_aDigitZeroes [] = 0x0001D7CE //1D7FF ; Decimal # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE }; -BOOL HasDigits( const OUString &rText ) +sal_Bool HasDigits( const OUString &rText ) { static const int nNumDigitZeroes = sizeof(the_aDigitZeroes) / sizeof(the_aDigitZeroes[0]); const sal_Int32 nLen = rText.getLength(); @@ -848,27 +848,27 @@ BOOL HasDigits( const OUString &rText ) if (nDigitZero > nCodePoint) break; if (/*nDigitZero <= nCodePoint &&*/ nCodePoint <= nDigitZero + 9) - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } -BOOL IsNumeric( const String &rText ) +sal_Bool IsNumeric( const String &rText ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; xub_StrLen nLen = rText.Len(); if (nLen) { - bRes = TRUE; + bRes = sal_True; xub_StrLen i = 0; while (i < nLen) { sal_Unicode cChar = rText.GetChar( i++ ); if ( !((sal_Unicode)'0' <= cChar && cChar <= (sal_Unicode)'9') ) { - bRes = FALSE; + bRes = sal_False; break; } } diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index 9c02a976fcbd..dbfbd19f3f55 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -53,9 +53,9 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -BOOL FileExists( const String &rMainURL ) +sal_Bool FileExists( const String &rMainURL ) { - BOOL bExists = FALSE; + sal_Bool bExists = sal_False; if (rMainURL.Len()) { try @@ -93,7 +93,7 @@ String GetFileURL( SvtPathOptions::Pathes ePath, const String &rFileName ) } -String GetModulePath( SvtPathOptions::Pathes ePath, BOOL bAddAccessDelim ) +String GetModulePath( SvtPathOptions::Pathes ePath, sal_Bool bAddAccessDelim ) { String aRes; @@ -268,11 +268,11 @@ String SearchFileInPaths( const sal_Int32 nPaths = rPaths.getLength(); for (sal_Int32 k = 0; k < nPaths; ++k) { - BOOL bIsURL = TRUE; + sal_Bool bIsURL = sal_True; INetURLObject aObj( rPaths[k] ); if ( aObj.HasError() ) { - bIsURL = FALSE; + bIsURL = sal_False; String aURL; if ( utl::LocalFileHelper::ConvertPhysicalNameToURL( rPaths[k], aURL ) ) aObj.SetURL( aURL ); diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 9f1f969f7237..6cc73236a5de 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -71,7 +71,7 @@ class ProposalList { std::vector< OUString > aVec; - BOOL HasEntry( const OUString &rText ) const; + sal_Bool HasEntry( const OUString &rText ) const; // make copy c-tor and assignment operator private ProposalList( const ProposalList & ); @@ -91,14 +91,14 @@ public: }; -BOOL ProposalList::HasEntry( const OUString &rText ) const +sal_Bool ProposalList::HasEntry( const OUString &rText ) const { - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; size_t nCnt = aVec.size(); for (size_t i = 0; !bFound && i < nCnt; ++i) { if (aVec[i] == rText) - bFound = TRUE; + bFound = sal_True; } return bFound; } @@ -128,9 +128,9 @@ void ProposalList::Append( const std::vector< OUString > &rNew ) void ProposalList::Append( const Sequence< OUString > &rNew ) { - INT32 nLen = rNew.getLength(); + sal_Int32 nLen = rNew.getLength(); const OUString *pNew = rNew.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { const OUString &rText = pNew[i]; if (!HasEntry( rText )) @@ -154,12 +154,12 @@ size_t ProposalList::Count() const Sequence< OUString > ProposalList::GetSequence() const { - INT32 nCount = Count(); - INT32 nIdx = 0; + sal_Int32 nCount = Count(); + sal_Int32 nIdx = 0; Sequence< OUString > aRes( nCount ); OUString *pRes = aRes.getArray(); - INT32 nLen = aVec.size(); - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nLen = aVec.size(); + for (sal_Int32 i = 0; i < nLen; ++i) { const OUString &rText = aVec[i]; DBG_ASSERT( nIdx < nCount, "index our of range" ); @@ -186,16 +186,16 @@ void ProposalList::Remove( const OUString &rText ) /////////////////////////////////////////////////////////////////////////// -BOOL SvcListHasLanguage( +sal_Bool SvcListHasLanguage( const LangSvcEntries_Spell &rEntry, LanguageType nLanguage ) { - BOOL bHasLanguage = FALSE; + sal_Bool bHasLanguage = sal_False; Locale aTmpLocale; const Reference< XSpellChecker > *pRef = rEntry.aSvcRefs .getConstArray(); sal_Int32 nLen = rEntry.aSvcRefs.getLength(); - for (INT32 k = 0; k < nLen && !bHasLanguage; ++k) + for (sal_Int32 k = 0; k < nLen && !bHasLanguage; ++k) { if (pRef[k].is()) { @@ -264,7 +264,7 @@ sal_Bool SAL_CALL throw(IllegalArgumentException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return isValid_Impl( rWord, LocaleToLanguage( rLocale ), rProperties, TRUE ); + return isValid_Impl( rWord, LocaleToLanguage( rLocale ), rProperties, sal_True ); } @@ -274,7 +274,7 @@ Reference< XSpellAlternatives > SAL_CALL throw(IllegalArgumentException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return spell_Impl( rWord, LocaleToLanguage( rLocale ), rProperties, TRUE ); + return spell_Impl( rWord, LocaleToLanguage( rLocale ), rProperties, sal_True ); } @@ -296,13 +296,13 @@ static Reference< XDictionaryEntry > lcl_GetRulingDictionaryEntry( { Reference< XDictionaryList > xDList( GetDictionaryList() ); Reference< XDictionaryEntry > xNegEntry( SearchDicList( xDList, - rWord, nLanguage, FALSE, TRUE ) ); + rWord, nLanguage, sal_False, sal_True ) ); if (xNegEntry.is()) xRes = xNegEntry; else { Reference< XDictionaryEntry > xPosEntry( SearchDicList( xDList, - rWord, nLanguage, TRUE, TRUE ) ); + rWord, nLanguage, sal_True, sal_True ) ); if (xPosEntry.is()) xRes = xPosEntry; } @@ -312,16 +312,16 @@ static Reference< XDictionaryEntry > lcl_GetRulingDictionaryEntry( } -BOOL SpellCheckerDispatcher::isValid_Impl( +sal_Bool SpellCheckerDispatcher::isValid_Impl( const OUString& rWord, LanguageType nLanguage, const PropertyValues& rProperties, - BOOL bCheckDics) + sal_Bool bCheckDics) throw( RuntimeException, IllegalArgumentException ) { MutexGuard aGuard( GetLinguMutex() ); - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if (nLanguage == LANGUAGE_NONE || !rWord.getLength()) return bRes; @@ -351,24 +351,24 @@ BOOL SpellCheckerDispatcher::isValid_Impl( if (IsIgnoreControlChars( rProperties, GetPropSet() )) RemoveControlChars( aChkWord ); - INT32 nLen = pEntry->aSvcRefs.getLength(); + sal_Int32 nLen = pEntry->aSvcRefs.getLength(); DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), "lng : sequence length mismatch"); DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; - BOOL bTmpRes = TRUE; - BOOL bTmpResValid = FALSE; + sal_Int32 i = 0; + sal_Bool bTmpRes = sal_True; + sal_Bool bTmpResValid = sal_False; // try already instantiated services first { const Reference< XSpellChecker > *pRef = pEntry->aSvcRefs.getConstArray(); while (i <= pEntry->nLastTriedSvcIndex - && (!bTmpResValid || FALSE == bTmpRes)) + && (!bTmpResValid || sal_False == bTmpRes)) { - bTmpResValid = TRUE; + bTmpResValid = sal_True; if (pRef[i].is() && pRef[i]->hasLocale( aLocale )) { bTmpRes = GetCache().CheckWord( aChkWord, nLanguage ); @@ -384,7 +384,7 @@ BOOL SpellCheckerDispatcher::isValid_Impl( } } else - bTmpResValid = FALSE; + bTmpResValid = sal_False; if (bTmpResValid) bRes = bTmpRes; @@ -394,7 +394,7 @@ BOOL SpellCheckerDispatcher::isValid_Impl( } // if still no result instantiate new services and try those - if ((!bTmpResValid || FALSE == bTmpRes) + if ((!bTmpResValid || sal_False == bTmpRes) && pEntry->nLastTriedSvcIndex < nLen - 1) { const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); @@ -410,7 +410,7 @@ BOOL SpellCheckerDispatcher::isValid_Impl( //! thus the service needs not to now about it //aArgs.getArray()[1] <<= GetDicList(); - while (i < nLen && (!bTmpResValid || FALSE == bTmpRes)) + while (i < nLen && (!bTmpResValid || sal_False == bTmpRes)) { // create specific service via it's implementation name Reference< XSpellChecker > xSpell; @@ -431,7 +431,7 @@ BOOL SpellCheckerDispatcher::isValid_Impl( if (xBroadcaster.is()) rMgr.AddLngSvcEvtBroadcaster( xBroadcaster ); - bTmpResValid = TRUE; + bTmpResValid = sal_True; if (xSpell.is() && xSpell->hasLocale( aLocale )) { bTmpRes = GetCache().CheckWord( aChkWord, nLanguage ); @@ -447,12 +447,12 @@ BOOL SpellCheckerDispatcher::isValid_Impl( } } else - bTmpResValid = FALSE; + bTmpResValid = sal_False; if (bTmpResValid) bRes = bTmpRes; - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; } @@ -484,7 +484,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( const OUString& rWord, LanguageType nLanguage, const PropertyValues& rProperties, - BOOL bCheckDics ) + sal_Bool bCheckDics ) throw(IllegalArgumentException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -519,15 +519,15 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( if (IsIgnoreControlChars( rProperties, GetPropSet() )) RemoveControlChars( aChkWord ); - INT32 nLen = pEntry->aSvcRefs.getLength(); + sal_Int32 nLen = pEntry->aSvcRefs.getLength(); DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), "lng : sequence length mismatch"); DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; Reference< XSpellAlternatives > xTmpRes; - BOOL bTmpResValid = FALSE; + sal_Bool bTmpResValid = sal_False; // try already instantiated services first { @@ -536,10 +536,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( while (i <= pEntry->nLastTriedSvcIndex && (!bTmpResValid || xTmpRes.is()) ) { - bTmpResValid = TRUE; + bTmpResValid = sal_True; if (pRef[i].is() && pRef[i]->hasLocale( aLocale )) { - BOOL bOK = GetCache().CheckWord( aChkWord, nLanguage ); + sal_Bool bOK = GetCache().CheckWord( aChkWord, nLanguage ); if (bOK) xTmpRes = NULL; else @@ -554,7 +554,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( } } else - bTmpResValid = FALSE; + bTmpResValid = sal_False; // return first found result if the word is not known by any checker. // But if that result has no suggestions use the first one that does @@ -618,10 +618,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( if (xBroadcaster.is()) rMgr.AddLngSvcEvtBroadcaster( xBroadcaster ); - bTmpResValid = TRUE; + bTmpResValid = sal_True; if (xSpell.is() && xSpell->hasLocale( aLocale )) { - BOOL bOK = GetCache().CheckWord( aChkWord, nLanguage ); + sal_Bool bOK = GetCache().CheckWord( aChkWord, nLanguage ); if (bOK) xTmpRes = NULL; else @@ -636,7 +636,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( } } else - bTmpResValid = FALSE; + bTmpResValid = sal_False; // return first found result if the word is not known by any checker. // But if that result has no suggestions use the first one that does @@ -657,7 +657,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( nNumSugestions = nTmpNumSugestions; } - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; } @@ -680,7 +680,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( // neagtive dictionaries) ProposalList aProposalList; // Sequence< OUString > aProposals; - INT16 eFailureType = -1; // no failure + sal_Int16 eFailureType = -1; // no failure if (xRes.is()) { aProposalList.Append( xRes->getAlternatives() ); @@ -706,7 +706,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( // replacement text must not be in negative dictionary itself if (aAddRplcTxt.getLength() && - !SearchDicList( xDList, aAddRplcTxt, nLanguage, FALSE, TRUE ).is()) + !SearchDicList( xDList, aAddRplcTxt, nLanguage, sal_False, sal_True ).is()) { aProposalList.Prepend( aAddRplcTxt ); } @@ -764,7 +764,7 @@ throw (uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); uno::Sequence< Locale > aTmp( getLocales() ); - uno::Sequence< INT16 > aRes( LocaleSeqToLangSeq( aTmp ) ); + uno::Sequence< sal_Int16 > aRes( LocaleSeqToLangSeq( aTmp ) ); return aRes; } @@ -811,9 +811,9 @@ void SpellCheckerDispatcher::SetServiceList( const Locale &rLocale, if (pCache) pCache->Flush(); // new services may spell differently... - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); - INT32 nLen = rSvcImplNames.getLength(); + sal_Int32 nLen = rSvcImplNames.getLength(); if (0 == nLen) // remove entry aSvcMap.erase( nLanguage ); @@ -845,7 +845,7 @@ Sequence< OUString > Sequence< OUString > aRes; // search for entry with that language and use data from that - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this; const SpellSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); const LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; diff --git a/linguistic/source/spelldsp.hxx b/linguistic/source/spelldsp.hxx index 7ae83d3dbc6f..99c8eeefbc6b 100644 --- a/linguistic/source/spelldsp.hxx +++ b/linguistic/source/spelldsp.hxx @@ -90,16 +90,16 @@ class SpellCheckerDispatcher : void ClearSvcList(); - BOOL isValid_Impl(const ::rtl::OUString& aWord, LanguageType nLanguage, + sal_Bool isValid_Impl(const ::rtl::OUString& aWord, LanguageType nLanguage, const ::com::sun::star::beans::PropertyValues& aProperties, - BOOL bCheckDics) + sal_Bool bCheckDics) throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > spell_Impl(const ::rtl::OUString& aWord, LanguageType nLanguage, const ::com::sun::star::beans::PropertyValues& aProperties, - BOOL bCheckDics) + sal_Bool bCheckDics) throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); public: diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index fb4c11c892c6..158ff9073d56 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -70,23 +70,23 @@ Reference< XSpellAlternatives > MergeProposals( xMerged = rxAlt1; else { - INT32 nAltCount1 = rxAlt1->getAlternativesCount(); + sal_Int32 nAltCount1 = rxAlt1->getAlternativesCount(); Sequence< OUString > aAlt1( rxAlt1->getAlternatives() ); const OUString *pAlt1 = aAlt1.getConstArray(); - INT32 nAltCount2 = rxAlt2->getAlternativesCount(); + sal_Int32 nAltCount2 = rxAlt2->getAlternativesCount(); Sequence< OUString > aAlt2( rxAlt2->getAlternatives() ); const OUString *pAlt2 = aAlt2.getConstArray(); - INT32 nCountNew = Min( nAltCount1 + nAltCount2, (INT32) MAX_PROPOSALS ); + sal_Int32 nCountNew = Min( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS ); Sequence< OUString > aAltNew( nCountNew ); OUString *pAltNew = aAltNew.getArray(); - INT32 nIndex = 0; - INT32 i = 0; + sal_Int32 nIndex = 0; + sal_Int32 i = 0; for (int j = 0; j < 2; j++) { - INT32 nCount = j == 0 ? nAltCount1 : nAltCount2; + sal_Int32 nCount = j == 0 ? nAltCount1 : nAltCount2; const OUString *pAlt = j == 0 ? pAlt1 : pAlt2; for (i = 0; i < nCount && nIndex < MAX_PROPOSALS; i++) { @@ -108,23 +108,23 @@ Reference< XSpellAlternatives > MergeProposals( } -BOOL SeqHasEntry( +sal_Bool SeqHasEntry( const Sequence< OUString > &rSeq, const OUString &rTxt) { - BOOL bRes = FALSE; - INT32 nLen = rSeq.getLength(); + sal_Bool bRes = sal_False; + sal_Int32 nLen = rSeq.getLength(); const OUString *pEntry = rSeq.getConstArray(); - for (INT32 i = 0; i < nLen && !bRes; ++i) + for (sal_Int32 i = 0; i < nLen && !bRes; ++i) { if (rTxt == pEntry[i]) - bRes = TRUE; + bRes = sal_True; } return bRes; } -void SearchSimilarText( const OUString &rText, INT16 nLanguage, +void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage, Reference< XDictionaryList > &xDicList, std::vector< OUString > & rDicListProps ) { @@ -135,13 +135,13 @@ void SearchSimilarText( const OUString &rText, INT16 nLanguage, aDics( xDicList->getDictionaries() ); const Reference< XDictionary > *pDic = aDics.getConstArray(); - INT32 nDics = xDicList->getCount(); + sal_Int32 nDics = xDicList->getCount(); - for (INT32 i = 0; i < nDics; i++) + for (sal_Int32 i = 0; i < nDics; i++) { Reference< XDictionary > xDic( pDic[i], UNO_QUERY ); - INT16 nLang = LocaleToLanguage( xDic->getLocale() ); + sal_Int16 nLang = LocaleToLanguage( xDic->getLocale() ); if ( xDic.is() && xDic->isActive() && (nLang == nLanguage || nLang == LANGUAGE_NONE) ) @@ -153,8 +153,8 @@ void SearchSimilarText( const OUString &rText, INT16 nLanguage, #endif const Sequence< Reference< XDictionaryEntry > > aEntries = xDic->getEntries(); const Reference< XDictionaryEntry > *pEntries = aEntries.getConstArray(); - INT32 nLen = aEntries.getLength(); - for (INT32 k = 0; k < nLen; ++k) + sal_Int32 nLen = aEntries.getLength(); + for (sal_Int32 k = 0; k < nLen; ++k) { String aEntryTxt; if (pEntries[k].is()) @@ -173,27 +173,27 @@ void SearchSimilarText( const OUString &rText, INT16 nLanguage, void SeqRemoveNegEntries( Sequence< OUString > &rSeq, Reference< XDictionaryList > &rxDicList, - INT16 nLanguage ) + sal_Int16 nLanguage ) { static const OUString aEmpty; - BOOL bSthRemoved = FALSE; - INT32 nLen = rSeq.getLength(); + sal_Bool bSthRemoved = sal_False; + sal_Int32 nLen = rSeq.getLength(); OUString *pEntries = rSeq.getArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { Reference< XDictionaryEntry > xNegEntry( SearchDicList( rxDicList, - pEntries[i], nLanguage, FALSE, TRUE ) ); + pEntries[i], nLanguage, sal_False, sal_True ) ); if (xNegEntry.is()) { pEntries[i] = aEmpty; - bSthRemoved = TRUE; + bSthRemoved = sal_True; } } if (bSthRemoved) { Sequence< OUString > aNew; // merge sequence without duplicates and empty strings in new empty sequence - aNew = MergeProposalSeqs( aNew, rSeq, FALSE ); + aNew = MergeProposalSeqs( aNew, rSeq, sal_False ); rSeq = aNew; } } @@ -202,7 +202,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq, Sequence< OUString > MergeProposalSeqs( Sequence< OUString > &rAlt1, Sequence< OUString > &rAlt2, - BOOL bAllowDuplicates ) + sal_Bool bAllowDuplicates ) { Sequence< OUString > aMerged; @@ -212,20 +212,20 @@ Sequence< OUString > MergeProposalSeqs( aMerged = rAlt1; else { - INT32 nAltCount1 = rAlt1.getLength(); + sal_Int32 nAltCount1 = rAlt1.getLength(); const OUString *pAlt1 = rAlt1.getConstArray(); - INT32 nAltCount2 = rAlt2.getLength(); + sal_Int32 nAltCount2 = rAlt2.getLength(); const OUString *pAlt2 = rAlt2.getConstArray(); - INT32 nCountNew = Min( nAltCount1 + nAltCount2, (INT32) MAX_PROPOSALS ); + sal_Int32 nCountNew = Min( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS ); aMerged.realloc( nCountNew ); OUString *pMerged = aMerged.getArray(); - INT32 nIndex = 0; - INT32 i = 0; + sal_Int32 nIndex = 0; + sal_Int32 i = 0; for (int j = 0; j < 2; j++) { - INT32 nCount = j == 0 ? nAltCount1 : nAltCount2; + sal_Int32 nCount = j == 0 ? nAltCount1 : nAltCount2; const OUString *pAlt = j == 0 ? pAlt1 : pAlt2; for (i = 0; i < nCount && nIndex < MAX_PROPOSALS; i++) { @@ -252,8 +252,8 @@ SpellAlternatives::SpellAlternatives() SpellAlternatives::SpellAlternatives( - const OUString &rWord, INT16 nLang, - INT16 nFailureType, const OUString &rRplcWord ) : + const OUString &rWord, sal_Int16 nLang, + sal_Int16 nFailureType, const OUString &rRplcWord ) : aAlt ( Sequence< OUString >(1) ), aWord (rWord), nType (nFailureType), @@ -267,7 +267,7 @@ SpellAlternatives::SpellAlternatives( SpellAlternatives::SpellAlternatives( - const OUString &rWord, INT16 nLang, INT16 nFailureType, + const OUString &rWord, sal_Int16 nLang, sal_Int16 nFailureType, const Sequence< OUString > &rAlternatives ) : aAlt (rAlternatives), aWord (rWord), @@ -310,7 +310,7 @@ sal_Int16 SAL_CALL SpellAlternatives::getAlternativesCount() throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return (INT16) aAlt.getLength(); + return (sal_Int16) aAlt.getLength(); } @@ -338,7 +338,7 @@ throw (uno::RuntimeException) } -void SpellAlternatives::SetWordLanguage(const OUString &rWord, INT16 nLang) +void SpellAlternatives::SetWordLanguage(const OUString &rWord, sal_Int16 nLang) { MutexGuard aGuard( GetLinguMutex() ); aWord = rWord; @@ -346,7 +346,7 @@ void SpellAlternatives::SetWordLanguage(const OUString &rWord, INT16 nLang) } -void SpellAlternatives::SetFailureType(INT16 nTypeP) +void SpellAlternatives::SetFailureType(sal_Int16 nTypeP) { MutexGuard aGuard( GetLinguMutex() ); nType = nTypeP; diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index 91aab5c0997e..8cf9110c7570 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -52,15 +52,15 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// -static BOOL SvcListHasLanguage( +static sal_Bool SvcListHasLanguage( const Sequence< Reference< XThesaurus > > &rRefs, const Locale &rLocale ) { - BOOL bHasLanguage = FALSE; + sal_Bool bHasLanguage = sal_False; const Reference< XThesaurus > *pRef = rRefs.getConstArray(); - INT32 nLen = rRefs.getLength(); - for (INT32 k = 0; k < nLen && !bHasLanguage; ++k) + sal_Int32 nLen = rRefs.getLength(); + for (sal_Int32 k = 0; k < nLen && !bHasLanguage; ++k) { if (pRef[k].is()) bHasLanguage = pRef[k]->hasLocale( rLocale ); @@ -128,7 +128,7 @@ Sequence< Reference< XMeaning > > SAL_CALL Sequence< Reference< XMeaning > > aMeanings; - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !rTerm.getLength()) return aMeanings; @@ -150,13 +150,13 @@ Sequence< Reference< XMeaning > > SAL_CALL if (IsIgnoreControlChars( rProperties, GetPropSet() )) RemoveControlChars( aChkWord ); - INT32 nLen = pEntry->aSvcRefs.getLength(); + sal_Int32 nLen = pEntry->aSvcRefs.getLength(); DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), "lng : sequence length mismatch"); DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); - INT32 i = 0; + sal_Int32 i = 0; // try already instantiated services first { @@ -203,7 +203,7 @@ Sequence< Reference< XMeaning > > SAL_CALL if (xThes.is() && xThes->hasLocale( rLocale )) aMeanings = xThes->queryMeanings( aChkWord, rLocale, rProperties ); - pEntry->nLastTriedSvcIndex = (INT16) i; + pEntry->nLastTriedSvcIndex = (sal_Int16) i; ++i; } @@ -227,9 +227,9 @@ void ThesaurusDispatcher::SetServiceList( const Locale &rLocale, { MutexGuard aGuard( GetLinguMutex() ); - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); - INT32 nLen = rSvcImplNames.getLength(); + sal_Int32 nLen = rSvcImplNames.getLength(); if (0 == nLen) // remove entry aSvcMap.erase( nLanguage ); @@ -261,7 +261,7 @@ Sequence< OUString > Sequence< OUString > aRes; // search for entry with that language and use data from that - INT16 nLanguage = LocaleToLanguage( rLocale ); + sal_Int16 nLanguage = LocaleToLanguage( rLocale ); ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this; const ThesSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); const LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; diff --git a/linguistic/source/thesdta.cxx b/linguistic/source/thesdta.cxx index e7aa3bf310f8..1978923a59ff 100644 --- a/linguistic/source/thesdta.cxx +++ b/linguistic/source/thesdta.cxx @@ -52,7 +52,7 @@ namespace linguistic ThesaurusMeaning::ThesaurusMeaning(const OUString &rText, - const OUString &rLookUpText, INT16 nLookUpLang ) : + const OUString &rLookUpText, sal_Int16 nLookUpLang ) : aText (rText), aLookUpText (rLookUpText), nLookUpLanguage (nLookUpLang) |