summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter6.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2023-10-31 15:51:09 +0100
committerLászló Németh <nemeth@numbertext.org>2023-10-31 23:07:01 +0100
commit4cf8de89bad9143a5b2dd3d6351080bf62b76029 (patch)
tree8e4b59fa549074c83f4e0d8febde54633625aff9 /sw/qa/extras/uiwriter/uiwriter6.cxx
parentf5ae03b235766070b1c1e5bf46d0cb86a8196b10 (diff)
tdf#157667 sw track changes: fix cycle case on multiple words
Fix tracked cycle case on multiple selected words. Follow up to commit dc748d7dbd114fbf663752258dbaf003af2926c3 "tdf#141198 sw: fix cycle case with change tracking" and commit 79435eb55ef226fb0e3507aabdc2f8af062680f6 "tdf#157988 sw track changes: fix cycle case on a selected word". Change-Id: I81566f8be0cf6f4af6ed4af031116bd19e3884d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158732 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter6.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter6.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx
index 83bc43f6d866..8e6b91043b0b 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -759,6 +759,49 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157988)
CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt"));
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157667)
+{
+ createSwDoc("tdf130088.docx");
+ SwDoc* pDoc = getSwDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ // select the first three words
+ pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 25, /*bBasicCall=*/false);
+
+ // enable redlining
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+ pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+
+ // show changes
+ CPPUNIT_ASSERT_MESSAGE(
+ "redlines should be visible",
+ IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+ // cycle case with change tracking
+
+ dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+
+ CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith(
+ "Integer sodalesSodales tinciduntTincidunt tristique."));
+
+ dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+
+ // This was false (missing revert of the tracked change)
+ CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt tristique."));
+
+ dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+
+ CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith(
+ "Integer sodalesINTEGER SODALES tincidunt tristique."));
+
+ dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+ dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+ dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+
+ CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt tristique."));
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108048)
{
createSwDoc();