Commit Graph

58711 Commits

Author SHA1 Message Date
Vadim Zeitlin
adf521dea2 Handle GTK_POLICY_EXTERNAL new in GTK+ 3.16 too.
Apparently this still doesn't display any scrollbars in the window itself, so
from our point of view it is equivalent to GTK_POLICY_NEVER.

(cherry picked from commit 2509e7927a)
2015-08-04 20:05:04 -07:00
Paul Cornett
d6403135e3 reset clipping region in DestroyClippingRegion(), see #17086 2015-07-30 09:58:01 -07:00
Vadim Zeitlin
82db53ca1a Expat compilation fix for pre-C99 compilers.
Don't mix statements and declarations, this is not allowed in C89.

Fixes compilation with MSVC <= 10 after 74da7cba07

See #17083.

(this is a backport of 9b029ea88a from master)
2015-07-30 00:59:17 +02:00
Paul Cornett
35acf46cc4 use delete for memory allocated with new 2015-07-27 10:32:50 -07:00
Vadim Zeitlin
74da7cba07 Fix arithmetic overflow in the bundled Expat library.
This is a modified version of the patch from Mozilla (see
https://hg.mozilla.org/releases/mozilla-esr31/rev/2f3e78643f5c) which was also
applied to Chromium. This version prefers to use the buffer of the correct
size instead of just returning an out-of-memory error if the size needed is
relatively (but not extraordinarily so, e.g. just slightly more than 64KB in
32 bit builds) big.
2015-07-27 00:45:26 +02:00
Paul Cornett
8d2772eaf2 avoid shadowed variable warnings with VS2015 2015-07-24 20:55:10 -07:00
Vadim Zeitlin
21dc1a1d4f Blind fix for wxTextDataObject trailing NUL under OS X.
Use the length provided to SetData() instead of assuming it is NUL-terminated.

Closes #9522.

(this is a backport of 20c130a578 from master)
2015-07-17 14:35:26 +02:00
Paul Cornett
312ae4c92c Fix wxSpinButton best size for GTK+ 3.12 and later, see #17051 2015-07-16 07:13:27 -07:00
Vadim Zeitlin
e315ef02c8 Remove wxOVERRIDE not available in 3.0 branch.
Fixes compilation after backporting wxHTTP-in-worker-thread fixes from master.

See #17031.
2015-07-10 13:46:58 +02:00
Vadim Zeitlin
6e5b6521a5 Update HDC in wxDC::SetLogicalScale() in wxMSW.
Unlike the similar (identical?) SetUserScale(), this function didn't call
RealizeScaleAndOrigin(), add it now for consistency.

(this is a backport of 75794137f605328e2d3e6a45106f30b8ac268cbb from master)

See #17053.
2015-07-09 21:01:30 +02:00
Vadim Zeitlin
e62173c479 Fix using wxHTTP and wxFTP from worker thread in Unix ports.
This backports e18c8fd29a,
d421373c2e and
6c43aa90b6 from master to avoid crashes when
using wxHTTP or wxFTP from threads other than main.

See #17031.
2015-07-09 20:59:38 +02:00
Vadim Zeitlin
b08ca17749 Fix MinGW build with wxUSE_LOG==0.
Don't apply Watcom workaround for empty vararg log functions to MinGW, it
doesn't seem to need it and using it actually breaks compilation of the code
in wxWidgets itself when wxLogSysError() is used with wxString argument.

Closes #17048.
2015-07-07 00:00:49 +02:00
Leland Lucius
0797a6f875 Fix accessibility support in wxMSW.
Return the correct result from handing WM_GETOBJECT message.

Closes #17058.

(this is a backport of 6a435345f5 from master)
2015-07-06 23:56:48 +02:00
Paul Cornett
4db8d55913 Avoid using gdk_window_freeze_updates() to implement Freeze()
Implement Freeze() by blocking the GtkWindow "expose-event"/"draw" signal
instead. Since the introduction of client-side windows in GTK+ 2.18,
gdk_window_freeze_updates() is unuseable because the impl_window (and thus the
update_freeze_count) for a given GdkWindow can change unpredictably. See #16795
2015-06-24 08:42:49 -07:00
Vadim Zeitlin
918d46e2cc Add a check for wxSocketServer creation to the unit tests.
This should prevent an assert failure which happens if we call Accept() on an
invalid server below and also confirm if the server creation really failed or
not.
2015-06-24 01:24:47 +02:00
Vadim Zeitlin
53745b5cce Brazilian Portuguese translations update from Philippe. 2015-06-23 18:11:24 +02:00
Vadim Zeitlin
432ff59772 Make wxVSCROLL explicitly of int type.
Its value (0x80000000) is outside of the int type range on 32 bit platforms,
but we still want to allow using it as an initializer of int and/or long
variables for consistency with the other types, so cast it to int explicitly
to suppress -Wnarrowing warnings from recent g++ which were given when doing
this before.
2015-06-21 16:00:57 +02:00
Vadim Zeitlin
01f62c0295 Avoid warnings about narrowing casts in the long long tests.
Recent g++ versions give -Wnarrowing warning when a value outside of the type
range is used to initialize a variable of this type in { }. Avoid it in the
long long tests using explicit casts as we already cast between long long and
unsigned long long values here anyhow.
2015-06-21 16:00:55 +02:00
Vadim Zeitlin
ec434c918a Avoid g++ 4.8.2 bug that resulted in infinite loops in the test suite.
g++ 4.8.2, shipped with Ubuntu 14.04, generates incorrect code for checking
the loop termination condition, resulting in never ending loops in
HashMapTest().

Disable the optimizations for this function for 4.8.[012] as the bug seems to
be fixed in 4.8.4 and several similar (but not really identical) bug reports
in gcc bugzilla have been fixed in 4.8.3.

This should allow the unit tests on Linux buildbots, using 4.8.2, to run to
completion again.
2015-06-21 02:44:56 +02:00
Vadim Zeitlin
ce80118b9e Fix reading beyond end of buffer in UTF-16 decoding code.
Verify that incrementing the input pointer doesn't take us outside the buffer.
Still accept a single trailing NUL as the string terminator.
2015-06-21 02:44:37 +02:00
Vadim Zeitlin
0e0809b5f5 Avoid reading one char beyond the buffer end in UnicodeTestCase.
Valgrind complains about reading beyond the end of buffer when using glibc
std::string for wxString implementation under amd64 Linux. Don't suppose that
the buffer has one extra null word at its end to avoid this.
2015-06-21 02:44:33 +02:00
Vadim Zeitlin
8b4dbf8ebf Fix mismatched new[]/delete in a test case.
Use wxDELETEA() as the comment said we did -- except that we didn't.
2015-06-19 19:59:51 +02:00
Vadim Zeitlin
77fb8cb8c1 Fix TDM-GCC warning about int to pointer cast.
Use wxUIntToPtr() to suppress the warning, we know that the cast here is safe
because Windows uses only pointers fitting in the UINT range for the menu (and
other) handles.
2015-06-14 20:37:33 +02:00
Vadim Zeitlin
2ea1d3fc19 Correctly deinitialize wxUxThemeEngine in wxMSW.
Set ms_isThemeEngineAvailable to -1, meaning that we need to reinitialize
themes, instead of false, meaning that themes are not available.

This fixes problems when the library is initialized, shut down and then
initialized again.

Closes #17023.
2015-06-14 19:38:17 +02:00
Vadim Zeitlin
90a523da71 Add better error checking and simplify wxWebViewIE::DoSetPage().
Don't ignore errors (this resulted in warnings in optimized builds because
variable "hr" containing the error code to was assigned but never used) and
don't leak memory in the (admittedly unlikely) case an error really occurs.

