summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-18 16:50:13 +0100
committerMiklos Vajna <vmiklos@collabora.com>2024-10-21 13:26:12 +0200
commit9ed5dd5d1b48b9a17967d85c0fad4994c40caafa (patch)
treef55057452a85e9f6bd72a4cec2c03e184a3f2729
parent9fef2827aa234c893ec5cc2d608181890e24cdd1 (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>
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx18
-rw-r--r--sw/qa/extras/uiwriter/uiwriter6.cxx4
-rw-r--r--sw/qa/extras/uiwriter/uiwriter8.cxx4
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
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 d013de5cf20f..9a5c8c65a3cf 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2396,20 +2396,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"));
}
@@ -2555,8 +2555,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
@@ -2570,8 +2570,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) + "\" } }";
@@ -2594,8 +2594,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 5a666501d3cb..7fb47ec95f9c 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -2738,10 +2738,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 60b1bd8e9ce6..dcff607fd802 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -1975,8 +1975,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 b964ba685260..8e67e94ef3f1 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -173,7 +173,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 c103d218de0d..7e00b8b279af 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3382,7 +3382,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()));