diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-10-18 16:50:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-05 13:15:56 +0100 |
commit | 7d0a5aeeefde23f588588a4414bfe6b29271e2ec (patch) | |
tree | 0b0d41710a547915ba78476c8bd4cc357a3aeeee | |
parent | 25673aaedacdd2a345407e29155be5ce99bdbbd4 (diff) |
Don't need to send both text and html
now that the other end can use html
Change-Id: Idb7959b041ebbbd9284007594473019cf603981f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175166
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 9ed5dd5d1b48b9a17967d85c0fad4994c40caafa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175998
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 18 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter6.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter8.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 1594e2fd6e00..fa36de31ff73 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -2389,20 +2389,20 @@ void DesktopLOKTest::testCommentsWriter() { CPPUNIT_ASSERT(rComment.second.get<int>("id") > 0); CPPUNIT_ASSERT(!rComment.second.get<std::string>("author").empty()); - CPPUNIT_ASSERT(!rComment.second.get<std::string>("text").empty()); + CPPUNIT_ASSERT(!rComment.second.get<std::string>("html").empty()); // Has a valid iso 8601 date time string css::util::DateTime aDateTime; OUString aDateTimeString = OUString::createFromAscii(rComment.second.get<std::string>("dateTime")); CPPUNIT_ASSERT(utl::ISO8601parseDateTime(aDateTimeString, aDateTime)); // This comment has a marked text range - if (rComment.second.get<std::string>("text") == "Comment 2") + if (rComment.second.get<std::string>("html") == "<div>Comment 2</div>") { CPPUNIT_ASSERT(!rComment.second.get<std::string>("textRange").empty()); nComment2Id = rComment.second.get<int>("id"); } // This is a reply comment - else if (rComment.second.get<std::string>("text") == "Reply to Comment 2") + else if (rComment.second.get<std::string>("html") == "<div>Reply to Comment 2</div>") { CPPUNIT_ASSERT_EQUAL(nComment2Id, rComment.second.get<int>("parentId")); } @@ -2548,8 +2548,8 @@ void DesktopLOKTest::testCommentsCallbacksWriter() CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView2.m_aCommentCallbackResult.get<std::string>("action")); CPPUNIT_ASSERT_EQUAL(nCommentId1, aView1.m_aCommentCallbackResult.get<int>("parentId")); CPPUNIT_ASSERT_EQUAL(nCommentId1, aView2.m_aCommentCallbackResult.get<int>("parentId")); - CPPUNIT_ASSERT_EQUAL(std::string("Reply comment"), aView1.m_aCommentCallbackResult.get<std::string>("text")); - CPPUNIT_ASSERT_EQUAL(std::string("Reply comment"), aView2.m_aCommentCallbackResult.get<std::string>("text")); + CPPUNIT_ASSERT_EQUAL(std::string("<div>Reply comment</div>"), aView1.m_aCommentCallbackResult.get<std::string>("html")); + CPPUNIT_ASSERT_EQUAL(std::string("<div>Reply comment</div>"), aView2.m_aCommentCallbackResult.get<std::string>("html")); int nCommentId2 = aView1.m_aCommentCallbackResult.get<int>("id"); // Edit the previously added comment @@ -2563,8 +2563,8 @@ void DesktopLOKTest::testCommentsCallbacksWriter() // parent is unchanged still CPPUNIT_ASSERT_EQUAL(nCommentId1, aView1.m_aCommentCallbackResult.get<int>("parentId")); CPPUNIT_ASSERT_EQUAL(nCommentId1, aView2.m_aCommentCallbackResult.get<int>("parentId")); - CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView1.m_aCommentCallbackResult.get<std::string>("text")); - CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView2.m_aCommentCallbackResult.get<std::string>("text")); + CPPUNIT_ASSERT_EQUAL(std::string("<div>Edited comment</div>"), aView1.m_aCommentCallbackResult.get<std::string>("html")); + CPPUNIT_ASSERT_EQUAL(std::string("<div>Edited comment</div>"), aView2.m_aCommentCallbackResult.get<std::string>("html")); // Delete the reply comment just added aCommandArgs = "{ \"Id\": { \"type\": \"string\", \"value\": \"" + OString::number(nCommentId2) + "\" } }"; @@ -2587,8 +2587,8 @@ void DesktopLOKTest::testCommentsCallbacksWriter() CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView2.m_aCommentCallbackResult.get<std::string>("action")); CPPUNIT_ASSERT_EQUAL(nCommentId1, aView1.m_aCommentCallbackResult.get<int>("parentId")); CPPUNIT_ASSERT_EQUAL(nCommentId1, aView2.m_aCommentCallbackResult.get<int>("parentId")); - CPPUNIT_ASSERT_EQUAL(std::string("Reply comment again"), aView1.m_aCommentCallbackResult.get<std::string>("text")); - CPPUNIT_ASSERT_EQUAL(std::string("Reply comment again"), aView2.m_aCommentCallbackResult.get<std::string>("text")); + CPPUNIT_ASSERT_EQUAL(std::string("<div>Reply comment again</div>"), aView1.m_aCommentCallbackResult.get<std::string>("html")); + CPPUNIT_ASSERT_EQUAL(std::string("<div>Reply comment again</div>"), aView2.m_aCommentCallbackResult.get<std::string>("html")); // .uno:ViewAnnotations returns total of 5 comments boost::property_tree::ptree aTree; diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 7d5bc22b8fa6..af5c132f880a 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -2696,10 +2696,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf65535) for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("comments")) { const boost::property_tree::ptree& rComment = rValue.second; - sCommentText = OString(rComment.get<std::string>("text")); + sCommentText = OString(rComment.get<std::string>("html")); } // This was false (lost comment with spelling replacement) - CPPUNIT_ASSERT_EQUAL("with comment"_ostr, sCommentText); + CPPUNIT_ASSERT_EQUAL("<div>with comment</div>"_ostr, sCommentText); } #endif diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 1c09ab6a9ad6..92ef307ba1d8 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -2016,8 +2016,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132603) { const boost::property_tree::ptree& rComment = rValue.second; - OString aText(rComment.get<std::string>("text")); - CPPUNIT_ASSERT_EQUAL("Comment"_ostr, aText); + OString aText(rComment.get<std::string>("html")); + CPPUNIT_ASSERT_EQUAL("<div>Comment</div>"_ostr, aText); } } diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index bf1b56082fba..177d52c9777b 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -175,7 +175,7 @@ namespace { aAnnotation.put("id", pField->GetPostItId()); aAnnotation.put("parentId", pField->GetParentPostItId()); aAnnotation.put("author", pField->GetPar1().toUtf8().getStr()); - aAnnotation.put("text", pField->GetPar2().toUtf8().getStr()); + // Note, for just plain text we could use "text" populated by pField->GetPar2() aAnnotation.put("html", pWin->GetSimpleHtml()); aAnnotation.put("resolved", pField->GetResolved() ? "true" : "false"); aAnnotation.put("dateTime", utl::toISO8601(pField->GetDateTime().GetUNODateTime())); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index e1d9aea18593..794c88a463cd 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3494,7 +3494,7 @@ void SwXTextDocument::getPostIts(tools::JsonWriter& rJsonWriter) rJsonWriter.put("id", pField->GetPostItId()); rJsonWriter.put("parentId", pField->GetParentPostItId()); rJsonWriter.put("author", pField->GetPar1()); - rJsonWriter.put("text", pField->GetPar2()); + // Note, for just plain text we could use "text" populated by pField->GetPar2() rJsonWriter.put("html", pWin->GetSimpleHtml()); rJsonWriter.put("resolved", pField->GetResolved() ? "true" : "false"); rJsonWriter.put("dateTime", utl::toISO8601(pField->GetDateTime().GetUNODateTime())); |