diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-19 16:46:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-19 16:51:36 +0200 |
commit | 9e310a4705ce956551059040696166aefb2388cb (patch) | |
tree | 55ed66cdf30ddcfa03ea44ce7f3555d63b859aa6 /desktop | |
parent | e774d798f6734f3bcc10e74bf641efcce0dedc40 (diff) |
sw redlines: expose description as part of the UNO/LOK API
A redline can have a manual comment and also an autogenerated
description, like "Insert 'abc'". Expose this later property as well, as
it provides useful additional information, especially when the comment
property is empty.
Change-Id: Id0f0ff62aef58d96b9b6071706c6f5b4a0d74800
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 4 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index b356535e1a4d..d3888ff94021 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1434,6 +1434,10 @@ void DesktopLOKTest::testRedlineWriter() // Make sure that pressing a key creates exactly one redline. CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("redlines").size()); + for (boost::property_tree::ptree::value_type& rRedline : aTree.get_child("redlines")) + // This failed with boost::property_tree::ptree_bad_path, as there were no description field. + CPPUNIT_ASSERT_EQUAL(std::string("Insert 't'"), rRedline.second.get<std::string>("description")); + comphelper::LibreOfficeKit::setActive(false); } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dfad9b293739..79129d74a6b2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1843,6 +1843,10 @@ static char* getTrackedChanges(LibreOfficeKitDocument* pThis) xRedline->getPropertyValue("RedlineComment") >>= sComment; aRedline.put("comment", sComment.toUtf8().getStr()); + OUString sDescription; + xRedline->getPropertyValue("RedlineDescription") >>= sDescription; + aRedline.put("description", sDescription.toUtf8().getStr()); + util::DateTime aDateTime; xRedline->getPropertyValue("RedlineDateTime") >>= aDateTime; OUString sDateTime = utl::toISO8601(aDateTime); |