final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
while (structuredDocumentRegion != null && structuredDocumentRegion.getStartOffset() <= partitionEndOffset) {
ITextRegion region = null;
ITextRegionList regions = structuredDocumentRegion.getRegions();
int nRegions = regions.size();
StyleRange styleRange = null;
for (int i = 0; i < nRegions; i++) {
region = regions.get(i);
TextAttribute attr = null;
TextAttribute previousAttr = null;
if (structuredDocumentRegion.getStartOffset(region) > partitionEndOffset)