summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-21 17:27:48 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-22 10:29:28 +0200
commit73ae22aae1d856c62d08ca576daea15056afbb58 (patch)
tree1f6d589b81df72999a50a6d7dee19d9288484947 /sw/qa/extras
parent6f53baab070270b6913fd6035152382e963f4a66 (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 (cherry picked from commit d7788287456cb633226203f259e212c143b83050)
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index cce710aefd4c..f6fb64fe6652 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -75,6 +75,7 @@ public:
void testSetViewGraphicSelection();
void testCreateViewGraphicSelection();
void testCreateViewTextSelection();
+ void testRedlineColors();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -113,6 +114,7 @@ public:
CPPUNIT_TEST(testSetViewGraphicSelection);
CPPUNIT_TEST(testCreateViewGraphicSelection);
CPPUNIT_TEST(testCreateViewTextSelection);
+ CPPUNIT_TEST(testRedlineColors);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1430,6 +1432,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();