Remove trailing spaces at the end of a paragraph. Modify the way to deal with BPs which have not been added to vecInlineBreaks. See bug 28706. The code was rewritten w.r.t. the submitted patch.