Source:
<code>private void configureHardWrap() { if (shouldHardWrap()) { if (hardWrapSegmentListener == null) { final StyledText textWidget = getTextWidget(); hardWrapSegmentListener = new BidiSegmentListener() { public void lineGetSegments(BidiSegmentEvent e) { int[] segments = calculateWrapOffsets(e.lineText, MAX_LINE_WIDTH); if (segments != null) { char[] segmentsChars = new char[segments.length]; Arrays.fill(segmentsChars, '\n'); e.segments = segments; e.segmentsChars = segmentsChars; } } }; textWidget.addBidiSegmentListener(hardWrapSegmentListener); textWidget.setText(textWidget.getText()); if (brokenBidiPlatformTextWidth != -1) { Layout restrictedWidthLayout = new Layout() { @Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point size = SpellcheckableMessageArea.this .getSize(); Rectangle trim = SpellcheckableMessageArea.this .computeTrim(0, 0, 0, 0); size.x -= trim.width; size.y -= trim.height; if (size.x > brokenBidiPlatformTextWidth) size.x = brokenBidiPlatformTextWidth; return size; } @Override protected void layout(Composite composite, boolean flushCache) { Point size = computeSize(composite, SWT.DEFAULT, SWT.DEFAULT, flushCache); textWidget.setBounds(0, 0, size.x, size.y); } }; setLayout(restrictedWidthLayout); } } } else if (hardWrapSegmentListener != null) { StyledText textWidget = getTextWidget(); textWidget.removeBidiSegmentListener(hardWrapSegmentListener); textWidget.setText(textWidget.getText()); hardWrapSegmentListener = null; <START> if (brokenBidiPlatformTextWidth != -1) { <END> setLayout(new FillLayout()); } } }</code><technical_language>style nit: braces single line blocks</technical_language>

Target:
private void configureHardWrap() { if (shouldHardWrap()) { if (hardWrapSegmentListener == null) { final StyledText textWidget = getTextWidget(); hardWrapSegmentListener = new BidiSegmentListener() { public void lineGetSegments(BidiSegmentEvent e) { int[] segments = calculateWrapOffsets(e.lineText, MAX_LINE_WIDTH); if (segments != null) { char[] segmentsChars = new char[segments.length]; Arrays.fill(segmentsChars, '\n'); e.segments = segments; e.segmentsChars = segmentsChars; } } }; textWidget.addBidiSegmentListener(hardWrapSegmentListener); textWidget.setText(textWidget.getText()); if (brokenBidiPlatformTextWidth != -1) { Layout restrictedWidthLayout = new Layout() { @Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point size = SpellcheckableMessageArea.this .getSize(); Rectangle trim = SpellcheckableMessageArea.this .computeTrim(0, 0, 0, 0); size.x -= trim.width; size.y -= trim.height; if (size.x > brokenBidiPlatformTextWidth) size.x = brokenBidiPlatformTextWidth; return size; } @Override protected void layout(Composite composite, boolean flushCache) { Point size = computeSize(composite, SWT.DEFAULT, SWT.DEFAULT, flushCache); textWidget.setBounds(0, 0, size.x, size.y); } }; setLayout(restrictedWidthLayout); } } } else if (hardWrapSegmentListener != null) { StyledText textWidget = getTextWidget(); textWidget.removeBidiSegmentListener(hardWrapSegmentListener); textWidget.setText(textWidget.getText()); hardWrapSegmentListener = null; if (brokenBidiPlatformTextWidth != -1) setLayout(new FillLayout()); } }