// already have a direction set, no new paragraphs have been
// inserted or a new paragraph has been inserted and its join
// direction isn't originate, and the element at endOffset
// is a leaf.
if(insertingAtBoundry && endOffset < docLength) {
ElementSpec last = (ElementSpec) parseBuffer.lastElement();
if(last.getType() == ElementSpec.ContentType &&
last.getDirection() != ElementSpec.JoinPreviousDirection &&
((lastStartSpec == null && (paragraph == pParagraph ||
insertingAfterNewline)) ||
(lastStartSpec != null && lastStartSpec.getDirection() !=