convert SvStringsISortDtor class from String to OUString
Change-Id: Iad22ba07dd3dfbd5162fa4e16ebb5f44c5eb7811
This commit is contained in:
@@ -1405,7 +1405,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
sal_uInt16 i;
|
||||
for( i = nCount; i; )
|
||||
{
|
||||
String* pString = (*pWrdList)[ --i ];
|
||||
OUString* pString = (*pWrdList)[ --i ];
|
||||
|
||||
if( !lcl_FindInArray(rArrays.aDoubleCapsStrings, *pString))
|
||||
{
|
||||
@@ -1416,7 +1416,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
|
||||
for(std::vector<OUString>::iterator it = rArrays.aDoubleCapsStrings.begin(); it != rArrays.aDoubleCapsStrings.end(); ++it)
|
||||
{
|
||||
String* s = new String(*it);
|
||||
OUString* s = new OUString(*it);
|
||||
if(!pWrdList->insert(s).second)
|
||||
delete s;
|
||||
}
|
||||
@@ -1431,7 +1431,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
sal_uInt16 i;
|
||||
for( i = nCount; i; )
|
||||
{
|
||||
String* pString = (*pCplList)[ --i ];
|
||||
OUString* pString = (*pCplList)[ --i ];
|
||||
if( !lcl_FindInArray(rArrays.aAbbrevStrings, *pString))
|
||||
{
|
||||
delete (*pCplList)[ i ];
|
||||
@@ -1441,7 +1441,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
|
||||
for(std::vector<OUString>::iterator it = rArrays.aAbbrevStrings.begin(); it != rArrays.aAbbrevStrings.end(); ++it)
|
||||
{
|
||||
String* s = new String(*it);
|
||||
OUString* s = new OUString(*it);
|
||||
if(!pCplList->insert(s).second)
|
||||
delete s;
|
||||
}
|
||||
@@ -1460,7 +1460,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
sal_uInt16 i;
|
||||
for( i = nCount; i; )
|
||||
{
|
||||
String* pString = (*pWrdList)[ --i ];
|
||||
OUString* pString = (*pWrdList)[ --i ];
|
||||
if( USHRT_MAX == m_pDoubleCapsLB->GetEntryPos(*pString) )
|
||||
{
|
||||
delete (*pWrdList)[ i ];
|
||||
@@ -1470,7 +1470,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
nCount = m_pDoubleCapsLB->GetEntryCount();
|
||||
for( i = 0; i < nCount; ++i )
|
||||
{
|
||||
String* pEntry = new String( m_pDoubleCapsLB->GetEntry( i ) );
|
||||
OUString* pEntry = new OUString( m_pDoubleCapsLB->GetEntry( i ) );
|
||||
if( !pWrdList->insert( pEntry ).second)
|
||||
delete pEntry;
|
||||
}
|
||||
@@ -1485,7 +1485,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
sal_uInt16 i;
|
||||
for( i = nCount; i; )
|
||||
{
|
||||
String* pString = (*pCplList)[ --i ];
|
||||
OUString* pString = (*pCplList)[ --i ];
|
||||
if( USHRT_MAX == m_pAbbrevLB->GetEntryPos(*pString) )
|
||||
{
|
||||
delete (*pCplList)[ i ];
|
||||
@@ -1495,7 +1495,7 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
|
||||
nCount = m_pAbbrevLB->GetEntryCount();
|
||||
for( i = 0; i < nCount; ++i )
|
||||
{
|
||||
String* pEntry = new String( m_pAbbrevLB->GetEntry( i ) );
|
||||
OUString* pEntry = new OUString( m_pAbbrevLB->GetEntry( i ) );
|
||||
if( !pCplList->insert( pEntry ).second)
|
||||
delete pEntry;
|
||||
}
|
||||
|
@@ -232,7 +232,7 @@ SvXMLExceptionContext::SvXMLExceptionContext(
|
||||
if (!sWord.Len() )
|
||||
return;
|
||||
|
||||
String * pNew = new String( sWord );
|
||||
OUString * pNew = new OUString( sWord );
|
||||
|
||||
if( !rLocalRef.rList.insert( pNew ).second )
|
||||
delete pNew;
|
||||
|
@@ -1734,13 +1734,13 @@ sal_Bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
|
||||
// and last in LANGUAGE_UNDETERMINED
|
||||
LanguageType nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE
|
||||
nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
|
||||
String sTemp(sWord);
|
||||
OUString sTemp(sWord);
|
||||
|
||||
if(pLangTable->find(eLang) != pLangTable->end() || CreateLanguageFile(eLang, sal_False))
|
||||
{
|
||||
//the language is available - so bring it on
|
||||
SvxAutoCorrectLanguageLists* pList = pLangTable->find(eLang)->second;
|
||||
String _sTemp(sWord);
|
||||
OUString _sTemp(sWord);
|
||||
if(pList->GetWrdSttExceptList()->find(&_sTemp) != pList->GetWrdSttExceptList()->end() )
|
||||
return sal_True;
|
||||
}
|
||||
@@ -1774,20 +1774,20 @@ sal_Bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
|
||||
|
||||
static sal_Bool lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord)
|
||||
{
|
||||
String sAbk(OUString('~'));
|
||||
OUString sAbk('~');
|
||||
SvStringsISortDtor::const_iterator it = pList->find( &sAbk );
|
||||
sal_uInt16 nPos = it - pList->begin();
|
||||
if( nPos < pList->size() )
|
||||
{
|
||||
String sLowerWord( sWord ); sLowerWord.ToLowerAscii();
|
||||
const String* pAbk;
|
||||
const OUString* pAbk;
|
||||
for( sal_uInt16 n = nPos;
|
||||
n < pList->size() &&
|
||||
'~' == ( pAbk = (*pList)[ n ])->GetChar( 0 );
|
||||
'~' == (*( pAbk = (*pList)[ n ]))[ 0 ];
|
||||
++n )
|
||||
{
|
||||
// ~ and ~. are not allowed!
|
||||
if( 2 < pAbk->Len() && pAbk->Len() - 1 <= sWord.Len() )
|
||||
if( 2 < pAbk->getLength() && pAbk->getLength() - 1 <= sWord.Len() )
|
||||
{
|
||||
String sLowerAbk( *pAbk ); sLowerAbk.ToLowerAscii();
|
||||
for( xub_StrLen i = sLowerAbk.Len(), ii = sLowerWord.Len(); i; )
|
||||
@@ -1801,7 +1801,7 @@ static sal_Bool lcl_FindAbbreviation( const SvStringsISortDtor* pList, const Str
|
||||
}
|
||||
}
|
||||
}
|
||||
OSL_ENSURE( !(nPos && '~' == (*pList)[ --nPos ]->GetChar( 0 ) ),
|
||||
OSL_ENSURE( !(nPos && '~' == (*(*pList)[ --nPos ])[ 0 ] ),
|
||||
"Wrongly sorted exception list?" );
|
||||
return sal_False;
|
||||
}
|
||||
@@ -1813,7 +1813,7 @@ sal_Bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
|
||||
// and last in LANGUAGE_UNDETERMINED
|
||||
LanguageType nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE
|
||||
nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
|
||||
String sTemp( sWord );
|
||||
OUString sTemp( sWord );
|
||||
|
||||
if(pLangTable->find(eLang) != pLangTable->end() || CreateLanguageFile(eLang, sal_False))
|
||||
{
|
||||
@@ -2123,7 +2123,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::GetCplSttExceptList()
|
||||
|
||||
sal_Bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew)
|
||||
{
|
||||
String* pNew = new String( rNew );
|
||||
OUString* pNew = new OUString( rNew );
|
||||
if( rNew.Len() && GetCplSttExceptList()->insert( pNew ).second )
|
||||
{
|
||||
MakeUserStorage_Impl();
|
||||
@@ -2144,7 +2144,7 @@ sal_Bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew)
|
||||
|
||||
sal_Bool SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew)
|
||||
{
|
||||
String* pNew = new String( rNew );
|
||||
OUString* pNew = new OUString( rNew );
|
||||
SvStringsISortDtor* pExceptList = LoadWrdSttExceptList();
|
||||
if( rNew.Len() && pExceptList && pExceptList->insert( pNew ).second )
|
||||
{
|
||||
|
@@ -46,14 +46,14 @@ class Window;
|
||||
|
||||
struct CompareSvStringsISortDtor
|
||||
{
|
||||
bool operator()( String* const& lhs, String* const& rhs ) const
|
||||
bool operator()( OUString* const& lhs, OUString* const& rhs ) const
|
||||
{
|
||||
return lhs->CompareIgnoreCaseToAscii( *rhs ) == COMPARE_LESS;
|
||||
return lhs->compareToIgnoreAsciiCase( *rhs ) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
class SvStringsISortDtor
|
||||
: public o3tl::sorted_vector<String*, CompareSvStringsISortDtor>
|
||||
: public o3tl::sorted_vector<OUString*, CompareSvStringsISortDtor>
|
||||
{
|
||||
public:
|
||||
~SvStringsISortDtor() { DeleteAndDestroyAll(); }
|
||||
|
Reference in New Issue
Block a user