Bug 269599 Compiler warnings in N20090320-2000
1. WARNING in /src/org/eclipse/swt/examples/texteditor/TextEditor.java (at line 760) baselineUpItem.setToolTipText(getResourceString(USE_BASELINE ? "IncreaseBaseline" : "IncreaseFont")); //$NON-NLS-1$ Dead code 2. WARNING in /src/org/eclipse/swt/examples/texteditor/TextEditor.java (at line 774) baselineDownItem.setToolTipText(getResourceString(USE_BASELINE ? "DecreaseBaseline" : "DecreaseFont")); //$NON-NLS-1$ Dead code
examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
}
	void disposeRanges(StyleRange[] ranges) {
		StyleRange[] allRanges = styledText.getStyleRanges(0, styledText.getCharCount(), false);
		for (int i = 0; i < ranges.length; i++) {
			StyleRange style = ranges[i];
			boolean disposeFg = true, disposeBg = true, disposeStrike= true, disposeUnder= true, disposeBorder = true, disposeFont = true;
			for (int j = 0; j < allRanges.length; j++) {
				StyleRange s = allRanges[j];
				if (disposeFont && style.font == s.font) disposeFont = false;
				if (disposeFg && style.foreground == s.foreground) disposeFg = false;
				if (disposeBg && style.background == s.background) disposeBg = false;
				if (disposeStrike && style.strikeoutColor == s.strikeoutColor) disposeStrike = false;
				if (disposeUnder && style.underlineColor == s.underlineColor) disposeUnder = false;
				if (disposeBorder && style.borderColor == s.borderColor) disposeBorder =  false;
			}
			if (disposeFont && style.font != textFont && style.font != null)  style.font.dispose();
			if (disposeFg && style.foreground != textForeground && style.foreground != null) style.foreground.dispose();
			if (disposeBg && style.background != textBackground && style.background != null) style.background.dispose();
			if (disposeStrike && style.strikeoutColor != strikeoutColor && style.strikeoutColor != null) style.strikeoutColor.dispose();
			if (disposeUnder && style.underlineColor != underlineColor && style.underlineColor != null) style.underlineColor.dispose();
			if (disposeBorder && style.borderColor != borderColor && style.borderColor != null) style.borderColor.dispose();
			
			Object data = style.data;
			if (data != null) {
				if (data instanceof Image) ((Image)data).dispose();
				if (data instanceof Control) ((Control)data).dispose();
			}
		}
	}
	void disposeResource(Resource resource) {