diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-21 17:27:48 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-21 19:32:01 +0200 |
commit | d7788287456cb633226203f259e212c143b83050 (patch) | |
tree | bf58cd4fa76b3aa1e72016437c89e8da4929cdd9 /sw/qa | |
parent | cd72269a6a2c85ae9dd4552aa4808ef4fd1f6c0e (diff) |
lok::Document::getCommandValues: expose sw redline author colors
These colors are used in the tiles, so it's a good idea if the client
can use matching colors for cursors and selections. But to be able to do
that, we need an API to expose these colors.
Change-Id: Ia688c07e6c300fecdf8dc428d5a3f000d1857387
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index f203fcaa3ae8..9d9a100beb98 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -74,6 +74,7 @@ public: void testSetViewGraphicSelection(); void testCreateViewGraphicSelection(); void testCreateViewTextSelection(); + void testRedlineColors(); CPPUNIT_TEST_SUITE(SwTiledRenderingTest); CPPUNIT_TEST(testRegisterCallback); @@ -112,6 +113,7 @@ public: CPPUNIT_TEST(testSetViewGraphicSelection); CPPUNIT_TEST(testCreateViewGraphicSelection); CPPUNIT_TEST(testCreateViewTextSelection); + CPPUNIT_TEST(testRedlineColors); CPPUNIT_TEST_SUITE_END(); private: @@ -1429,6 +1431,29 @@ void SwTiledRenderingTest::testCreateViewTextSelection() comphelper::LibreOfficeKit::setActive(false); } +void SwTiledRenderingTest::testRedlineColors() +{ + // Load a document. + comphelper::LibreOfficeKit::setActive(); + SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); + + // Turn on track changes, type "zzz" at the end. + uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY); + xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true)); + SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); + pWrtShell->EndDoc(); + pWrtShell->Insert("zzz"); + + // Assert that info about exactly one author is returned. + OUString aInfo = pXTextDocument->getTrackedChangeAuthors(); + std::stringstream aStream(aInfo.toUtf8().getStr()); + boost::property_tree::ptree aTree; + boost::property_tree::read_json(aStream, aTree); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("authors").size()); + + comphelper::LibreOfficeKit::setActive(false); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest); CPPUNIT_PLUGIN_IMPLEMENT(); |