Also don't duplicate the code for creating a one element SAFEARRAY<VARIANT>,
extract it into a helper function.
2015-06-14 19:24:13 +02:00
Vadim Zeitlin
49fb8c25f5 Check that __cplusplus is defined before checking its value.
Avoids harmless in this case warning about __cplusplus being undefined in
comparison.
2015-06-14 15:55:08 +02:00
Vadim Zeitlin
5ac3c9ac7a Provide empty wxDECL_FOR_STRICT_MINGW32() in non-MinGW case.
Fix the build after aa30a2f97a which forgot to
define wxDECL_FOR_STRICT_MINGW32() macro when MinGW was not used at all.
2015-06-14 15:45:27 +02:00
Vadim Zeitlin
0c14584842 Fix harmless signed/unsigned comparison warning in wxMSW wxTreeCtrl.
Don't cast NMHDR::code field to int, this cast was added in the previous
millennium, probably to work around the wrong definition of NM_DBLCLK in some
ancient MinGW headers, but nowadays all MinGW distributions (tested with
MinGW 4.8.1, MinGW-64 4.9.1 and TDM-GCC 4.9.2) define it correctly and so
using this cast results in a warning -- just remove it to get rid of it.
2015-06-14 15:12:19 +02:00
Vadim Zeitlin
1db615c190 Work around a bug in MinGW math.h.
Including standard math.h header with both -O2 and -std=c++NN options results
in compilation error due to a bug in the header, see MinGW bug report at
https://sourceforge.net/p/mingw/bugs/2250/

Work around this to allow the library to compile in release build with
-std=c++11. This is ugly but better than failing to compile at all.
2015-06-14 15:06:19 +02:00
Vadim Zeitlin
aa30a2f97a Fix building and using the library with MinGW -std=c++{98,11} options.
These options enable "strict ANSI" mode in MinGW which omits declarations of
POSIX functions from the standard headers. To allow the library and, possibly
even more importantly, the user code including our headers, to compile with
these options, declare the functions that we need ourselves.

This might appear to go against the spirit of "strict ANSI" mode, but the only
alternative would be to not use such functions at all and silently cripple the
library when -std=c++NN is used, compared to -std=g++NN case, and this doesn't
seem appealing neither.

Closes #16984.
2015-06-14 15:06:19 +02:00
Vadim Zeitlin
e2410de134 Suppress warnings about missing field initializers for wxKeyNames.
This warning is harmless but annoying, especially because it's given a couple
of dozens times in this file, so just suppress it.
2015-06-14 15:06:18 +02:00
Vadim Zeitlin
2632977f6b Don't attempt using <type_traits> with g++ 4.9.2 in C++98 mode.
g++ 4.9.2 added support of __has_include() but, unlike clang, refuses to
compile the <type_traits> header that is detected as existing now in C++98
mode, so the build was broken with it when not using configure (i.e. under
MSW).

Fix this by, first, testing for C++11 compilers separately (which seems like a
good idea anyhow as it will allow using these headers with other compilers)
and, second, not trusting g++ __has_include() for C++11 headers in C++98 mode.
2015-06-14 15:06:18 +02:00
Vadim Zeitlin
0e3867c967 Remove default argument value from wxIHTMLElement2::setExpression().
This doesn't make much sense for an interface declaration anyhow and produces
a warning from g++ about assigning string literal to (non-const) BSTR pointer.

(this is a backport of eb18bbc8fd from master)
2015-06-14 15:06:17 +02:00
Vadim Zeitlin
70da6f7488 Make wxTextCtrlOleCallback destructor virtual to avoid g++ warnings.
This class doesn't really need a virtual dtor as it's never used
polymorphically, but add it to avoid g++ warnings about it.

(this is a backport of 8ad1e2698f from master)
2015-06-14 15:06:17 +02:00
Vadim Zeitlin
1e2af26e47 Recognize MSVC 14 a.k.a. Visual Studio 2015 compiler.
Interpret internal compiler version value 1900 as VC14. Notice that this
required adjusting the computation of the internal version from the
user-visible one because VC13 was skipped (hopefully no black cats crossed
paths with the manager responsible for this decision).

See #16854.

(this is a backport of f350bab from master)
2015-06-13 18:34:54 +04:00
Vadim Zeitlin
c06c8edb5a Don't redefine snprintf() for MSVC 14 in libtiff.
This MSVC version does add snprintf(), finally, and doesn't allow
pre-#defining it before including its stdio.h, so don't do this.

See #16854.

(this is a backport of 0a41db1 from master)
2015-06-13 18:32:08 +04:00
Vaclav Slavik
fd08f641ae Call SetThreadUILanguage() on Windows
Starting with Vista, SetThreadLocale() does basically nothing and does
not affect UI language. We need to call SetThreadUILanguage() as well
from wxLocale::Init() to have the locale reflected in e.g. standard
dialogs.
2015-06-10 18:32:49 +02:00
Vadim Zeitlin
264f01824b Don't end converting prematurely on encountering consecutive NULs.
Don't stop converting subsequent chunks just because the length of one of them
was 0: this can happen if the first character of a string is a NUL or if there
are two (or more) NULs in it later.

Simply remove the check for this and continue as usual even in this case.

Also add a unit test verifying that we do translate NULs in input into NULs in
output.

Closes #16620.

(this is a backport of f99ff49 from master)
2015-06-08 14:06:23 +04:00
Stefan Csomor
b67dea6fc0 In order to get all focus set events, store field in editor and catch
becomeFirstResponder there

See #14269.

(this is a backport of cea11b5 from master)
2015-06-08 02:44:11 +04:00
Stefan Csomor
6a961dd2d9 Allowing reentrancy on NSPanels makeResponder as in NSWindow
See #14269.

(this is a backport of 3ba1c7e from master)
2015-06-08 02:44:11 +04:00
Stefan Csomor
7dc6d1876e Refactoring to common code for updating selections, using common focus
code

See #14269.

(this is a backport of e65104f from master)
2015-06-08 02:44:11 +04:00
Stefan Csomor
6749ca7405 Refactoring to common code for focus set and lost events, so that
changes can be made a single place

See #14269.

(this is a backport of 2b99f92 from master)
2015-06-08 02:44:11 +04:00
Stefan Csomor
8d2956100f Using the base class wxHAS_NATIVE_ENABLED_MANAGEMENT in Cocoa
disabling/enabling child windows

Fixes #16232, fixes #15495.

(this is a backport of 91f25e0 from master)
2015-06-08 02:44:11 +04:00
Dimitri Schoolwerth
97eb03c9a7 Re-enable symbols visibility support for the Clang compiler
Visibility support for Clang was disabled in 7198c33 because of linking
errors when building shared libraries, related to non-inline methods in
exported template classes.

The last Clang version to have these problems is version "4.1
(tags/Apple/clang-421.11.66)" as part of Xcode 4.5.2, and the next
release fixes them (version "4.2 (clang-425.0.24)", Xcode 4.6). Check
for the Clang version and only disable visibility support when compiling
with Apple Clang < 4.2.

Note that Apple Clang 4.2 is based on official Clang 3.2 so also check
for that version in case of non-Apple builds. The only official Clang
that has been tested successfully is 3.4 which worked fine with
visibility. Other versions that were tried (3.1 and 3.2) segfault while
compiling wx.

(this is a backport of 7cacde3 from master)
2015-06-08 02:36:52 +04:00
Vadim Zeitlin
2923d95264 Fix flickering when resizing a frame with status bar in wxMSW.
The flicker was only visible under Windows XP or when using a class theme
and was due to mis-positioning the status bar initially in PositionStatusBar().
Fix this by adjusting its position by the toolbar offset before calling its
SetSize().

Closes #16705.

(this is a backport of 8d12e07453 from master)
2015-06-01 00:15:48 +02:00
Dimitri Schoolwerth
9a922899de Fix unused variable warning in wxRichText
Don't define variable 'bottom' which is initialised but not
referenced any longer (since ab4b767).
2015-05-31 04:53:59 +04:00
Vadim Zeitlin
4b073ab140 Fix recently added wxFileName::MakeRelativeTo() unit test for non-Unix.
Don't hard code the use of slashes as path separators.

(cherry picked from commit ef30f6fe63)
2015-05-31 03:51:06 +04:00
Vadim Zeitlin
0eb1658ca7 wxOSX: don't call strlen() on possibly null pointer.
Use wxCharBuffer::length() instead, this is more efficient and safer as it
correctly returns 0 in case the conversion fails.

Closes #9967.
2015-05-29 16:37:05 +02:00
Vadim Zeitlin
b3b8d8c4a8 Compilation fix after stray wxFALLTHROUGH in the last commit.
Remove wxFALLTHROUGH backported from trunk but which doesn't exist in 3.0.

See #17010.
2015-05-29 16:32:14 +02:00
Vadim Zeitlin
de891ddb03 Fix wxFileName::MakeRelativeTo() for directory relatively to itself.
The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.

Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.

Also add a unit test verifying that this works as expected.

Closes #17010.
2015-05-29 16:25:45 +02:00