Browse Source

fix copy and pasting being horribly broken after textpane fixing

tags/0.6.3m1rc1
Gregory Holmes 15 years ago
parent
commit
5538f54268

+ 15
- 0
src/com/dmdirc/addons/ui_swing/textpane/Line.java View File

@@ -84,6 +84,21 @@ public class Line {
84 84
      * @return Line at the specified number or null
85 85
      */
86 86
     public String getText() {
87
+        StringBuilder lineText = new StringBuilder();
88
+        for (String linePart : lineParts) {
89
+            lineText.append(linePart);
90
+        }
91
+        return Styliser.stipControlCodes(lineText.toString());
92
+    }
93
+
94
+    /**
95
+     * Returns the Line text at the specified number.
96
+     *
97
+     * @return Line at the specified number or null
98
+     *
99
+     * @since 0.6.3
100
+     */
101
+    public String getStyledText() {
87 102
         StringBuilder lineText = new StringBuilder();
88 103
         for (String linePart : lineParts) {
89 104
             lineText.append(linePart);

+ 1
- 1
src/com/dmdirc/addons/ui_swing/textpane/TextPane.java View File

@@ -201,7 +201,7 @@ public final class TextPane extends JComponent implements AdjustmentListener,
201 201
     /**
202 202
      * Returns the selected text.
203 203
      * 
204
-     *     *    <li>0 = start line</li>
204
+     *    <li>0 = start line</li>
205 205
      *    <li>1 = start char</li>
206 206
      *    <li>2 = end line</li>
207 207
      *    <li>3 = end char</li>

Loading…
Cancel
Save