get next layout
| 1927 | |
| 1928 | // get next layout |
| 1929 | CRKeyboardLayoutRef CRKeyboardLayoutList::nextLayout() |
| 1930 | { |
| 1931 | bool found = false; |
| 1932 | CRKeyboardLayoutRef prev; |
| 1933 | CRKeyboardLayoutRef next; |
| 1934 | CRKeyboardLayoutRef first; |
| 1935 | CRKeyboardLayoutRef last; |
| 1936 | LVHashTable<lString16, CRKeyboardLayoutRef>::iterator i( _table ); |
| 1937 | for ( ;; ) { |
| 1938 | LVHashTable<lString16, CRKeyboardLayoutRef>::pair * item = i.next(); |
| 1939 | if ( !item ) |
| 1940 | break; |
| 1941 | if ( first.isNull() ) |
| 1942 | first = item->value; |
| 1943 | last = item->value; |
| 1944 | if ( item->value.get() == _current.get() ) { |
| 1945 | found = true; |
| 1946 | } else { |
| 1947 | if ( !found ) |
| 1948 | prev = item->value; |
| 1949 | else if ( next.isNull() ) |
| 1950 | next = item->value; |
| 1951 | |
| 1952 | } |
| 1953 | } |
| 1954 | if ( next.isNull() ) |
| 1955 | _current = first; |
| 1956 | else |
| 1957 | _current = next; |
| 1958 | return _current; |
| 1959 | } |
| 1960 | |
| 1961 | bool CRKeyboardLayoutList::openFromFile( const char * layoutFile ) |
| 1962 | { |