From 32304eb0079079fe263b860573fa010656ab13c9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 15 Apr 2019 19:59:23 +0100 Subject: tdf#124730 an attempt to remove entry that isn't there MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If382f0419c8ea0a3b99c85942c05ee1e5a627e76 Reviewed-on: https://gerrit.libreoffice.org/70795 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sfx2/source/dialog/mgetempl.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sfx2/source/dialog/mgetempl.cxx') diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 67eb96db1cd8..836ca6de1164 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -282,7 +282,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) -- cgit