Kaydet (Commit) aa5b337b authored tarafından Matteo Casalin's avatar Matteo Casalin

Add EditPaM::operator !() and simplify EditSelection::IsInvalid

Change-Id: Id47d77e63eff2267f5e4112b88dfb90c3ec95bd8
üst 95412052
...@@ -1212,13 +1212,6 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM ) ...@@ -1212,13 +1212,6 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM )
return *this; return *this;
} }
bool EditSelection::IsInvalid() const
{
EditPaM aEmptyPaM;
return ( aStartPaM == aEmptyPaM ) || ( aEndPaM == aEmptyPaM );
}
void EditSelection::Adjust( const EditDoc& rNodes ) void EditSelection::Adjust( const EditDoc& rNodes )
{ {
DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" ); DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" );
......
...@@ -332,6 +332,7 @@ public: ...@@ -332,6 +332,7 @@ public:
EditPaM& operator = ( const EditPaM& rPaM ); EditPaM& operator = ( const EditPaM& rPaM );
friend bool operator == ( const EditPaM& r1, const EditPaM& r2 ); friend bool operator == ( const EditPaM& r1, const EditPaM& r2 );
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 #define PORTIONKIND_TEXT 0
...@@ -711,7 +712,7 @@ public: ...@@ -711,7 +712,7 @@ public:
const EditPaM& Max() const { return aEndPaM; } const EditPaM& Max() const { return aEndPaM; }
bool HasRange() const { return aStartPaM != aEndPaM; } bool HasRange() const { return aStartPaM != aEndPaM; }
bool IsInvalid() const; bool IsInvalid() const { return !aStartPaM || !aEndPaM; }
bool DbgIsBuggy( EditDoc& rDoc ); bool DbgIsBuggy( EditDoc& rDoc );
void Adjust( const EditDoc& rNodes ); void Adjust( const EditDoc& rNodes );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment