diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-04-25 19:25:11 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-05-16 13:15:00 +0200 |
commit | cb33a0fb8b7d9fcdf7ef26ac690842574d359f4b (patch) | |
tree | 590533d83e8975b8de1bc6fb2d578a23b2ae9ee1 /desktop | |
parent | 658eec1d5b96ea0a971fbdf531979480f72516a4 (diff) |
lok: sc: misplaced comment mark on inserting/deleting/resizing row/col
A unique id has been introduced, in a similar way of what occurs in
Writer.
Change-Id: I7b2ef694867fb4184c4cfc616fe1c8f12da3b676
Reviewed-on: https://gerrit.libreoffice.org/36962
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
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); |