Kaydet (Commit) 9ca8a63f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use consistent integer types in the SwRedlineTable interface

ddd84d08 "Convert
SV_DECL_PTRARR_SORT_DEL(_SwRedlineTbl) to o3tl::sorted_vector" had introduced
size and operator[] operating on underlying vector's size_type, but had left the
other functions at sal_uInt16.  Keep everything at sal_uInt16 for now until
fixing everything to use that underlying vector size_type instead.

Change-Id: I92570dcb8ab5fa88b52e2b24899b833829693a88
üst d9262e19
......@@ -318,7 +318,10 @@ class SwRedlineTable
public:
typedef o3tl::sorted_vector<SwRangeRedline*, CompareSwRedlineTable,
o3tl::find_partialorder_ptrequals> vector_type;
typedef vector_type::size_type size_type;
typedef sal_uInt16 size_type;
//TOOD: should be vector_type::size_type, but then all the uses of
// sal_uInt16 in this class that represent positions in maVector need to
// be changed, too
private:
vector_type maVector;
public:
......
......@@ -775,7 +775,7 @@ void SwDocTest::testSwScanner()
const SwRedlineTable& rTable = m_pDoc->getIDocumentRedlineAccess().GetRedlineTable();
SwNodes& rNds = m_pDoc->GetNodes();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rTable.size());
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(1), rTable.size());
SwNodeIndex* pNodeIdx = rTable[0]->GetContentIdx();
CPPUNIT_ASSERT(pNodeIdx);
......
......@@ -839,7 +839,7 @@ void SwUiWriterTest::testCp1000071()
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
CPPUNIT_ASSERT_EQUAL( size_t( 2 ), rTable.size());
CPPUNIT_ASSERT_EQUAL( SwRedlineTable::size_type( 2 ), rTable.size());
sal_uLong redlineStart0NodeIndex = rTable[ 0 ]->Start()->nNode.GetIndex();
sal_Int32 redlineStart0Index = rTable[ 0 ]->Start()->nContent.GetIndex();
sal_uLong redlineEnd0NodeIndex = rTable[ 0 ]->End()->nNode.GetIndex();
......@@ -861,7 +861,7 @@ void SwUiWriterTest::testCp1000071()
rUndoManager.Undo();
// Check that redlines are the same like at the beginning.
CPPUNIT_ASSERT_EQUAL( size_t( 2 ), rTable.size());
CPPUNIT_ASSERT_EQUAL( SwRedlineTable::size_type( 2 ), rTable.size());
CPPUNIT_ASSERT_EQUAL( redlineStart0NodeIndex, rTable[ 0 ]->Start()->nNode.GetIndex());
CPPUNIT_ASSERT_EQUAL( redlineStart0Index, rTable[ 0 ]->Start()->nContent.GetIndex());
CPPUNIT_ASSERT_EQUAL( redlineEnd0NodeIndex, rTable[ 0 ]->End()->nNode.GetIndex());
......@@ -4012,7 +4012,7 @@ void SwUiWriterTest::testRedlineViewAuthor()
// Now assert that SwView::SetRedlineAuthor() had an effect.
const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rTable.size());
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(1), rTable.size());
SwRangeRedline* pRedline = rTable[0];
// This was 'Unknown Author' instead of 'A U. Thor'.
CPPUNIT_ASSERT_EQUAL(aAuthor, pRedline->GetAuthorString());
......@@ -4067,7 +4067,7 @@ void SwUiWriterTest::testRedlineTimestamp()
// The relatively rare case when waiting for a second also changes the minute.
return;
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rTable.size());
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(2), rTable.size());
sal_uInt16 nSec1 = rTable[0]->GetRedlineData().GetTimeStamp().GetSec();
sal_uInt16 nSec2 = rTable[1]->GetRedlineData().GetTimeStamp().GetSec();
// This failed, seconds was always 0.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment