diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-12-05 23:18:38 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-12-28 08:05:55 +0100 |
commit | aa2376eb12b02ae88399412495b035f1ddce3b72 (patch) | |
tree | 8d0e5bfd09f1446961817d1ded7c1b441f178fca | |
parent | ff0a9cb65ae5d862575b091c44e114c117e9f3b5 (diff) |
editeng: simplify and clean-up EPaM
Remove copy/assign operator as they are not needed because they
are the same as default.
Change-Id: I1a71e5de8024680307a65e8b5540b250178f0a97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161343
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | include/editeng/EPaM.hxx | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/include/editeng/EPaM.hxx b/include/editeng/EPaM.hxx index 85ad4bd2b6ee..d474dfe18235 100644 --- a/include/editeng/EPaM.hxx +++ b/include/editeng/EPaM.hxx @@ -21,44 +21,30 @@ struct EPaM { - sal_Int32 nPara; - sal_Int32 nIndex; + sal_Int32 nPara = 0; + sal_Int32 nIndex = 0; - EPaM() - : nPara(0) - , nIndex(0) - { - } - EPaM(sal_Int32 nP, sal_Int32 nI) - : nPara(nP) - , nIndex(nI) + EPaM() = default; + + EPaM(sal_Int32 _nParagraph, sal_Int32 _nIndex) + : nPara(_nParagraph) + , nIndex(_nIndex) { } - EPaM(const EPaM& r) - : nPara(r.nPara) - , nIndex(r.nIndex) + + bool operator==(const EPaM& rInstance) const { + return nPara == rInstance.nPara && nIndex == rInstance.nIndex; } - EPaM& operator=(const EPaM& r) + + bool operator!=(const EPaM& rSelection) const = default; + + bool operator<(const EPaM& rInstance) const { - nPara = r.nPara; - nIndex = r.nIndex; - return *this; + return (nPara < rInstance.nPara) || (nPara == rInstance.nPara && nIndex < rInstance.nIndex); } - inline bool operator==(const EPaM& r) const; - inline bool operator<(const EPaM& r) const; }; -inline bool EPaM::operator<(const EPaM& r) const -{ - return (nPara < r.nPara) || ((nPara == r.nPara) && nIndex < r.nIndex); -} - -inline bool EPaM::operator==(const EPaM& r) const -{ - return (nPara == r.nPara) && (nIndex == r.nIndex); -} - template <typename charT, typename traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream, EPaM const& aPaM) |