f9408317e7 was unfortunately
approved though it had an annoying bug. The patch had
an assign of a visual index into a logical index.
This patch fixes that issue.
Change-Id: I9cc75e4e9701858c92e2c3e5817415041b42f8e8
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>