|
@@ -2529,9 +2529,9 @@ bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-void RichTextLabel::selection_copy() {
|
|
|
|
|
|
+String RichTextLabel::get_selected_text() {
|
|
if (!selection.active || !selection.enabled) {
|
|
if (!selection.active || !selection.enabled) {
|
|
- return;
|
|
|
|
|
|
+ return "";
|
|
}
|
|
}
|
|
|
|
|
|
String text;
|
|
String text;
|
|
@@ -2561,6 +2561,12 @@ void RichTextLabel::selection_copy() {
|
|
item = _get_next_item(item, true);
|
|
item = _get_next_item(item, true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ return text;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void RichTextLabel::selection_copy() {
|
|
|
|
+ String text = get_selected_text();
|
|
|
|
+
|
|
if (text != "") {
|
|
if (text != "") {
|
|
DisplayServer::get_singleton()->clipboard_set(text);
|
|
DisplayServer::get_singleton()->clipboard_set(text);
|
|
}
|
|
}
|