1
0
wxWidgets-3_2/0002-Make-the-wxUIActionSimulator-Text-implementation-mat.patch
Jan Engelhardt 14c1cf32fb Accepting request 810613 from home:StefanBruens:branches:X11:wxWidgets
- Fix wxQt build with Qt 5.15, add
  0001-Add-missing-QPainterPath-include-required-with-Qt-5..patch
- Make liblzma build dependency explicit, to have the same feature
  set on all flavors.
- Fix wrong function signature causing build failures in
  python-wxPython, add:
  0002-Make-the-wxUIActionSimulator-Text-implementation-mat.patch
- Add explicit libXtst build dependency, required for Leap 15.1
  (already implicit on Leap 15.2 and TW).

OBS-URL: https://build.opensuse.org/request/show/810613
OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/wxWidgets-3_2?expand=0&rev=56
2020-06-01 14:47:15 +00:00

50 lines
1.6 KiB
Diff

From dd2f7c31716029171706ff70b56eb66fd082e296 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 31 May 2020 20:01:54 +0200
Subject: [PATCH 2/2] Make the wxUIActionSimulator::Text implementation match
the interface
interface/uiaction.h declares the parameter as 'const wxString&'. For
non-STL variants, this just makes the char* conversion explicit, while
for STL variants this actually allows to pass a wxString to the method.
This also fixes a compile error when building wxPython with a system
wxWidgets library which has been built with wxUSE_STL=1.
---
include/wx/uiaction.h | 1 +
src/common/uiactioncmn.cpp | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/include/wx/uiaction.h b/include/wx/uiaction.h
index 9b8df1094f..c8d01f52df 100644
--- a/include/wx/uiaction.h
+++ b/include/wx/uiaction.h
@@ -60,6 +60,7 @@ public:
bool Char(int keycode, int modifiers = wxMOD_NONE);
bool Text(const char *text);
+ bool Text(const wxString& text);
// Select the item with the given text in the currently focused control.
bool Select(const wxString& text);
diff --git a/src/common/uiactioncmn.cpp b/src/common/uiactioncmn.cpp
index eeaf01ef93..092825681f 100644
--- a/src/common/uiactioncmn.cpp
+++ b/src/common/uiactioncmn.cpp
@@ -163,6 +163,12 @@ static bool MapUnshifted(char& ch)
return true;
}
+bool wxUIActionSimulator::Text(const wxString& text)
+{
+ const wxScopedCharBuffer ascii = text.ToAscii();
+ return Text(ascii.data());
+}
+
bool wxUIActionSimulator::Text(const char *s)
{
while ( *s != '\0' )
--
2.26.2