sw/inc/docary.hxx | 5 ++++- sw/qa/core/uwriter.cxx | 2 +- sw/qa/extras/uiwriter/uiwriter.cxx | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-)
New commits: commit 9ca8a63fff65acf2ea13b391495ad232f4636548 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Mar 1 13:09:25 2017 +0100 Use consistent integer types in the SwRedlineTable interface ddd84d08c9bb6e00fbd9a73bd52a28688a8c1ba7 "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 diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index 45f9e45..2de106f 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -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: diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index c0c4560..a32605d 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -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); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d9c76ba..dd969a4 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -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. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits