summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-11 14:02:02 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-11 18:32:15 -0500
commit4497c499d2b57095a2dbeb592dce3b5067f417c9 (patch)
treeeb705b6d5f5b52b128461c3effe7099c95b4ab69 /cui
parenta140141e272854110e2e164be69c35839631a0e0 (diff)
SvStringsISort->std::set
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/autocdlg.hxx4
-rw-r--r--cui/source/tabpages/autocdlg.cxx25
2 files changed, 9 insertions, 20 deletions
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 <svtools/svtabbx.hxx>
#include <svx/simptabl.hxx>
-class SvStringsISortDtor;
-
// class OfaACorrCheckListBox ------------------------------------------
class OfaACorrCheckListBox : public SvxSimpleTable
@@ -240,7 +238,7 @@ private:
String sModify;
String sNew;
- SvStringsISortDtor* pFormatText;
+ std::set<rtl::OUString> 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<rtl::OUString>::iterator i = aFormatText.begin(); i != aFormatText.end(); ++i)
+ {
+ if((*i).equals(rShortTxt))
{
bEnableNew = sal_False;
break;
}
+ }
}
aNewReplacePB.Enable(bEnableNew);