diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-03-16 19:33:48 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-17 10:38:05 +0000 |
commit | 56552630fe21a143ca243807f093ebb150a2de98 (patch) | |
tree | 3aa080240bf2eeb60275473b6288b82262fb1a16 /sw/inc/redline.hxx | |
parent | a9bbc74f1d9053cb3b950e0c14e0fae18f1b0257 (diff) |
sw lok: Use unique redline identifier, instead of array indices
Use a static integer counter as identifier to each redline
Change few unit-tets that was testing redlines by using a hardcoded array
index. Instead use these unique redline identifiers now.
Change-Id: I63aec3fc8ab10d0dad0c936600d16e96999a2bcd
Reviewed-on: https://gerrit.libreoffice.org/35276
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/inc/redline.hxx')
-rw-r--r-- | sw/inc/redline.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index b75b666ae8a6..688cd1797c9d 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -173,6 +173,7 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM SwNodeIndex* pContentSect; bool bDelLastPara : 1; bool bIsVisible : 1; + sal_uInt32 m_nId; void MoveToSection(); void CopyToSection(); @@ -180,6 +181,8 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM void MoveFromSection(size_t nMyPos); public: + static sal_uInt32 m_nLastId; + SwRangeRedline( RedlineType_t eType, const SwPaM& rPam ); SwRangeRedline( const SwRedlineData& rData, const SwPaM& rPam ); SwRangeRedline( const SwRedlineData& rData, const SwPosition& rPos ); @@ -187,11 +190,12 @@ public: SwRangeRedline(SwRedlineData* pData, const SwPosition& rPos, bool bDelLP) : SwPaM( rPos ), pRedlineData( pData ), pContentSect( nullptr ), - bDelLastPara( bDelLP ), bIsVisible( true ) + bDelLastPara( bDelLP ), bIsVisible( true ), m_nId( m_nLastId++ ) {} SwRangeRedline( const SwRangeRedline& ); virtual ~SwRangeRedline() override; + sal_uInt32 GetId() const { return m_nId; } SwNodeIndex* GetContentIdx() const { return pContentSect; } // For Undo. void SetContentIdx( const SwNodeIndex* ); |