Pass enum values around rather than OUString ones.

Ditto with the range type.

Change-Id: Iab37d50b6d58d76c60872f49f13d77ff0c918974