diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 4 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 8d85a078efc0..79ec0ba54e3b 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1933,14 +1933,14 @@ void DesktopLOKTest::testCommentsCalc() { case 0: { - CPPUNIT_ASSERT_EQUAL(std::string("Sheet5.G15"), rComment.second.get<std::string>("id")); + CPPUNIT_ASSERT_EQUAL(std::string("4"), rComment.second.get<std::string>("tab")); CPPUNIT_ASSERT_EQUAL(std::string("Comment1"), rComment.second.get<std::string>("text")); CPPUNIT_ASSERT_EQUAL(std::string("7650, 3570, 1274, 254"), rComment.second.get<std::string>("cellPos")); } break; case 1: { - CPPUNIT_ASSERT_EQUAL(std::string("Sheet5.H18"), rComment.second.get<std::string>("id")); + CPPUNIT_ASSERT_EQUAL(std::string("4"), rComment.second.get<std::string>("tab")); CPPUNIT_ASSERT_EQUAL(std::string("Comment2"), rComment.second.get<std::string>("text")); CPPUNIT_ASSERT_EQUAL(std::string("8925, 4335, 1274, 254"), rComment.second.get<std::string>("cellPos")); } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b090ae4e377c..ebfe46a7efe3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2049,6 +2049,18 @@ static char* getPostIts(LibreOfficeKitDocument* pThis) return strdup(aComments.toUtf8().getStr()); } +/// Returns the JSON representation of the positions of all the comments in the document +static char* getPostItsPos(LibreOfficeKitDocument* pThis) +{ + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) + { + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return nullptr; + } + OUString aComments = pDoc->getPostItsPos(); + return strdup(aComments.toUtf8().getStr()); +} static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode) { @@ -2653,6 +2665,10 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo { return getPostIts(pThis); } + else if (aCommand == ".uno:ViewAnnotationsPosition") + { + return getPostItsPos(pThis); + } else if (aCommand.startsWith(aViewRowColumnHeaders)) { ITiledRenderable* pDoc = getTiledRenderable(pThis); |