diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-28 13:06:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-29 08:53:03 +0200 |
commit | 8a8864aeb710e4d17852dc9c0e02b03804a8bf3c (patch) | |
tree | bdec37c347a8dd6f63fdb169abe28ae667af85f6 /include/editeng | |
parent | ce301dadcbbf8d0f0a71c7eaebca9bfad2e08801 (diff) |
convert IsEqual/etc methods on ESelection to operators
Change-Id: Ia8424e701b6f22d0536ee7f3bdb0ecaaed94a3b9
Reviewed-on: https://gerrit.libreoffice.org/42904
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/editeng')
-rw-r--r-- | include/editeng/editdata.hxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index 2d5a5e035d87..9dc75ce0bed3 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -139,9 +139,10 @@ struct ESelection { } void Adjust(); - bool IsEqual( const ESelection& rS ) const; - bool IsLess( const ESelection& rS ) const; - bool IsGreater( const ESelection& rS ) const; + bool operator==( const ESelection& rS ) const; + bool operator!=( const ESelection& rS ) const { return !operator==(rS); } + bool operator<( const ESelection& rS ) const; + bool operator>( const ESelection& rS ) const; bool IsZero() const; bool HasRange() const; }; @@ -164,26 +165,26 @@ inline bool ESelection::IsZero() const ( nEndPara == 0 ) && ( nEndPos == 0 ) ); } -inline bool ESelection::IsEqual( const ESelection& rS ) const +inline bool ESelection::operator==( const ESelection& rS ) const { return ( ( nStartPara == rS.nStartPara ) && ( nStartPos == rS.nStartPos ) && ( nEndPara == rS.nEndPara ) && ( nEndPos == rS.nEndPos ) ); } -inline bool ESelection::IsLess( const ESelection& rS ) const +inline bool ESelection::operator<( const ESelection& rS ) const { // The selection must be adjusted. // => Only check if end of 'this' < Start of rS return ( nEndPara < rS.nStartPara ) || - ( ( nEndPara == rS.nStartPara ) && ( nEndPos < rS.nStartPos ) && !IsEqual( rS ) ); + ( ( nEndPara == rS.nStartPara ) && ( nEndPos < rS.nStartPos ) && !operator==( rS ) ); } -inline bool ESelection::IsGreater( const ESelection& rS ) const +inline bool ESelection::operator>( const ESelection& rS ) const { // The selection must be adjusted. // => Only check if end of 'this' < Start of rS return ( nStartPara > rS.nEndPara ) || - ( ( nStartPara == rS.nEndPara ) && ( nStartPos > rS.nEndPos ) && !IsEqual( rS ) ); + ( ( nStartPara == rS.nEndPara ) && ( nStartPos > rS.nEndPos ) && !operator==( rS ) ); } inline void ESelection::Adjust() |