loolwsd: fix impress; get viewid after initializeForRendering()

For impress, call to initializeForRendering() *changes* the
viewid, so there's no point in remembering the viewid before call
to initializeForRendering().
This commit is contained in:
Pranav Kant 2016-08-15 21:12:03 +05:30
parent 82e1769fe8
commit 6df1c4c6f7

View file

@ -1013,11 +1013,7 @@ private:
if (_multiView)
{
Log::info("Loading view to document from URI: [" + uri + "] for session [" + sessionId + "].");
viewId = _loKitDocument->createView();
Log::info() << "Document [" << _url << "] view ["
<< viewId << "] loaded, leaving "
<< (_clientViews + 1) << " views." << Log::end;
_loKitDocument->createView();
}
}
@ -1027,10 +1023,14 @@ private:
if (_multiView)
{
viewId = _loKitDocument->getView();
_viewIdToCallbackDescr.emplace(viewId,
std::unique_ptr<CallbackDescriptor>(new CallbackDescriptor({ this, viewId })));
std::unique_ptr<CallbackDescriptor>(new CallbackDescriptor({ this, viewId })));
_loKitDocument->registerCallback(ViewCallback, _viewIdToCallbackDescr[viewId].get());
Log::info() << "Document [" << _url << "] view ["
<< viewId << "] loaded, leaving "
<< (_clientViews + 1) << " views." << Log::end;
}
else
{