summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-03-02 01:09:04 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-03-02 20:18:02 +0100
commitaa5b337bff8d9c8c07f2c67a043bef4f07fccb79 (patch)
tree523a6da36e9bcbb97d34e3f79ef2ba3d24ecf332 /editeng
parent95412052fadffb323d21eba1c1d54c9803baabd2 (diff)
Add EditPaM::operator !() and simplify EditSelection::IsInvalid
Change-Id: Id47d77e63eff2267f5e4112b88dfb90c3ec95bd8
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.cxx7
-rw-r--r--editeng/source/editeng/editdoc.hxx3
2 files changed, 2 insertions, 8 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index f44898e0eead..aa82606ced5e 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1212,13 +1212,6 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM )
return *this;
}
-bool EditSelection::IsInvalid() const
-{
- EditPaM aEmptyPaM;
-
- return ( aStartPaM == aEmptyPaM ) || ( aEndPaM == aEmptyPaM );
-}
-
void EditSelection::Adjust( const EditDoc& rNodes )
{
DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" );
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index a73de4a6f420..4dc702b3ff6e 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -332,6 +332,7 @@ public:
EditPaM& operator = ( const EditPaM& rPaM );
friend bool operator == ( const EditPaM& r1, const EditPaM& r2 );
friend bool operator != ( const EditPaM& r1, const EditPaM& r2 );
+ bool operator !() const { return !pNode && !nIndex; }
};
#define PORTIONKIND_TEXT 0
@@ -711,7 +712,7 @@ public:
const EditPaM& Max() const { return aEndPaM; }
bool HasRange() const { return aStartPaM != aEndPaM; }
- bool IsInvalid() const;
+ bool IsInvalid() const { return !aStartPaM || !aEndPaM; }
bool DbgIsBuggy( EditDoc& rDoc );
void Adjust( const EditDoc& rNodes );