FormatTextRanges () { FormatTextRanges result = new FormatTextRanges(); for (FormatTextRange range : myRanges) { if (range.isProcessHeadingWhitespace()) { result.add(range.getNonEmptyTextRange(), true); } else { result.add(range.getTextRange(), false); } } return result; }