summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/mgetempl.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 90a66282d5d3..deb5f01f136e 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -281,7 +281,9 @@ void SfxManageStyleSheetPage::UpdateName_Impl( weld::ComboBox* pBox,
{
// it is the current entry, which name was modified
const bool bSelect = pBox->get_active_text() == aBuf;
- pBox->remove_text(aBuf);
+ int nOldIndex = pBox->find_text(aBuf);
+ if (nOldIndex != -1)
+ pBox->remove(nOldIndex);
pBox->append_text(rNew);
if (bSelect)