summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/srchdlg.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index b971f1f94038..6b1365af8cb1 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1578,16 +1578,16 @@ void SvxSearchDialog::Remember_Impl( const OUString &rStr, bool _bSearch )
if (std::find(pArr->begin(), pArr->end(), rStr) != pArr->end())
return;
+ pArr->insert(pArr->begin(), rStr);
+ pListBox->insert_text(0, rStr);
+
// delete oldest entry at maximum occupancy (ListBox and Array)
- if(nRememberSize < pArr->size())
+ size_t nArrSize = pArr->size();
+ if (nArrSize > nRememberSize)
{
- pListBox->remove(static_cast<sal_uInt16>(nRememberSize - 1));
- (*pArr)[nRememberSize - 1] = rStr;
- pArr->erase(pArr->begin() + nRememberSize - 1);
+ pListBox->remove(nArrSize - 1);
+ pArr->erase(pArr->begin() + nArrSize - 1);
}
-
- pArr->insert(pArr->begin(), rStr);
- pListBox->insert_text(0, rStr);
}
void SvxSearchDialog::TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool )