Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: wxWidgets/wxWidgets
...
head fork: wxWidgets/wxWidgets
  • 8 commits
  • 19 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 23, 2012
@vadz vadz No real changes, just backwards propagate the changes to stc.cpp.
Apply the changes done directly to stc.cpp in r71428 and r71429 to the script
generating this code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
28b715a
@vadz vadz Fix calculation of the wxStyledTextCtrl selection size.
Use SCI_GETSELTEXT to compute the size of the buffer instead of doing it
ourselves, especially as we do it incorrectly in case of rectangular
selection.

Closes #14331.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
14a9a7a
@vadz vadz Document "raw control" use with accelerators.
Mention it in the places where the other accelerator prefixes are documented.

See #13496.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
61e9641
@vadz vadz Document that wxClipboard::Flush() is not implemented in wxGTK.
See #10515.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
620dd5a
@vadz vadz Compilation fix for wxUSE_STL && !wxUSE_STL_BASED_WXSTRING build.
Don't rely on implicit wxString to "const char*" conversion in Replace().

Closes #14327.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
7581e19
@vadz vadz No real changes, just slightly simplify HasAppKit_10_6() function.
Remove redundant check for version == -1.

See #13831.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
b334027
@vadz vadz Don't use wxCHECK_W32API_VERSION() in #if when it can be undefined.
wxCHECK_W32API_VERSION() is only defined when using MinGW, don't use it an #if
test which is always parsed but only in a separate test inside #ifdef __GNUG__
test which is parsed only when we do use MinGW.

This fixes harmless but annoying warning from MSVC 10.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
bfb8708
@vadz vadz Fix wxBase compilation with UTF-8-based wxString under MSW.
Use wxString::t_str() instead of wx_str() in Windows API function calls.

Closes #14325.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
d7d5ab6
View
1  docs/changes.txt
@@ -576,6 +576,7 @@ MSW:
- Fix handling of composite windows in wxToolTip (Armel Asselin).
- Add VT_I8 support to wxAutomationObject (PB).
- Fix wxListbook size calculations to avoid spurious scrollbars.
+- Fix non-GUI code compilation with wxUSE_UNICODE_UTF8 (Kolya Kosenko).
OSX:
View
12 include/wx/msw/winundef.h
@@ -252,10 +252,16 @@
#ifdef StartDoc
#undef StartDoc
- #if defined( __GNUG__ ) && !wxCHECK_W32API_VERSION( 0, 5 )
- #define DOCINFOW DOCINFO
- #define DOCINFOA DOCINFO
+
+ // Work around a bug in very old MinGW headers that didn't define DOCINFOW
+ // and DOCINFOA but only DOCINFO in both ANSI and Unicode.
+ #if defined( __GNUG__ )
+ #if !wxCHECK_W32API_VERSION( 0, 5 )
+ #define DOCINFOW DOCINFO
+ #define DOCINFOA DOCINFO
+ #endif
#endif
+
#ifdef _UNICODE
inline int StartDoc(HDC h, CONST DOCINFOW* info)
{
View
2  interface/wx/accel.h
@@ -108,7 +108,7 @@ class wxAcceleratorEntry
/**
Returns a textual representation of this accelerator.
- The returned string is of the form <code>[Alt+][Ctrl+][Shift+]Key</code>
+ The returned string is of the form <code>[Alt+][Ctrl+][RawCtrl+][Shift+]Key</code>
where the modifier keys are present only if the corresponding flag is
set.
*/
View
3  interface/wx/clipbrd.h
@@ -102,6 +102,9 @@ class wxClipboard : public wxObject
(possibly eating memory), otherwise the clipboard will be emptied on
exit.
+ Currently this method is not implemented in X11-based ports, i.e.
+ wxGTK, wxX11 and wxMotif and always returns @false there.
+
@return @false if the operation is unsuccessful for any reason.
*/
virtual bool Flush();
View
13 interface/wx/menuitem.h
@@ -362,9 +362,16 @@ class wxMenuItem : public wxObject
Optionally you can specify also an accelerator string appending a tab character
<tt>\\t</tt> followed by a valid key combination (e.g. <tt>CTRL+V</tt>).
- Its general syntax is any combination of @c "CTRL", @c "ALT" and @c "SHIFT" strings
- (case doesn't matter) separated by either @c '-' or @c '+' characters and followed
- by the accelerator itself.
+ Its general syntax is any combination of @c "CTRL", @c "RAWCTRL", @c
+ "ALT" and @c "SHIFT" strings (case doesn't matter) separated by either
+ @c '-' or @c '+' characters and followed by the accelerator itself.
+ Notice that @c CTRL corresponds to the "Ctrl" key on most platforms but
+ not under Mac OS where it is mapped to "Cmd" key on Mac keyboard.
+ Usually this is exactly what you want in portable code but if you
+ really need to use the (rarely used for this purpose) "Ctrl" key even
+ under Mac, you may use @c RAWCTRL to prevent this mapping. Under the
+ other platforms @c RAWCTRL is the same as plain @c CTRL.
+
The accelerator may be any alphanumeric character, any function key
(from F1 to F12) or one of the special characters listed in the table
below (again, case doesn't matter):
View
2  src/common/appbase.cpp
@@ -1190,7 +1190,7 @@ bool DoShowAssertDialog(const wxString& msg)
wxT("You can also choose [Cancel] to suppress ")
wxT("further warnings.");
- switch ( ::MessageBox(NULL, msgDlg.wx_str(), wxT("wxWidgets Debug Alert"),
+ switch ( ::MessageBox(NULL, msgDlg.t_str(), wxT("wxWidgets Debug Alert"),
MB_YESNOCANCEL | MB_ICONSTOP ) )
{
case IDYES:
View
2  src/common/string.cpp
@@ -1436,7 +1436,7 @@ size_t wxString::Replace(const wxString& strOld,
}
else if ( !bReplaceAll)
{
- size_t pos = m_impl.find(strOld, 0);
+ size_t pos = m_impl.find(strOld.m_impl, 0);
if ( pos != npos )
{
m_impl.replace(pos, strOld.m_impl.length(), strNew.m_impl);
View
4 src/common/strvararg.cpp
@@ -435,6 +435,8 @@ class wxPrintfFormatConverterWchar : public wxFormatConverterBase<wchar_t>
};
#endif // !wxUSE_UTF8_LOCALE_ONLY
+#endif // __WINDOWS__/!__WINDOWS__
+
#if wxUSE_UNICODE_UTF8
class wxPrintfFormatConverterUtf8 : public wxFormatConverterBase<char>
{
@@ -458,8 +460,6 @@ class wxPrintfFormatConverterUtf8 : public wxFormatConverterBase<char>
};
#endif // wxUSE_UNICODE_UTF8
-#endif // __WINDOWS__/!__WINDOWS__
-
#if !wxUSE_UNICODE // FIXME-UTF8: remove
class wxPrintfFormatConverterANSI : public wxFormatConverterBase<char>
{
View
2  src/msw/crashrpt.cpp
@@ -247,7 +247,7 @@ bool wxCrashReportImpl::Generate(int flags, EXCEPTION_POINTERS *ep)
/* static */
void wxCrashReport::SetFileName(const wxString& filename)
{
- wxStrlcpy(gs_reportFilename, filename.wx_str(), WXSIZEOF(gs_reportFilename));
+ wxStrlcpy(gs_reportFilename, filename.t_str(), WXSIZEOF(gs_reportFilename));
}
/* static */
View
2  src/msw/dde.cpp
@@ -1068,7 +1068,7 @@ static HSZ DDEAtomFromString(const wxString& s)
{
wxASSERT_MSG( DDEIdInst, wxT("DDE not initialized") );
- HSZ hsz = DdeCreateStringHandle(DDEIdInst, (wxChar*)s.wx_str(), DDE_CP);
+ HSZ hsz = DdeCreateStringHandle(DDEIdInst, const_cast<wxChar*>(static_cast<const wxChar*>(s.t_str())), DDE_CP);
if ( !hsz )
{
DDELogError(_("Failed to create DDE string"));
View
2  src/msw/debughlp.cpp
@@ -146,7 +146,7 @@ const wxString& wxDbgHelpDLL::GetErrorMessage()
void wxDbgHelpDLL::LogError(const wxChar *func)
{
::OutputDebugString(wxString::Format(wxT("dbghelp: %s() failed: %s\r\n"),
- func, wxSysErrorMsg(::GetLastError())).wx_str());
+ func, wxSysErrorMsg(::GetLastError())).t_str());
}
// ----------------------------------------------------------------------------
View
2  src/msw/registry.cpp
@@ -1057,7 +1057,7 @@ bool wxRegKey::SetValue(const wxString& szValue, const wxString& strValue)
m_dwLastError = RegSetValueEx((HKEY) m_hKey,
RegValueStr(szValue),
(DWORD) RESERVED, REG_SZ,
- (RegString)strValue.t_str(),
+ (RegString)static_cast<const TCHAR *>(strValue.t_str()),
(strValue.Len() + 1)*sizeof(wxChar));
if ( m_dwLastError == ERROR_SUCCESS )
return true;
View
4 src/msw/utils.cpp
@@ -1115,8 +1115,8 @@ wxLoadUserResource(const void **outData,
wxCHECK_MSG( outData && outLen, false, "output pointers can't be NULL" );
HRSRC hResource = ::FindResource(instance,
- resourceName.wx_str(),
- resourceType.wx_str());
+ resourceName.t_str(),
+ resourceType.t_str());
if ( !hResource )
return false;
View
14 src/msw/utilsexc.cpp
@@ -857,14 +857,14 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
// WinCE requires appname to be non null
// Win32 allows for null
#ifdef __WXWINCE__
- (wxChar *)
- moduleName.wx_str(),// application name
- (wxChar *)
- arguments.wx_str(), // arguments
+ static_cast<const TCHAR *>(
+ moduleName.t_str()),// application name
+ const_cast<TCHAR *>(static_cast<const TCHAR *>(
+ arguments.t_str())), // arguments
#else
NULL, // application name (use only cmd line)
- (wxChar *)
- command.wx_str(), // full command line
+ const_cast<TCHAR *>(static_cast<const TCHAR *>(
+ command.t_str())), // full command line
#endif
NULL, // security attributes: defaults for both
NULL, // the process and its main thread
@@ -872,7 +872,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
dwFlags, // process creation flags
envBuffer.data(), // environment (may be NULL which is fine)
useCwd // initial working directory
- ? const_cast<wxChar *>(env->cwd.wx_str())
+ ? const_cast<TCHAR *>(static_cast<const TCHAR *>(env->cwd.t_str()))
: NULL, // (or use the same)
&si, // startup info (unused here)
&pi // process info
View
4 src/msw/volume.cpp
@@ -288,7 +288,7 @@ static void BuildListFromNN(wxArrayString& list, NETRESOURCE* pResSrc,
// The filter function will not know mounted from unmounted, and neither do we unless
// we are iterating using RESOURCE_CONNECTED, in which case they all are mounted.
// Volumes on disconnected servers, however, will correctly show as unmounted.
- FilteredAdd(list, filename.wx_str(), flagsSet, flagsUnset&~wxFS_VOL_MOUNTED);
+ FilteredAdd(list, filename.t_str(), flagsSet, flagsUnset&~wxFS_VOL_MOUNTED);
if (scope == RESOURCE_GLOBALNET)
s_fileInfo[filename].m_flags &= ~wxFS_VOL_MOUNTED;
}
@@ -502,7 +502,7 @@ bool wxFSVolumeBase::Create(const wxString& name)
// Display name.
SHFILEINFO fi;
- long rc = SHGetFileInfo(m_volName.wx_str(), 0, &fi, sizeof(fi), SHGFI_DISPLAYNAME);
+ long rc = SHGetFileInfo(m_volName.t_str(), 0, &fi, sizeof(fi), SHGFI_DISPLAYNAME);
if (!rc)
{
wxLogError(_("Cannot read typename from '%s'!"), m_volName.c_str());
View
6 src/osx/cocoa/filedlg.mm
@@ -70,10 +70,8 @@ bool HasAppKit_10_6()
// case above.
version = NSVersionOfRunTimeLibrary("AppKit");
}
- if (version == -1)
- {
- return false;
- }
+
+ // Notice that this still works correctly even if version is -1.
return version >= 0x40e2400 /* version of 10.6 AppKit */;
}
View
22 src/stc/gen_iface.py
@@ -88,8 +88,8 @@
'void %s(const wxString& text);',
'''void %s(const wxString& text) {
- wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
- SendMsg(%s, buf.length()-1, (sptr_t)(const char*)buf);''',
+ const wxWX2MBbuf buf = wx2stc(text);
+ SendMsg(%s, wx2stclen(text, buf), (sptr_t)(const char*)buf);''',
0),
'AddStyledText' : (0,
@@ -103,8 +103,8 @@
'void %s(const wxString& text);',
'''void %s(const wxString& text) {
- wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
- SendMsg(%s, buf.length()-1, (sptr_t)(const char*)buf);''',
+ const wxWX2MBbuf buf = wx2stc(text);
+ SendMsg(%s, wx2stclen(text, buf), (sptr_t)(const char*)buf);''',
0),
'GetViewWS' : ( 'GetViewWhiteSpace', 0, 0, 0),
@@ -439,7 +439,7 @@
TextToFind ft;
ft.chrg.cpMin = minPos;
ft.chrg.cpMax = maxPos;
- wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
+ const wxWX2MBbuf buf = wx2stc(text);
ft.lpstrText = (char*)(const char*)buf;
return SendMsg(%s, flags, (sptr_t)&ft);''',
@@ -596,8 +596,8 @@
'''
int %s(const wxString& text) {
- wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
- return SendMsg(%s, buf.length()-1, (sptr_t)(const char*)buf);''',
+ const wxWX2MBbuf buf = wx2stc(text);
+ return SendMsg(%s, wx2stclen(text, buf), (sptr_t)(const char*)buf);''',
0),
'ReplaceTargetRE' :
@@ -606,8 +606,8 @@
'''
int %s(const wxString& text) {
- wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
- return SendMsg(%s, buf.length()-1, (sptr_t)(const char*)buf);''',
+ const wxWX2MBbuf buf = wx2stc(text);
+ return SendMsg(%s, wx2stclen(text, buf), (sptr_t)(const char*)buf);''',
0),
'SearchInTarget' :
@@ -616,8 +616,8 @@
'''
int %s(const wxString& text) {
- wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
- return SendMsg(%s, buf.length()-1, (sptr_t)(const char*)buf);''',
+ const wxWX2MBbuf buf = wx2stc(text);
+ return SendMsg(%s, wx2stclen(text, buf), (sptr_t)(const char*)buf);''',
0),
# not sure what to do about these yet
View
12 src/stc/stc.cpp
@@ -4128,16 +4128,10 @@ wxCharBuffer wxStyledTextCtrl::GetLineRaw(int line)
wxCharBuffer wxStyledTextCtrl::GetSelectedTextRaw()
{
- long start;
- long end;
-
- GetSelection(&start, &end);
- int len = end - start;
- if (!len) {
- wxCharBuffer empty;
- return empty;
- }
+ // Calculate the length needed first.
+ const int len = SendMsg(SCI_GETSELTEXT, 0, (sptr_t)0);
+ // And then really get the data.
wxCharBuffer buf(len);
SendMsg(SCI_GETSELTEXT, 0, (sptr_t)buf.data());
return buf;
View
12 src/stc/stc.cpp.in
@@ -628,16 +628,10 @@ wxCharBuffer wxStyledTextCtrl::GetLineRaw(int line)
wxCharBuffer wxStyledTextCtrl::GetSelectedTextRaw()
{
- long start;
- long end;
-
- GetSelection(&start, &end);
- int len = end - start;
- if (!len) {
- wxCharBuffer empty;
- return empty;
- }
+ // Calculate the length needed first.
+ const int len = SendMsg(SCI_GETSELTEXT, 0, (sptr_t)0);
+ // And then really get the data.
wxCharBuffer buf(len);
SendMsg(SCI_GETSELTEXT, 0, (sptr_t)buf.data());
return buf;

No commit comments for this range

Something went wrong with that request. Please try again.