bool IgnoreBlank()
{
if (this.currentLeaf == this.startLeaf)
return true;
if (this.endLeaf != null && this.currentLeaf.Current == this.endLeaf.Current)
return true;
ParagraphIterator nextIter = this.currentLeaf.GetNextLeaf();
while (nextIter != null && (IsBlank(nextIter.Current) || nextIter.Current is BookmarkField))
{
nextIter = nextIter.GetNextLeaf();
}
if (nextIter == null)
return true;
if (IsTab(nextIter.Current))
return true;
ParagraphIterator prevIter = this.currentLeaf.GetPreviousLeaf();
// Can be null if currentLeaf is the first leaf
DocumentObject obj = prevIter != null ? prevIter.Current : null;
while (obj != null && obj is BookmarkField)
{
prevIter = prevIter.GetPreviousLeaf();
if (prevIter != null)
obj = prevIter.Current;
else
obj = null;
}
if (obj == null)
return true;
return IsBlank(obj) || IsTab(obj);
}