summaryrefslogtreecommitdiff
path: root/desktop/source/lib/init.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r--desktop/source/lib/init.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c4edf05e16dc..bf36321fc9a0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -456,12 +456,18 @@ RectangleAndPart RectangleAndPart::Create(const std::string& rPayload)
RectangleAndPart& CallbackFlushHandler::CallbackData::setRectangleAndPart(const std::string& payload)
{
- PayloadString = payload;
+ setRectangleAndPart(RectangleAndPart::Create(payload));
- PayloadObject = RectangleAndPart::Create(payload);
+ // Return reference to the cached object.
return boost::get<RectangleAndPart>(PayloadObject);
}
+void CallbackFlushHandler::CallbackData::setRectangleAndPart(const RectangleAndPart& rRectAndPart)
+{
+ PayloadString = rRectAndPart.toString().getStr();
+ PayloadObject = rRectAndPart;
+}
+
const RectangleAndPart& CallbackFlushHandler::CallbackData::getRectangleAndPart() const
{
assert(PayloadObject.which() == 1);
@@ -477,6 +483,7 @@ boost::property_tree::ptree& CallbackFlushHandler::CallbackData::setJson(const s
// Let boost normalize the payload so it always matches the cache.
setJson(aTree);
+ // Return reference to the cached object.
return boost::get<boost::property_tree::ptree>(PayloadObject);
}
@@ -913,7 +920,7 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d
void CallbackFlushHandler::queue(const int type, const char* data)
{
CallbackData aCallbackData(type, (data ? data : "(nil)"));
- std::string& payload = aCallbackData.PayloadString;
+ const std::string& payload = aCallbackData.PayloadString;
SAL_INFO("lok", "Queue: " << type << " : " << payload);
#ifdef DBG_UTIL
@@ -1202,7 +1209,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
}
}
- payload = rcNew.toString().getStr();
+ aCallbackData.setRectangleAndPart(rcNew);
}
break;