[Libreoffice-commits] online.git: kit/Kit.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Jan 2 05:57:10 UTC 2017
kit/Kit.cpp | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
New commits:
commit a1dd40eaadfaa9e9bbfc023ff96046cb25f80830
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Fri Dec 23 16:18:10 2016 -0500
wsd: cleanup renderopts json creation and merging
Change-Id: I84e49938cc390cc9e6421e79903c7a8935f9775e
Reviewed-on: https://gerrit.libreoffice.org/32604
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 92a097b..32445bd 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1188,7 +1188,7 @@ private:
Util::assertIsLocked(lockLokDoc);
- Object::Ptr renderOptsObj = new Object();
+ Object::Ptr renderOptsObj;
// Fill the object with renderoptions, if any
if (!_renderOpts.empty())
@@ -1197,11 +1197,14 @@ private:
Poco::Dynamic::Var var = parser.parse(_renderOpts);
renderOptsObj = var.extract<Object::Ptr>();
}
+ else if (!userName.empty())
+ {
+ renderOptsObj = new Object();
+ }
// Append name of the user, if any, who opened the document to rendering options
if (!userName.empty())
{
- Object::Ptr authorContainer = new Object();
Object::Ptr authorObj = new Object();
authorObj->set("type", "string");
std::string decodedUserName;
@@ -1210,15 +1213,24 @@ private:
renderOptsObj->set(".uno:Author", authorObj);
}
- std::ostringstream ossRenderOpts;
- renderOptsObj->stringify(ossRenderOpts);
+ std::string renderParams;
+ if (renderOptsObj)
+ {
+ std::ostringstream ossRenderOpts;
+ renderOptsObj->stringify(ossRenderOpts);
+ renderParams = ossRenderOpts.str();
+ }
+
+ LOG_INF("Initializing for rendering session [" << sessionId << "] on document url [" <<
+ _url << "] with: [" << renderParams << "].");
// initializeForRendering() should be called before
// registerCallback(), as the previous creates a new view in Impress.
- _loKitDocument->initializeForRendering(ossRenderOpts.str().c_str());
+ _loKitDocument->initializeForRendering(renderParams.c_str());
const int viewId = _loKitDocument->getView();
session->setViewId(viewId);
+
_viewIdToCallbackDescr.emplace(viewId,
std::unique_ptr<CallbackDescriptor>(new CallbackDescriptor({ this, viewId })));
_loKitDocument->registerCallback(ViewCallback, _viewIdToCallbackDescr[viewId].get());
More information about the Libreoffice-commits
mailing list