private int applySortConfigInternal(String config) {
		int result = -1;
		if (config != null && config.startsWith("S")) { //$NON-NLS-1$
			try {
				StringTokenizer tokenizer = new StringTokenizer(config, "\t"); //$NON-NLS-1$
				if (Numbers.getInteger(tokenizer.nextToken().substring(1), 0) == CONFIG_VERSION) {
					int count = Numbers.getInteger(tokenizer.nextToken(), 0);
					if (clearSortInternal()) {
						result = 0;
					}
					for (int i = 0; i < count; i++) {
						Column column = getColumnWithID(Numbers.getInteger(tokenizer.nextToken(), 0));
						if (column == null) {
							throw new Exception();
						}
						column.setSortCriteria(Numbers.getInteger(tokenizer.nextToken(), -1), Numbers.getBoolean(tokenizer.nextToken()));
						if (column.getSortSequence() != -1) {
							result = 1;
						}
					}
				}
			} catch (Exception exception) {
				// It's a bad config... ignore it.
			}
		}
		return result;
	}