summaryrefslogtreecommitdiff
path: root/javax/swing/JTextPane.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/JTextPane.java')
-rw-r--r--javax/swing/JTextPane.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/javax/swing/JTextPane.java b/javax/swing/JTextPane.java
index 7c95d7682..c0a5f80cf 100644
--- a/javax/swing/JTextPane.java
+++ b/javax/swing/JTextPane.java
@@ -327,9 +327,11 @@ public class JTextPane
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,