From 4497c499d2b57095a2dbeb592dce3b5067f417c9 Mon Sep 17 00:00:00 2001 From: August Sodora Date: Wed, 11 Jan 2012 14:02:02 -0500 Subject: SvStringsISort->std::set --- cui/source/inc/autocdlg.hxx | 4 +--- cui/source/tabpages/autocdlg.cxx | 25 ++++++++----------------- 2 files changed, 9 insertions(+), 20 deletions(-) (limited to 'cui') diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index a22d7b34fe3a..30437396b784 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -67,8 +67,6 @@ public: #include #include -class SvStringsISortDtor; - // class OfaACorrCheckListBox ------------------------------------------ class OfaACorrCheckListBox : public SvxSimpleTable @@ -240,7 +238,7 @@ private: String sModify; String sNew; - SvStringsISortDtor* pFormatText; + std::set aFormatText; DoubleStringTable aDoubleStringTable; CollatorWrapper* pCompareClass; CharClass* pCharClass; diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 48eb935e4e31..a0ce04ba6d2e 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -960,7 +960,6 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent, aDeleteReplacePB(this,CUI_RES(PB_DELETE_REPLACE )), sModify(CUI_RES(STR_MODIFY)), sNew(aNewReplacePB.GetText()), - pFormatText(0), eLang(eLastDialogLanguage), bHasSelectionText(sal_False), bFirstSelect(sal_True), @@ -995,7 +994,6 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent, OfaAutocorrReplacePage::~OfaAutocorrReplacePage() { - delete pFormatText; lcl_ClearTable(aDoubleStringTable); delete pCompareClass; delete pCharClass; @@ -1187,12 +1185,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, aReplaceTLB.Clear(); if(!bSWriter) - { - if(pFormatText) - pFormatText->DeleteAndDestroy(0, pFormatText->Count()); - else - pFormatText = new SvStringsISortDtor(); - } + aFormatText.clear(); if(aDoubleStringTable.IsKeyValid(eLang)) { @@ -1213,9 +1206,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, pEntry->SetUserData(pDouble->pUserData); // Das heisst: mit Formatinfo oder sogar mit Selektionstext } else - { - pFormatText->Insert(new String(pDouble->sShort)); - } + aFormatText.insert(pDouble->sShort); } } else @@ -1239,9 +1230,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, pEntry->SetUserData(&aTextOnlyCB); // Das heisst: mit Formatinfo } else - { - pFormatText->Insert(new String(pWordPtr->GetShort())); - } + aFormatText.insert(pWordPtr->GetShort()); } aNewReplacePB.Enable(sal_False); aDeleteReplacePB.Enable(sal_False); @@ -1452,14 +1441,16 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) ( bHasSelectionText && bSWriter )) && ( !pFirstSel || rRepString != aReplaceTLB.GetEntryText( pFirstSel, 1 ) ); - if(bEnableNew && pFormatText) + if(bEnableNew) { - for(sal_uInt16 i = 0; i < pFormatText->Count(); i++) - if(*pFormatText->GetObject(i) == rShortTxt) + for(std::set::iterator i = aFormatText.begin(); i != aFormatText.end(); ++i) + { + if((*i).equals(rShortTxt)) { bEnableNew = sal_False; break; } + } } aNewReplacePB.Enable(bEnableNew); -- cgit