diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-10 16:58:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-09-11 09:45:41 +0200 |
commit | 7c3bb56d60b5d33fc7da1cdef3a7f9f2aa956b12 (patch) | |
tree | 1203e22dac3b20635c27f9845345a9235fc88993 /linguistic | |
parent | 5118cb286865a6617273cb1a8de963b893cdf86c (diff) |
convert linguistic/source/*.cxx from String to OUString
Change-Id: I6f278d4b1a0eccf3757e1a7add6324402a09dfed
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/convdic.cxx | 10 | ||||
-rw-r--r-- | linguistic/source/convdiclist.cxx | 30 | ||||
-rw-r--r-- | linguistic/source/convdicxml.cxx | 6 | ||||
-rw-r--r-- | linguistic/source/dlistimp.cxx | 64 | ||||
-rw-r--r-- | linguistic/source/hyphdsp.cxx | 24 | ||||
-rw-r--r-- | linguistic/source/hyphdta.cxx | 10 | ||||
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 40 | ||||
-rw-r--r-- | linguistic/source/spelldsp.cxx | 16 | ||||
-rw-r--r-- | linguistic/source/spelldta.cxx | 4 |
9 files changed, 102 insertions, 102 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 5fbe2572442e..28f49e54c409 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -68,9 +68,9 @@ using namespace linguistic; #define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary" -void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) +void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport ) { - if (rMainURL.Len() == 0) + if (rMainURL.isEmpty()) return; DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL"); @@ -131,12 +131,12 @@ sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConv return bRes; // check if file extension matches CONV_DIC_EXT - String aExt; + OUString aExt; sal_Int32 nPos = rFileURL.lastIndexOf( '.' ); if (-1 != nPos) aExt = rFileURL.copy( nPos + 1 ); - aExt.ToLowerAscii(); - if (!aExt.EqualsAscii( CONV_DIC_EXT )) + aExt = aExt.toAsciiLowerCase(); + if (aExt != CONV_DIC_EXT) return bRes; // first argument being 0 should stop the file from being parsed diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index e2402fc49bb1..dcd2bbb8a9ca 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -64,7 +64,7 @@ bool operator == ( const Locale &r1, const Locale &r2 ) } -String GetConvDicMainURL( const String &rDicName, const String &rDirectoryURL ) +OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectoryURL ) { // build URL to use for new (persistent) dictionaries @@ -76,7 +76,7 @@ String GetConvDicMainURL( const String &rDicName, const String &rDirectoryURL ) aURLObj.Append( aFullDicName, INetURLObject::ENCODE_ALL ); DBG_ASSERT(!aURLObj.HasError(), "invalid URL"); if (aURLObj.HasError()) - return String(); + return OUString(); else return aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); } @@ -120,7 +120,7 @@ public: // looks for conversion dictionaries with the specified extension // in the directory and adds them to the container - void AddConvDics( const String &rSearchDirPathURL, const String &rExtension ); + void AddConvDics( const OUString &rSearchDirPathURL, const OUString &rExtension ); // calls Flush for the dictionaries that support XFlushable void FlushDics() const; @@ -293,8 +293,8 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) // physically remove dictionary uno::Reference< XConversionDictionary > xDel = aConvDics.getArray()[nRplcIdx]; - String aName( xDel->getName() ); - String aDicMainURL( GetConvDicMainURL( aName, GetDictionaryWriteablePath() ) ); + OUString aName( xDel->getName() ); + OUString aDicMainURL( GetConvDicMainURL( aName, GetDictionaryWriteablePath() ) ); INetURLObject aObj( aDicMainURL ); DBG_ASSERT( aObj.GetProtocol() == INET_PROT_FILE, "+HangulHanjaOptionsDialog::OkHdl(): non-file URLs cannot be deleted" ); if( aObj.GetProtocol() == INET_PROT_FILE ) @@ -325,8 +325,8 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) void ConvDicNameContainer::AddConvDics( - const String &rSearchDirPathURL, - const String &rExtension ) + const OUString &rSearchDirPathURL, + const OUString &rExtension ) { const Sequence< OUString > aDirCnt( utl::LocalFileHelper::GetFolderContents( rSearchDirPathURL, sal_False ) ); @@ -335,13 +335,13 @@ void ConvDicNameContainer::AddConvDics( for (sal_Int32 i = 0; i < nEntries; ++i) { - String aURL( pDirCnt[i] ); + OUString aURL( pDirCnt[i] ); - xub_StrLen nPos = aURL.SearchBackward('.'); - String aExt(aURL.Copy(nPos + 1)); - aExt.ToLowerAscii(); - String aSearchExt( rExtension ); - aSearchExt.ToLowerAscii(); + sal_Int32 nPos = aURL.lastIndexOf('.'); + OUString aExt(aURL.copy(nPos + 1)); + aExt = aExt.toAsciiLowerCase(); + OUString aSearchExt( rExtension ); + aSearchExt = aSearchExt.toAsciiLowerCase(); if(aExt != aSearchExt) continue; // skip other files @@ -351,7 +351,7 @@ void ConvDicNameContainer::AddConvDics( { // get decoded dictionary file name INetURLObject aURLObj( aURL ); - String aDicName = aURLObj.getBase( INetURLObject::LAST_SEGMENT, + OUString aDicName = aURLObj.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8 ); @@ -486,7 +486,7 @@ uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary( throw ElementExistException(); uno::Reference< XConversionDictionary > xRes; - String aDicMainURL( GetConvDicMainURL( rName, GetDictionaryWriteablePath() ) ); + OUString aDicMainURL( GetConvDicMainURL( rName, GetDictionaryWriteablePath() ) ); if (nLang == LANGUAGE_KOREAN && nConvDicType == ConversionDictionaryType::HANGUL_HANJA) { diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index 9b409bd3a63c..4bd17fce3c9a 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -71,12 +71,12 @@ static const OUString ConversionTypeToText( sal_Int16 nConversionType ) return aRes; } -static sal_Int16 GetConversionTypeFromText( const String &rText ) +static sal_Int16 GetConversionTypeFromText( const OUString &rText ) { sal_Int16 nRes = -1; - if (rText.EqualsAscii( CONV_TYPE_HANGUL_HANJA )) + if (rText == CONV_TYPE_HANGUL_HANJA) nRes = ConversionDictionaryType::HANGUL_HANJA; - else if (rText.EqualsAscii( CONV_TYPE_SCHINESE_TCHINESE )) + else if (rText == CONV_TYPE_SCHINESE_TCHINESE) nRes = ConversionDictionaryType::SCHINESE_TCHINESE; return nRes; } diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 841f409b3c77..ec7853bb477b 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -51,7 +51,7 @@ using namespace linguistic; -static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ); +static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ); static void AddInternal( const uno::Reference< XDictionary > &rDic, const OUString& rNew ); @@ -316,16 +316,16 @@ void DicList::SearchForDictionaries( OUString aDCP("dcp"); for (sal_Int32 i = 0; i < nEntries; ++i) { - String aURL( pDirCnt[i] ); + OUString aURL( pDirCnt[i] ); sal_uInt16 nLang = LANGUAGE_NONE; sal_Bool bNeg = sal_False; if(!::IsVers2OrNewer( aURL, nLang, bNeg )) { // When not - xub_StrLen nPos = aURL.Search('.'); - String aExt(aURL.Copy(nPos + 1)); - aExt.ToLowerAscii(); + sal_Int32 nPos = aURL.indexOf('.'); + OUString aExt(aURL.copy(nPos + 1)); + aExt = aExt.toAsciiLowerCase(); if (aDCN.equals(aExt)) // negativ bNeg = sal_True; @@ -338,11 +338,11 @@ void DicList::SearchForDictionaries( // Record in the list of Dictoinaries // When it already exists don't record sal_Int16 nSystemLanguage = MsLangId::getSystemLanguage(); - String aTmp1 = ToLower( aURL, nSystemLanguage ); - xub_StrLen nPos = aTmp1.SearchBackward( '/' ); - if (STRING_NOTFOUND != nPos) - aTmp1 = aTmp1.Copy( nPos + 1 ); - String aTmp2; + OUString aTmp1 = ToLower( aURL, nSystemLanguage ); + sal_Int32 nPos = aTmp1.lastIndexOf( '/' ); + if (-1 != nPos) + aTmp1 = aTmp1.copy( nPos + 1 ); + OUString aTmp2; size_t j; size_t nCount = rDicList.size(); for(j = 0; j < nCount; j++) @@ -356,7 +356,7 @@ void DicList::SearchForDictionaries( { // get decoded dictionary file name INetURLObject aURLObj( aURL ); - String aDicName = aURLObj.getName( INetURLObject::LAST_SEGMENT, + OUString aDicName = aURLObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8 ); @@ -788,32 +788,32 @@ void * SAL_CALL DicList_getFactory( const sal_Char * pImplName, } -xub_StrLen lcl_GetToken( String &rToken, - const String &rText, xub_StrLen nPos, const String &rDelim ) +xub_StrLen lcl_GetToken( OUString &rToken, + const OUString &rText, xub_StrLen nPos, const OUString &rDelim ) { xub_StrLen nRes = STRING_LEN; - if (rText.Len() == 0 || nPos >= rText.Len()) - rToken = String(); - else if (rDelim.Len() == 0) + if (rText.isEmpty() || nPos >= rText.getLength()) + rToken = ""; + else if (rDelim.isEmpty()) { rToken = rText; - if (rToken.Len()) - nRes = rText.Len(); + if (!rToken.isEmpty()) + nRes = rText.getLength(); } else { xub_StrLen i; - for (i = nPos; i < rText.Len(); ++i) + for (i = nPos; i < rText.getLength(); ++i) { - if (STRING_NOTFOUND != rDelim.Search( rText.GetChar(i) )) + if (-1 != rDelim.indexOf( rText[i] )) break; } - if (i >= rText.Len()) // delimeter not found - rToken = rText.Copy( nPos ); + if (i >= rText.getLength()) // delimeter not found + rToken = rText.copy( nPos ); else - rToken = rText.Copy( nPos, sal::static_int_cast< xub_StrLen >((sal_Int32) i - nPos) ); + rToken = rText.copy( nPos, (sal_Int32) i - nPos ); nRes = i + 1; // continue after found delimeter } @@ -834,12 +834,12 @@ static void AddInternal( OSL_ENSURE(aDelim.indexOf(static_cast<sal_Unicode>('.')) == -1, "ensure no '.'"); - String aToken; + OUString aToken; xub_StrLen nPos = 0; while (STRING_LEN != (nPos = lcl_GetToken( aToken, rNew, nPos, aDelim ))) { - if( aToken.Len() && !IsNumeric( aToken ) ) + if( !aToken.isEmpty() && !IsNumeric( aToken ) ) { rDic->add( aToken, sal_False, OUString() ); } @@ -862,16 +862,16 @@ static void AddUserData( const uno::Reference< XDictionary > &rDic ) } } -static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ) +static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ) { - if (rFileURL.Len() == 0) + if (rFileURL.isEmpty()) return sal_False; OUString aDIC("dic"); - String aExt; - xub_StrLen nPos = rFileURL.SearchBackward( '.' ); - if (STRING_NOTFOUND != nPos) - aExt = rFileURL.Copy( nPos + 1 ); - aExt.ToLowerAscii(); + OUString aExt; + sal_Int32 nPos = rFileURL.lastIndexOf( '.' ); + if (-1 != nPos) + aExt = rFileURL.copy( nPos + 1 ); + aExt = aExt.toAsciiLowerCase(); if (!aDIC.equals(aExt)) return sal_False; diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index 3e5c2609ab96..a97ff13f1e1c 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -269,10 +269,10 @@ Reference< XHyphenatedWord > SAL_CALL OUString aChkWord( rWord ); // replace typographical apostroph by ascii apostroph - String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); - DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); - if (aSingleQuote.Len()) - aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" ); + if (!aSingleQuote.isEmpty()) + aChkWord = aChkWord.replace( aSingleQuote[0], '\'' ); bWordModified |= RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) @@ -405,10 +405,10 @@ Reference< XHyphenatedWord > SAL_CALL OUString aChkWord( rWord ); // replace typographical apostroph by ascii apostroph - String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); - DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); - if (aSingleQuote.Len()) - aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" ); + if (!aSingleQuote.isEmpty()) + aChkWord = aChkWord.replace( aSingleQuote[0], '\'' ); bWordModified |= RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) @@ -529,10 +529,10 @@ Reference< XPossibleHyphens > SAL_CALL OUString aChkWord( rWord ); // replace typographical apostroph by ascii apostroph - String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); - DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); - if (aSingleQuote.Len()) - aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" ); + if (!aSingleQuote.isEmpty()) + aChkWord = aChkWord.replace( aSingleQuote[0], '\'' ); RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index f5ce5b157acd..b2dfad2f7d1f 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -48,16 +48,16 @@ HyphenatedWord::HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos (nHPos), nLanguage (nLang) { - String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); - DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); - if (aSingleQuote.Len()) + OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" ); + if (!aSingleQuote.isEmpty()) { // ignore typographical apostrophes (which got replaced in original // word when being checked for hyphenation) in results. OUString aTmpWord( rWord ); OUString aTmpHyphWord( rHyphWord ); - aTmpWord = aTmpWord .replace( aSingleQuote.GetChar(0), '\'' ); - aTmpHyphWord = aTmpHyphWord.replace( aSingleQuote.GetChar(0), '\'' ); + aTmpWord = aTmpWord .replace( aSingleQuote[0], '\'' ); + aTmpHyphWord = aTmpHyphWord.replace( aSingleQuote[0], '\'' ); bIsAltSpelling = aTmpWord != aTmpHyphWord; } else diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index b7fe11037c16..a8aeeede7766 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1291,8 +1291,8 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - String aPrefix( aNode ); - aPrefix.Append( (sal_Unicode) '/' ); + OUString aPrefix( aNode ); + aPrefix += "/"; for (int i = 0; i < nLen; ++i) { OUString aTmp( aPrefix ); @@ -1309,9 +1309,9 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) { - String aLocaleStr( pNames[i] ); - xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); - aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); + OUString aLocaleStr( pNames[i] ); + sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' ); + aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 ); rSpellDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } @@ -1329,8 +1329,8 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - String aPrefix( aNode ); - aPrefix.Append( (sal_Unicode) '/' ); + OUString aPrefix( aNode ); + aPrefix += "/"; for (int i = 0; i < nLen; ++i) { OUString aTmp( aPrefix ); @@ -1351,9 +1351,9 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) if (aSvcImplNames.getLength() > 1) aSvcImplNames.realloc(1); - String aLocaleStr( pNames[i] ); - xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); - aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); + OUString aLocaleStr( pNames[i] ); + sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' ); + aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 ); rGrammarDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } @@ -1371,8 +1371,8 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - String aPrefix( aNode ); - aPrefix.Append( (sal_Unicode) '/' ); + OUString aPrefix( aNode ); + aPrefix += "/"; for (int i = 0; i < nLen; ++i) { OUString aTmp( aPrefix ); @@ -1393,9 +1393,9 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) if (aSvcImplNames.getLength() > 1) aSvcImplNames.realloc(1); - String aLocaleStr( pNames[i] ); - xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); - aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); + OUString aLocaleStr( pNames[i] ); + sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' ); + aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 ); rHyphDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } @@ -1413,8 +1413,8 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - String aPrefix( aNode ); - aPrefix.Append( (sal_Unicode) '/' ); + OUString aPrefix( aNode ); + aPrefix += "/"; for (int i = 0; i < nLen; ++i) { OUString aTmp( aPrefix ); @@ -1431,9 +1431,9 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) { - String aLocaleStr( pNames[i] ); - xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); - aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); + OUString aLocaleStr( pNames[i] ); + sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' ); + aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 ); rThesDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 9a1ebca67220..3b2e04f30f1a 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -302,10 +302,10 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl( Locale aLocale( LanguageTag::convertToLocale( nLanguage ) ); // replace typographical apostroph by ascii apostroph - String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); - DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); - if (aSingleQuote.Len()) - aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" ); + if (!aSingleQuote.isEmpty()) + aChkWord = aChkWord.replace( aSingleQuote[0], '\'' ); RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) @@ -469,10 +469,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( Locale aLocale( LanguageTag::convertToLocale( nLanguage ) ); // replace typographical apostroph by ascii apostroph - String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); - DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); - if (aSingleQuote.Len()) - aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" ); + if (!aSingleQuote.isEmpty()) + aChkWord = aChkWord.replace( aSingleQuote[0], '\'' ); RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index 80c40a0cc6f4..1d07dc1ba412 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -92,13 +92,13 @@ void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage, sal_Int32 nLen = aEntries.getLength(); for (sal_Int32 k = 0; k < nLen; ++k) { - String aEntryTxt; + OUString aEntryTxt; if (pEntries[k].is()) { // remove characters used to determine hyphenation positions aEntryTxt = comphelper::string::remove(pEntries[k]->getDictionaryWord(), '='); } - if (aEntryTxt.Len() > 0 && LevDistance( rText, aEntryTxt ) <= 2) + if (!aEntryTxt.isEmpty() && LevDistance( rText, aEntryTxt ) <= 2) rDicListProps.push_back( aEntryTxt ); } } |