loplugin:mergeclasses
Change-Id: Ia4ae4f17fba9775fc53618ab1662c10e37ee4be3
This commit is contained in:
@@ -83,7 +83,6 @@ merge XFDate with XFDateStart
|
|||||||
merge XFDateTimePart with XFTimePart
|
merge XFDateTimePart with XFTimePart
|
||||||
merge XMLTransformer with XMLTransformerBase
|
merge XMLTransformer with XMLTransformerBase
|
||||||
merge XclDebugObjCounter with XclRootData
|
merge XclDebugObjCounter with XclRootData
|
||||||
merge _SwRedlineTable with SwRedlineTable
|
|
||||||
merge abp::OModuleResourceClient with abp::OABSPilotUno
|
merge abp::OModuleResourceClient with abp::OABSPilotUno
|
||||||
merge accessibility::IComboListBoxHelper with VCLListBoxHelper
|
merge accessibility::IComboListBoxHelper with VCLListBoxHelper
|
||||||
merge basctl::docs::IDocumentDescriptorFilter with basctl::(anonymous namespace)::FilterDocuments
|
merge basctl::docs::IDocumentDescriptorFilter with basctl::(anonymous namespace)::FilterDocuments
|
||||||
|
@@ -183,18 +183,18 @@ struct CompareSwRedlineTable
|
|||||||
{
|
{
|
||||||
bool operator()(SwRangeRedline* const &lhs, SwRangeRedline* const &rhs) const;
|
bool operator()(SwRangeRedline* const &lhs, SwRangeRedline* const &rhs) const;
|
||||||
};
|
};
|
||||||
class _SwRedlineTable
|
|
||||||
: public o3tl::sorted_vector<SwRangeRedline*, CompareSwRedlineTable,
|
|
||||||
o3tl::find_partialorder_ptrequals>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
~_SwRedlineTable();
|
|
||||||
};
|
|
||||||
|
|
||||||
class SwRedlineTable : private _SwRedlineTable
|
class SwRedlineTable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool Contains(const SwRangeRedline* p) const { return find(const_cast<SwRangeRedline* const>(p)) != end(); }
|
typedef o3tl::sorted_vector<SwRangeRedline*, CompareSwRedlineTable,
|
||||||
|
o3tl::find_partialorder_ptrequals> vector_type;
|
||||||
|
typedef vector_type::size_type size_type;
|
||||||
|
private:
|
||||||
|
vector_type maVector;
|
||||||
|
public:
|
||||||
|
~SwRedlineTable();
|
||||||
|
bool Contains(const SwRangeRedline* p) const { return maVector.find(const_cast<SwRangeRedline* const>(p)) != maVector.end(); }
|
||||||
sal_uInt16 GetPos(const SwRangeRedline* p) const;
|
sal_uInt16 GetPos(const SwRangeRedline* p) const;
|
||||||
|
|
||||||
bool Insert( SwRangeRedline* p, bool bIns = true );
|
bool Insert( SwRangeRedline* p, bool bIns = true );
|
||||||
@@ -227,14 +227,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
const SwRangeRedline* FindAtPosition( const SwPosition& startPosition, sal_uInt16& tableIndex, bool next = true ) const;
|
const SwRangeRedline* FindAtPosition( const SwPosition& startPosition, sal_uInt16& tableIndex, bool next = true ) const;
|
||||||
|
|
||||||
using _SwRedlineTable::const_iterator;
|
bool empty() const { return maVector.empty(); }
|
||||||
using _SwRedlineTable::begin;
|
size_type size() const { return maVector.size(); }
|
||||||
using _SwRedlineTable::end;
|
SwRangeRedline* operator[]( size_type idx ) const { return maVector[idx]; }
|
||||||
using _SwRedlineTable::size;
|
vector_type::const_iterator begin() const { return maVector.begin(); }
|
||||||
using _SwRedlineTable::size_type;
|
vector_type::const_iterator end() const { return maVector.end(); }
|
||||||
using _SwRedlineTable::operator[];
|
void Resort() { maVector.Resort(); }
|
||||||
using _SwRedlineTable::empty;
|
|
||||||
using _SwRedlineTable::Resort;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Table that holds 'extra' redlines, such as 'table row insert\delete', 'paragraph moves' etc...
|
/// Table that holds 'extra' redlines, such as 'table row insert\delete', 'paragraph moves' etc...
|
||||||
|
@@ -295,7 +295,7 @@ bool SwRedlineTable::Insert( SwRangeRedline* p, bool bIns )
|
|||||||
{
|
{
|
||||||
if( p->HasValidRange() )
|
if( p->HasValidRange() )
|
||||||
{
|
{
|
||||||
std::pair<_SwRedlineTable::const_iterator, bool> rv = insert( p );
|
std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p );
|
||||||
size_t nP = rv.first - begin();
|
size_t nP = rv.first - begin();
|
||||||
p->CallDisplayFunc(0, nP);
|
p->CallDisplayFunc(0, nP);
|
||||||
return rv.second;
|
return rv.second;
|
||||||
@@ -311,7 +311,7 @@ bool SwRedlineTable::Insert( SwRangeRedline* p, sal_uInt16& rP, bool bIns )
|
|||||||
{
|
{
|
||||||
if( p->HasValidRange() )
|
if( p->HasValidRange() )
|
||||||
{
|
{
|
||||||
std::pair<_SwRedlineTable::const_iterator, bool> rv = insert( p );
|
std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p );
|
||||||
rP = rv.first - begin();
|
rP = rv.first - begin();
|
||||||
p->CallDisplayFunc(0, rP);
|
p->CallDisplayFunc(0, rP);
|
||||||
return rv.second;
|
return rv.second;
|
||||||
@@ -439,17 +439,17 @@ bool CompareSwRedlineTable::operator()(SwRangeRedline* const &lhs, SwRangeRedlin
|
|||||||
return *lhs < *rhs;
|
return *lhs < *rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
_SwRedlineTable::~_SwRedlineTable()
|
SwRedlineTable::~SwRedlineTable()
|
||||||
{
|
{
|
||||||
DeleteAndDestroyAll();
|
maVector.DeleteAndDestroyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt16 SwRedlineTable::GetPos(const SwRangeRedline* p) const
|
sal_uInt16 SwRedlineTable::GetPos(const SwRangeRedline* p) const
|
||||||
{
|
{
|
||||||
const_iterator it = find(const_cast<SwRangeRedline* const>(p));
|
vector_type::const_iterator it = maVector.find(const_cast<SwRangeRedline* const>(p));
|
||||||
if( it == end() )
|
if( it == maVector.end() )
|
||||||
return USHRT_MAX;
|
return USHRT_MAX;
|
||||||
return it - begin();
|
return it - maVector.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SwRedlineTable::Remove( const SwRangeRedline* p )
|
bool SwRedlineTable::Remove( const SwRangeRedline* p )
|
||||||
@@ -465,9 +465,9 @@ void SwRedlineTable::Remove( sal_uInt16 nP )
|
|||||||
{
|
{
|
||||||
SwDoc* pDoc = 0;
|
SwDoc* pDoc = 0;
|
||||||
if( !nP && 1 == size() )
|
if( !nP && 1 == size() )
|
||||||
pDoc = front()->GetDoc();
|
pDoc = maVector.front()->GetDoc();
|
||||||
|
|
||||||
erase( begin() + nP );
|
maVector.erase( maVector.begin() + nP );
|
||||||
|
|
||||||
SwViewShell* pSh;
|
SwViewShell* pSh;
|
||||||
if( pDoc && !pDoc->IsInDtor() &&
|
if( pDoc && !pDoc->IsInDtor() &&
|
||||||
@@ -484,11 +484,11 @@ void SwRedlineTable::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
|
|||||||
{
|
{
|
||||||
SwDoc* pDoc = 0;
|
SwDoc* pDoc = 0;
|
||||||
if( !nP && nL && nL == size() )
|
if( !nP && nL && nL == size() )
|
||||||
pDoc = front()->GetDoc();
|
pDoc = maVector.front()->GetDoc();
|
||||||
|
|
||||||
for( const_iterator it = begin() + nP; it != begin() + nP + nL; ++it )
|
for( vector_type::const_iterator it = maVector.begin() + nP; it != maVector.begin() + nP + nL; ++it )
|
||||||
delete *it;
|
delete *it;
|
||||||
erase( begin() + nP, begin() + nP + nL );
|
maVector.erase( maVector.begin() + nP, maVector.begin() + nP + nL );
|
||||||
|
|
||||||
SwViewShell* pSh;
|
SwViewShell* pSh;
|
||||||
if( pDoc && !pDoc->IsInDtor() &&
|
if( pDoc && !pDoc->IsInDtor() &&
|
||||||
@@ -563,7 +563,7 @@ const SwRangeRedline* SwRedlineTable::FindAtPosition( const SwPosition& rSttPos,
|
|||||||
bool bNext ) const
|
bool bNext ) const
|
||||||
{
|
{
|
||||||
const SwRangeRedline* pFnd = 0;
|
const SwRangeRedline* pFnd = 0;
|
||||||
for( ; rPos < size() ; ++rPos )
|
for( ; rPos < maVector.size() ; ++rPos )
|
||||||
{
|
{
|
||||||
const SwRangeRedline* pTmp = (*this)[ rPos ];
|
const SwRangeRedline* pTmp = (*this)[ rPos ];
|
||||||
if( pTmp->HasMark() && pTmp->IsVisible() )
|
if( pTmp->HasMark() && pTmp->IsVisible() )
|
||||||
|
Reference in New Issue
Block a user