File: allow-unicode-text.patch

package info (click to toggle)
aegisub 3.2.2%2Bdfsg-7.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,988 kB
  • sloc: cpp: 57,067; ansic: 16,457; asm: 3,618; sh: 3,525; makefile: 409; python: 350; perl: 274; cs: 205; xml: 196; objc: 47
file content (46 lines) | stat: -rw-r--r-- 1,761 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 97bf5c77c34d8a63b642ebea9a68bacd89aa890b Mon Sep 17 00:00:00 2001
From: Thomas Goyne <tgoyne@gmail.com>
Date: Sun, 22 Mar 2015 10:46:58 -0800
Subject: [PATCH] Explicitly allow unicode text when pasting

---
 src/command/edit.cpp | 4 ++--
 src/utils.cpp        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/command/edit.cpp b/src/command/edit.cpp
index 4ee264e18..3ca9226d3 100644
--- a/src/command/edit.cpp
+++ b/src/command/edit.cpp
@@ -855,7 +855,7 @@ struct edit_line_paste final : public Command {
 	bool Validate(const agi::Context *) override {
 		bool can_paste = false;
 		if (wxTheClipboard->Open()) {
-			can_paste = wxTheClipboard->IsSupported(wxDF_TEXT);
+			can_paste = wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT);
 			wxTheClipboard->Close();
 		}
 		return can_paste;
@@ -886,7 +886,7 @@ struct edit_line_paste_over final : public Command {
 	bool Validate(const agi::Context *c) override {
 		bool can_paste = !c->selectionController->GetSelectedSet().empty();
 		if (can_paste && wxTheClipboard->Open()) {
-			can_paste = wxTheClipboard->IsSupported(wxDF_TEXT);
+			can_paste = wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT);
 			wxTheClipboard->Close();
 		}
 		return can_paste;
diff --git a/src/utils.cpp b/src/utils.cpp
index e5ffe9e75..e1cde5e83 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -126,7 +126,7 @@ std::string GetClipboard() {
 	wxString data;
 	wxClipboard *cb = wxClipboard::Get();
 	if (cb->Open()) {
-		if (cb->IsSupported(wxDF_TEXT)) {
+		if (cb->IsSupported(wxDF_TEXT) || cb->IsSupported(wxDF_UNICODETEXT)) {
 			wxTextDataObject raw_data;
 			cb->GetData(raw_data);
 			data = raw_data.GetText();