summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-15 16:04:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-15 17:03:25 +0200
commit84e91157c674b0b78b792fc1d4f841fe50b1dd9b (patch)
treedb214e7e289c292ca3af31af086e4a4adc963376 /sw/qa
parent5518de780519ad95d2079d21255de3edf20879f3 (diff)
sw: allow select of redline by index
Previously .uno:NextTrackedChange always worked by cursor position, but redlines are stored in the redline table, so they have a unique index. Allow specifying that index when invoking the command, and in that case ignore the cursor position. Change-Id: I7dbe8044feca8fcc48635482a22317b024f40ffa
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx30
1 files changed, 27 insertions, 3 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8d0ed48feb03..5080f375070d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -3853,15 +3853,39 @@ void SwUiWriterTest::testRedlineParam()
pWrtShell->EndDoc();
pWrtShell->Insert("zzz");
- // Move the cursor to the start again, and reject the second change.
+ // Select the first redline.
pWrtShell->SttDoc();
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
- {"RejectTrackedChange", uno::makeAny(static_cast<sal_uInt16>(1))}
+ {"NextTrackedChange", uno::makeAny(static_cast<sal_uInt16>(0))}
}));
- lcl_dispatchCommand(mxComponent, ".uno:RejectTrackedChange", aPropertyValues);
+ lcl_dispatchCommand(mxComponent, ".uno:NextTrackedChange", aPropertyValues);
Scheduler::ProcessEventsToIdle();
SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false);
+ // This failed: the parameter wasn't handled so the next change (zzz) was
+ // selected, not the first one (aaa).
+ CPPUNIT_ASSERT_EQUAL(OUString("aaa"), pShellCursor->GetText());
+
+ // Select the second redline.
+ pWrtShell->SttDoc();
+ aPropertyValues = comphelper::InitPropertySequence(
+ {
+ {"NextTrackedChange", uno::makeAny(static_cast<sal_uInt16>(1))}
+ });
+ lcl_dispatchCommand(mxComponent, ".uno:NextTrackedChange", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
+ pShellCursor = pWrtShell->getShellCursor(false);
+ CPPUNIT_ASSERT_EQUAL(OUString("zzz"), pShellCursor->GetText());
+
+ // Move the cursor to the start again, and reject the second change.
+ pWrtShell->SttDoc();
+ aPropertyValues = comphelper::InitPropertySequence(
+ {
+ {"RejectTrackedChange", uno::makeAny(static_cast<sal_uInt16>(1))}
+ });
+ lcl_dispatchCommand(mxComponent, ".uno:RejectTrackedChange", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
+ pShellCursor = pWrtShell->getShellCursor(false);
// This was 'middlezzz', the uno command rejected the redline under the
// cursor, instead of the requested one.