summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-05 17:03:39 +0200
committerNoel Grandin <noel@peralex.com>2013-09-11 09:45:29 +0200
commitbde5457dd634c70cef02565890e08e8669e1a437 (patch)
tree8547848d948c4867802955f0531c4e212ab77bb2 /cui
parent19c8de15dfc49b815597d7f2b05e072de2f8dec5 (diff)
convert SvStringsISortDtor from OUString* to OUString
There is no point in storing pointers to a reference counted value type. It complicates memory management without gaining us anything. Change-Id: I756dfad740de3203d88ba48d0ebdfb8671b41cfb
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/autocdlg.cxx40
1 files changed, 14 insertions, 26 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 0ce6b490ee75..0eeb34914a1d 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1405,20 +1405,17 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
sal_uInt16 i;
for( i = nCount; i; )
{
- OUString* pString = (*pWrdList)[ --i ];
+ OUString aString = (*pWrdList)[ --i ];
- if( !lcl_FindInArray(rArrays.aDoubleCapsStrings, *pString))
+ if( !lcl_FindInArray(rArrays.aDoubleCapsStrings, aString))
{
- delete (*pWrdList)[ i ];
pWrdList->erase(i);
}
}
for(std::vector<OUString>::iterator it = rArrays.aDoubleCapsStrings.begin(); it != rArrays.aDoubleCapsStrings.end(); ++it)
{
- OUString* s = new OUString(*it);
- if(!pWrdList->insert(s).second)
- delete s;
+ pWrdList->insert(*it);
}
pAutoCorrect->SaveWrdSttExceptList(eCurLang);
}
@@ -1431,19 +1428,16 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
sal_uInt16 i;
for( i = nCount; i; )
{
- OUString* pString = (*pCplList)[ --i ];
- if( !lcl_FindInArray(rArrays.aAbbrevStrings, *pString))
+ OUString aString = (*pCplList)[ --i ];
+ if( !lcl_FindInArray(rArrays.aAbbrevStrings, aString))
{
- delete (*pCplList)[ i ];
pCplList->erase(i);
}
}
for(std::vector<OUString>::iterator it = rArrays.aAbbrevStrings.begin(); it != rArrays.aAbbrevStrings.end(); ++it)
{
- OUString* s = new OUString(*it);
- if(!pCplList->insert(s).second)
- delete s;
+ pCplList->insert(*it);
}
pAutoCorrect->SaveCplSttExceptList(eCurLang);
@@ -1460,19 +1454,16 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
sal_uInt16 i;
for( i = nCount; i; )
{
- OUString* pString = (*pWrdList)[ --i ];
- if( USHRT_MAX == m_pDoubleCapsLB->GetEntryPos(*pString) )
+ OUString aString = (*pWrdList)[ --i ];
+ if( USHRT_MAX == m_pDoubleCapsLB->GetEntryPos(aString) )
{
- delete (*pWrdList)[ i ];
pWrdList->erase(i);
}
}
nCount = m_pDoubleCapsLB->GetEntryCount();
for( i = 0; i < nCount; ++i )
{
- OUString* pEntry = new OUString( m_pDoubleCapsLB->GetEntry( i ) );
- if( !pWrdList->insert( pEntry ).second)
- delete pEntry;
+ pWrdList->insert( m_pDoubleCapsLB->GetEntry( i ) );
}
pAutoCorrect->SaveWrdSttExceptList(eLang);
}
@@ -1485,19 +1476,16 @@ sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
sal_uInt16 i;
for( i = nCount; i; )
{
- OUString* pString = (*pCplList)[ --i ];
- if( USHRT_MAX == m_pAbbrevLB->GetEntryPos(*pString) )
+ OUString aString = (*pCplList)[ --i ];
+ if( USHRT_MAX == m_pAbbrevLB->GetEntryPos(aString) )
{
- delete (*pCplList)[ i ];
pCplList->erase(i);
}
}
nCount = m_pAbbrevLB->GetEntryCount();
for( i = 0; i < nCount; ++i )
{
- OUString* pEntry = new OUString( m_pAbbrevLB->GetEntry( i ) );
- if( !pCplList->insert( pEntry ).second)
- delete pEntry;
+ pCplList->insert( m_pAbbrevLB->GetEntry( i ) );
}
pAutoCorrect->SaveCplSttExceptList(eLang);
}
@@ -1576,11 +1564,11 @@ void OfaAutocorrExceptPage::RefillReplaceBoxes(sal_Bool bFromReset,
sal_uInt16 i;
for( i = 0; i < pCplList->size(); i++ )
{
- m_pAbbrevLB->InsertEntry(*(*pCplList)[i]);
+ m_pAbbrevLB->InsertEntry((*pCplList)[i]);
}
for( i = 0; i < pWrdList->size(); i++ )
{
- m_pDoubleCapsLB->InsertEntry(*(*pWrdList)[i]);
+ m_pDoubleCapsLB->InsertEntry((*pWrdList)[i]);
}
}
}