X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flist.cpp;h=a1803694a23633cd0a3911bafeb007e2eef1f141;hb=39cf4c8d917dc60c087fb4af6885bfa78f6fba34;hp=d81c48646016ab03e5704747b235be8be07df03b;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/list.cpp b/source/list.cpp index d81c486..a180369 100644 --- a/source/list.cpp +++ b/source/list.cpp @@ -90,7 +90,7 @@ void List::append(const string &v) void List::insert(unsigned i, const string &v) { if(i>items.size()) - throw InvalidParameterValue("Index out of range"); + throw out_of_range("List::insert"); items.insert(items.begin()+i, v); check_view_range(); @@ -100,7 +100,7 @@ void List::insert(unsigned i, const string &v) void List::remove(unsigned i) { if(i>items.size()) - throw InvalidParameterValue("Index out of range"); + throw out_of_range("List::remove"); items.erase(items.begin()+i); if(sel_index>static_cast(i)) @@ -131,13 +131,13 @@ void List::set_selected_index(int i) signal_item_selected.emit(sel_index, items[sel_index]); } else - throw InvalidParameterValue("Index out of range"); + throw out_of_range("List::set_selected_index"); } const string &List::get_selected() const { if(sel_index<0) - throw InvalidState("No selection"); + throw logic_error("sel_index<0"); return items[sel_index]; }