]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/table.cpp
Make LinearProgram robust against degenerate solutions
[libs/gltk.git] / source / table.cpp
index c0c823822c425e70fb709d721f53853965dce884..936be5cc61b032bb4c94ca7622a54e138fd5dbbd 100644 (file)
@@ -1,10 +1,4 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2008  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
+#include <stdexcept>
 #include <msp/gl/matrix.h>
 #include <msp/gl/transform.h>
 #include "part.h"
@@ -46,14 +40,14 @@ void Table::set_columns(unsigned c)
 void Table::set_column_width(unsigned c, unsigned w)
 {
        if(c>=columns)
-               throw InvalidParameterValue("Column index out of bounds");
+               throw invalid_argument("Table::set_column_width");
        col_w[c] = w;
 }
 
 void Table::set_cell_text(unsigned r, unsigned c, const string &t)
 {
        if(r>=rows || c>=columns)
-               throw InvalidParameterValue("Cell coordinates out of bounds");
+               throw out_of_range("Table::set_cell_text");
 
        data[r*columns+c] = t;
 }
@@ -122,22 +116,22 @@ Table::Loader::Loader(Table &t):
 
 void Table::Loader::cell_text(unsigned r, unsigned c, const string &t)
 {
-       static_cast<Table &>(wdg).set_cell_text(r, c, t);
+       static_cast<Table &>(obj).set_cell_text(r, c, t);
 }
 
 void Table::Loader::column_width(unsigned c, unsigned w)
 {
-       static_cast<Table &>(wdg).set_column_width(c, w);
+       static_cast<Table &>(obj).set_column_width(c, w);
 }
 
 void Table::Loader::columns(unsigned c)
 {
-       static_cast<Table &>(wdg).set_columns(c);
+       static_cast<Table &>(obj).set_columns(c);
 }
 
 void Table::Loader::rows(unsigned r)
 {
-       static_cast<Table &>(wdg).set_rows(r);
+       static_cast<Table &>(obj).set_rows(r);
 }
 
 } // namespace GLtk