summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-04-25 19:25:11 +0200
committerJan Holesovsky <kendy@collabora.com>2017-05-16 13:22:05 +0200
commit4cad57c8e1f24eacd7e94dc60475b8a0b4e3a89d (patch)
treeea2233ea42470f0582ec6c272f4b1d33ba6c5b7e /desktop
parentd2f69fc9011c0f4360710629783e800b60cedd65 (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
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx4
-rw-r--r--desktop/source/lib/init.cxx16
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 2dfb036e6be7..dae50d66314c 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1979,14 +1979,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 58d47e5c590e..35908f96dff3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2053,6 +2053,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)
{
@@ -2657,6 +2669,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);