forked from pool/python-wxPython
60 lines
2.0 KiB
Diff
60 lines
2.0 KiB
Diff
|
From 5b810b129db00a98c84672cd94a4a4be83ba8e69 Mon Sep 17 00:00:00 2001
|
||
|
From: Vadim Zeitlin <vadim@wxwidgets.org>
|
||
|
Date: Mon, 1 Jun 2020 17:25:41 +0200
|
||
|
Subject: [PATCH] Fix wxUIActionSimulator::Text() parameter documentation
|
||
|
|
||
|
This function explicitly accepts ASCII strings only, so it's limited to
|
||
|
"const char*", but was incorrectly documented as taking wxString.
|
||
|
|
||
|
Closes https://github.com/wxWidgets/wxWidgets/pull/1879
|
||
|
---
|
||
|
ext/wxWidgets/interface/wx/uiaction.h | 4 ++--
|
||
|
sip/cpp/sip_corewxUIActionSimulator.cpp | 2 +-
|
||
|
sip/gen/uiaction.sip | 2 +-
|
||
|
3 files changed, 4 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/ext/wxWidgets/interface/wx/uiaction.h b/ext/wxWidgets/interface/wx/uiaction.h
|
||
|
index 27b3aaf2..7d4eba52 100644
|
||
|
--- a/ext/wxWidgets/interface/wx/uiaction.h
|
||
|
+++ b/ext/wxWidgets/interface/wx/uiaction.h
|
||
|
@@ -176,8 +176,8 @@ public:
|
||
|
keyboard layout but may not work with other layouts.
|
||
|
|
||
|
@param text
|
||
|
- The string to type.
|
||
|
+ The string, containing only US ASCII characters, to type.
|
||
|
*/
|
||
|
- bool Text(const wxString& text);
|
||
|
+ bool Text(const char* text);
|
||
|
};
|
||
|
|
||
|
diff --git a/sip/cpp/sip_corewxUIActionSimulator.cpp b/sip/cpp/sip_corewxUIActionSimulator.cpp
|
||
|
index 42bc481a..85a47384 100644
|
||
|
--- a/sip/cpp/sip_corewxUIActionSimulator.cpp
|
||
|
+++ b/sip/cpp/sip_corewxUIActionSimulator.cpp
|
||
|
@@ -496,7 +496,7 @@ static PyObject *meth_wxUIActionSimulator_Text(PyObject *sipSelf, PyObject *sipA
|
||
|
PyErr_Clear();
|
||
|
|
||
|
Py_BEGIN_ALLOW_THREADS
|
||
|
- sipRes = sipCpp->Text(*text);
|
||
|
+ sipRes = sipCpp->Text(text->c_str());
|
||
|
Py_END_ALLOW_THREADS
|
||
|
sipReleaseType(const_cast< ::wxString *>(text),sipType_wxString,textState);
|
||
|
|
||
|
diff --git a/sip/gen/uiaction.sip b/sip/gen/uiaction.sip
|
||
|
index 788e2b65..ff27dfa0 100644
|
||
|
--- a/sip/gen/uiaction.sip
|
||
|
+++ b/sip/gen/uiaction.sip
|
||
|
@@ -129,7 +129,7 @@ public:
|
||
|
%End
|
||
|
|
||
|
bool Text(
|
||
|
- const wxString & text
|
||
|
+ const char* text
|
||
|
);
|
||
|
%Docstring
|
||
|
Text(text) -> bool
|
||
|
--
|
||
|
2.27.0
|
||
|
|