Fix wrong calculation of viewPort for transitions

Viewport is calculated wrong for horizontal layout in a second instance

Task-number: QTBUG-29944
Task-Number: QTBUG-31546

Upstream-Status: Pending

Looks like backport of https://codereview.qt-project.org/49226 but this
one was applied in previous patch, this change looks the same but is
in different part of qquickitemview.cpp and ISN'T applied yet in dev
branch.

Signed-off-by: Florian Haenel <florian.haenel@lge.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

Change-Id: I136ae4484278d14f796613505e3f38c65ec51ebe
Fix null-pointer access in QQuickVisualDataModelPrivate

I observed null cachItem->contextData which lead to null-pointer access
on cacheItem->contextData->destroy().

Task-number: QTBUG-31439

Upstream-Status: Backport https://codereview.qt-project.org/57789

Signed-of-by: Florian Haenel <florian.haenel@lge.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

Change-Id: I91f28a3ee1ac83446ecde1801a1cb7962fb883f3