LOK Extract API: Use camelCase for "text before / after" in redline data extraction

This improves consistency.

See https://gerrit.libreoffice.org/c/core/+/186690/comments/eaf49418_87ae6bd2

Change-Id: If80730536e3d387a643d93d2d5c92658ec8a3748
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186705
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 08260893ad23b4334430e9b14952c93794a22607)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186868
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2025-06-24 10:07:14 +02:00
parent 7c3ddb07e8
commit ca2ef8b3c2
2 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -917,10 +917,10 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDocumentStructureExtractRedlines)
CPPUNIT_ASSERT_EQUAL("Mike"s, change.get<std::string>("author"));
CPPUNIT_ASSERT_EQUAL("Delete “Donec”"s, change.get<std::string>("description"));
CPPUNIT_ASSERT_EQUAL(""s, change.get<std::string>("comment"));
auto text_before = change.get<std::string>("text-before");
auto text_before = change.get<std::string>("textBefore");
CPPUNIT_ASSERT_EQUAL(size_t(200), text_before.size());
CPPUNIT_ASSERT(text_before.ends_with(" egestas. "));
auto text_after = change.get<std::string>("text-after");
auto text_after = change.get<std::string>("textAfter");
CPPUNIT_ASSERT_EQUAL(size_t(200), text_after.size());
CPPUNIT_ASSERT(text_after.starts_with(" blandit "));
++it;
@@ -937,10 +937,10 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDocumentStructureExtractRedlines)
CPPUNIT_ASSERT_EQUAL("Mike"s, change.get<std::string>("author"));
CPPUNIT_ASSERT_EQUAL("Attributes changed"s, change.get<std::string>("description"));
CPPUNIT_ASSERT_EQUAL(""s, change.get<std::string>("comment"));
auto text_before = change.get<std::string>("text-before");
auto text_before = change.get<std::string>("textBefore");
CPPUNIT_ASSERT_EQUAL(size_t(200), text_before.size());
CPPUNIT_ASSERT(text_before.ends_with(" arcu, nec "));
auto text_after = change.get<std::string>("text-after");
auto text_after = change.get<std::string>("textAfter");
CPPUNIT_ASSERT_EQUAL(size_t(200), text_after.size());
CPPUNIT_ASSERT(text_after.starts_with(" eros "));
++it;
@@ -957,10 +957,10 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDocumentStructureExtractRedlines)
CPPUNIT_ASSERT_EQUAL("Mike"s, change.get<std::string>("author"));
CPPUNIT_ASSERT_EQUAL("Insert “ Sapienti sat.”"s, change.get<std::string>("description"));
CPPUNIT_ASSERT_EQUAL(""s, change.get<std::string>("comment"));
auto text_before = change.get<std::string>("text-before");
auto text_before = change.get<std::string>("textBefore");
CPPUNIT_ASSERT_EQUAL(size_t(200), text_before.size());
CPPUNIT_ASSERT(text_before.ends_with(" est orci."));
auto text_after = change.get<std::string>("text-after");
auto text_after = change.get<std::string>("textAfter");
CPPUNIT_ASSERT(text_after.empty());
++it;
}
+2 -2
View File
@@ -878,14 +878,14 @@ void GetDocStructureTrackChanges(tools::JsonWriter& rJsonWriter, const SwDocShel
{
auto xCursor = xStart->getText()->createTextCursorByRange(xStart);
xCursor->goLeft(200, /*bExpand*/ true);
rJsonWriter.put("text-before", xCursor->getString());
rJsonWriter.put("textBefore", xCursor->getString());
}
if (auto xEnd = xRedlineProperties->getPropertyValue(UNO_NAME_REDLINE_END)
.query<css::text::XTextRange>())
{
auto xCursor = xEnd->getText()->createTextCursorByRange(xEnd);
xCursor->goRight(200, /*bExpand*/ true);
rJsonWriter.put("text-after", xCursor->getString());
rJsonWriter.put("textAfter", xCursor->getString());
}
// UNO_NAME_REDLINE_IDENTIFIER: OUString (the value of a pointer, not persistent)
// UNO_NAME_REDLINE_MOVED_ID: sal_uInt32; 0 == not moved, 1 == moved, but don't have its pair, 2+ == unique ID