From 2791fd7016e029796b1c2b217d688576b63380f8 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Mon, 6 Dec 2021 19:56:04 -0500 Subject: [PATCH] Use wx.DF_UNICODETEXT instead of wx.DF_TEXT wx.DF_TEXT doesn't work on macOS and Unicode should be available under all platforms. --- .../snippets/python/converted/wx.Clipboard.1.py | 2 +- wx/py/shell.py | 4 ++-- wx/py/sliceshell.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Clipboard.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Clipboard.1.py index 3a9706ba..7f9d1548 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Clipboard.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Clipboard.1.py @@ -6,7 +6,7 @@ # Test if text content is available - not_empty = wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)) + not_empty = wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_UNICODETEXT)) # Read some text diff --git a/wx/py/shell.py b/wx/py/shell.py index fb319393..b5748471 100755 --- a/wx/py/shell.py +++ b/wx/py/shell.py @@ -1361,7 +1361,7 @@ class Shell(editwindow.EditWindow): """Replace selection with clipboard contents.""" if self.CanPaste() and wx.TheClipboard.Open(): ps2 = str(sys.ps2) - if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): + if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_UNICODETEXT)): data = wx.TextDataObject() if wx.TheClipboard.GetData(data): self.ReplaceSelection('') @@ -1380,7 +1380,7 @@ class Shell(editwindow.EditWindow): """Replace selection with clipboard contents, run commands.""" text = '' if wx.TheClipboard.Open(): - if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): + if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_UNICODETEXT)): data = wx.TextDataObject() if wx.TheClipboard.GetData(data): text = data.GetText() diff --git a/wx/py/sliceshell.py b/wx/py/sliceshell.py index 5fe49c3a..caaa906d 100755 --- a/wx/py/sliceshell.py +++ b/wx/py/sliceshell.py @@ -3429,7 +3429,7 @@ class SlicesShell(editwindow.EditWindow): #ADD UNDO if self.CanPaste() and wx.TheClipboard.Open(): ps2 = str(sys.ps2) - if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): + if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_UNICODETEXT)): data = wx.TextDataObject() if wx.TheClipboard.GetData(data): self.ReplaceSelection('') @@ -3459,7 +3459,7 @@ class SlicesShell(editwindow.EditWindow): """Replace selection with clipboard contents, run commands.""" text = '' if wx.TheClipboard.Open(): - if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): + if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_UNICODETEXT)): data = wx.TextDataObject() if wx.TheClipboard.GetData(data): text = data.GetText()