]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/state.cpp
Add a persistent view size attribute to List
[libs/gltk.git] / source / state.cpp
index 4e0a1debafadbbd711f03de028252cf20f2ff3c7..556970d561c13b3c624ef307de2cf9ed53ef5d9d 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "state.h"
 
 using namespace std;
@@ -17,22 +10,22 @@ istream &operator>>(istream &is, State &state)
        string str;
        is>>str;
 
-       unsigned start=0;
-       state=NORMAL;
+       unsigned start = 0;
+       state = NORMAL;
 
        while(1)
        {
-               unsigned underscore=str.find('_', start);
+               string::size_type underscore = str.find('_', start);
                if(!str.compare(start, underscore-start, "NORMAL"))
-                       state|=NORMAL;
+                       state |= NORMAL;
                else if(!str.compare(start, underscore-start, "HOVER"))
-                       state|=HOVER;
+                       state |= HOVER;
                else if(!str.compare(start, underscore-start, "ACTIVE"))
-                       state|=ACTIVE;
+                       state |= ACTIVE;
                else if(!str.compare(start, underscore-start, "FOCUS"))
-                       state|=FOCUS;
+                       state |= FOCUS;
                else if(!str.compare(start, underscore-start, "DISABLED"))
-                       state|=DISABLED;
+                       state |= DISABLED;
                else
                {
                        is.setstate(ios_base::failbit);
@@ -41,7 +34,7 @@ istream &operator>>(istream &is, State &state)
 
                if(underscore==std::string::npos)
                        break;
-               start=underscore+1;
+               start = underscore+1;
        }
 
        return is;