This fixes a small issue in JTextPane which makes the BeanShell JConsole
look a little nicer.
2006-02-07 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/JTextPane.java
(setCharacterAttributes): Replace input attributes when
replace==true.
/Roman
Index: javax/swing/JTextPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextPane.java,v
retrieving revision 1.14
diff -u -r1.14 JTextPane.java
--- javax/swing/JTextPane.java 5 Jan 2006 20:15:34 -0000 1.14
+++ javax/swing/JTextPane.java 7 Feb 2006 11:39:41 -0000
@@ -327,9 +327,11 @@
if (start == dot && end == dot)
// There is no selection, update insertAttributes instead
{
- MutableAttributeSet inputAttributes =
- getStyledEditorKit().getInputAttributes();
- inputAttributes.addAttributes(attribute);
+ MutableAttributeSet inputAttributes =
+ getStyledEditorKit().getInputAttributes();
+ if (replace)
+ inputAttributes.removeAttributes(inputAttributes);
+ inputAttributes.addAttributes(attribute);
}
else
getStyledDocument().setCharacterAttributes(start, end - start, attribute,