diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-21 12:12:51 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-22 10:29:21 +0200 |
commit | 6f53baab070270b6913fd6035152382e963f4a66 (patch) | |
tree | 9eca11dc215a4789c33b5523cd42a94b72f5acdc /sw/qa/extras | |
parent | c066607fdef76f6a33d29182a465e7cf215c731f (diff) |
Related: tdf#102308 sw: ignore seconds when combining redlines
The purpose of storing seconds was to get a better timestamp, not to
make combining impossible.
Also fix two issues with the existing testcase:
- read both timestamps, so test doesn't fail if the second is 0 in the
first redline
- don't fail if minute changes while waiting for a second
Change-Id: Ib6c8ecdcf2f0da9191f0b48e6aaefc0b2449583e
(cherry picked from commit f240f073d228e62afd3f60563c23626efad0df7f)
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index ad97db70bb8e..f68d292f0009 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -3379,11 +3379,20 @@ void SwUiWriterTest::testRedlineTimestamp() pWrtShell->EndDoc(); pWrtShell->Insert("zzz"); + // Inserting additional characters at the start changed the table size to + // 3, i.e. the first and the second "aaa" wasn't combined. + pWrtShell->SttDoc(); + pWrtShell->Insert("aaa"); + // Now assert that at least one of the the seconds are not 0. const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); + if (rTable.size() >= 2 && rTable[0]->GetRedlineData().GetTimeStamp().GetMin() != rTable[1]->GetRedlineData().GetTimeStamp().GetMin()) + // The relatively rare case when waiting for a second also changes the minute. + return; + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rTable.size()); sal_uInt16 nSec1 = rTable[0]->GetRedlineData().GetTimeStamp().GetSec(); - sal_uInt16 nSec2 = rTable[0]->GetRedlineData().GetTimeStamp().GetSec(); + sal_uInt16 nSec2 = rTable[1]->GetRedlineData().GetTimeStamp().GetSec(); // This failed, seconds was always 0. CPPUNIT_ASSERT(nSec1 != 0 || nSec2 != 0); } |