Skip to content
Snippets Groups Projects
Commit cdcc3de4 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

ComboProperty: throw -> ASSERT

parent 990ed515
No related branches found
No related tags found
1 merge request!1645some throw -> ASSERT; some shorter errmsgs (#411)
......@@ -14,8 +14,8 @@
#include "GUI/Model/Data/ComboProperty.h"
#include "Base/Util/Assert.h"
#include "GUI/Support/Util/Error.h"
#include "GUI/Support/XML/UtilXML.h"
namespace {
const QString value_separator = ";";
......@@ -23,6 +23,7 @@ const QString selection_separator = ",";
} // namespace
ComboProperty::ComboProperty() = default;
ComboProperty::ComboProperty(QStringList values)
......@@ -60,10 +61,7 @@ QString ComboProperty::currentValue() const
void ComboProperty::setCurrentValue(const QString& name)
{
if (!m_values.contains(name))
throw Error("ComboProperty::setValue -> Error. Combo doesn't contain "
"value "
+ name);
ASSERT(m_values.contains(name));
setCurrentIndex(m_values.indexOf(name));
}
......@@ -100,9 +98,7 @@ int ComboProperty::currentIndex() const
void ComboProperty::setCurrentIndex(int index)
{
if (index < 0 || index >= m_values.size())
throw Error("ComboProperty::setCurrentIndex(int index) -> Error. "
"Invalid index");
ASSERT(index >= 0 && index < m_values.size());
m_selected_indices.clear();
m_selected_indices.push_back(index);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment