Skip to content
Snippets Groups Projects
Commit bc08b2f7 authored by d.kilic's avatar d.kilic Committed by d.kilic
Browse files

Errormessage for wrong index at call of delMap

parent 16455079
No related branches found
No related tags found
1 merge request!28Resolve "colorpicker doesn't consider border correctly"
Pipeline #26308 passed
...@@ -417,11 +417,23 @@ int RectPlotItem::addMap() ...@@ -417,11 +417,23 @@ int RectPlotItem::addMap()
void RectPlotItem::delMap(int index) void RectPlotItem::delMap(int index)
{ {
if(mMaps.size() == 1){ if(mMaps.size() == 1){
if(index != 0)
{
debout << "Invalid index for map deletion!" << std::endl;
return;
}
mMaps.replace(0, RectMap()); mMaps.replace(0, RectMap());
return; return;
} }
if (index >= 0 && index < mMaps.size() && mMaps.size() > 0) if (index >= 0 && index < mMaps.size() && mMaps.size() > 0)
{
mMaps.removeAt(index); mMaps.removeAt(index);
return;
}
debout << "Invalid index for map deletion!" << std::endl;
return;
} }
void RectPlotItem::changeMap(int index, double x, double y, double w, double h, bool colored, double mapHeight) void RectPlotItem::changeMap(int index, double x, double y, double w, double h, bool colored, double mapHeight)
......
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