tdf#124730 an attempt to remove entry that isn't there

Change-Id: If382f0419c8ea0a3b99c85942c05ee1e5a627e76
Reviewed-on: https://gerrit.libreoffice.org/70795
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 67eb96d..836ca6d 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)