Commit Graph

63279 Commits

Author SHA1 Message Date
Vadim Zeitlin
f3b5cc32fa Fix recently introduced crash in ClippingBoxTestCase
Commit fc7f20c419 did fix a memory leak in
this test case, but at the price of introducing a crash due to deleting
the same pointer twice.

The real fix would be to change the code here to avoid returning a
pointer which sometimes needs to be deleted and sometimes must not, but
for now just add a crude check to avoid crashing.
2017-11-14 00:41:31 +01:00
Vadim Zeitlin
ad448da284 Suppress deprecation warnings for g_option_group_free()
Closes #17877.
2017-11-14 00:41:31 +01:00
Vadim Zeitlin
99367a1530 Update glib version check in GetStandardCmdLineOptions()
This code still works fine with glib 2.50.
2017-11-14 00:41:31 +01:00
Vadim Zeitlin
d3b033f432 Allow webview sample to build without wxSTC
There doesn't seem to be any special reason to use wxStyledTextControl
in this sample and doing it unconditionally breaks the build with
--disable-stc, so use wxTextCtrl instead in this case.

Closes #17998.
2017-11-14 00:09:08 +01:00
Vadim Zeitlin
f3995658ff Increase timeout for WindowTestCase::FocusEvent()
The default 100ms doesn't seem to be enough when this test runs under
buildbot.
2017-11-14 00:06:21 +01:00
Vadim Zeitlin
11a5728b32 Replace remaining std::auto_ptr<> with wxScopedPtr in the tests
This should have been done in b8c9cd3528
to avoid all warnings about std::auto_ptr<> being deprecated when using
g++ 6 or later which compiles in C++14 mode by default.
2017-11-14 00:06:18 +01:00
Vadim Zeitlin
91697a8724 Use correct commit of src/png submodule
Fixes wrong commit accidentally used in the previous commit.
2017-11-13 22:25:59 +01:00
Vadim Zeitlin
760bd1bf4e Update png submodule to avoid -Wundef warnings 2017-11-13 22:16:10 +01:00
Vadim Zeitlin
f65a608993 Remove declared but not implemented wxFont::Unshare() in wxGTK
No real changes, just remove a method which was never defined nor used.
2017-11-13 22:16:10 +01:00
Václav Slavík
926d486f54 Fix NSFont bridging crash with Asian input methods on 10.11
There's a bug in OS X 10.11 where a toll-free bridged font may have an
attributed of private class __NSCFCharacterSet that unlike
NSCharacterSet doesn't conform to NSSecureCoding. This poses a problem
when such font is used in user-editable content, because some Asian
input methods then crash in 10.11 when editing the string. As a
workaround for this bug, don't use toll-free bridging, but re-create
NSFont from the descriptor instead on buggy OS X versions.

Fixes regression introduced in a77066d530
(#507).
2017-11-13 18:46:37 +02:00
Vadim Zeitlin
af16d8ba5c Explicitly set "update = checkout" option for submodules
It seems that older Git versions don't update submodules when issuing
just "git submodule update" if this option is not set.

We might actually prefer to use "update = rebase" but for now use the
smallest change that will (hopefully) allow people using older Git
versions to get the submodule updates.
2017-11-13 15:24:37 +01:00
Vadim Zeitlin
818a710af6 Update bundled libtiff to not use wxjpeg_boolean any more
This is not needed after e35f01384f.
2017-11-12 23:23:48 +01:00
Artur Wieczorek
4df04a88c5 Set wxPG cell background colour as wxPGComboBox background colour
Default wxGenericComboCtrl background colour is obtained under wxGTK
with wxComboBox::GetClassDefaultAttributes(). For wxGTK 3 returned colour
is fully transparent (00000000) which can cause problems with
proper drawing of controls deriving from wxGenericComboCtrl, like
wxPGComboBox which in turn is used by wxEnumProperty, wxCursorProperty,
etc.
wxPGComboBox should have background with the same colour as the cell
so we can explicitly set background colour to avoid using default one.

Closes #17986.
2017-11-12 22:09:09 +01:00
Paul Cornett
7592595252 fix SetPosition() parameter in documentation 2017-11-12 09:36:33 -08:00
Paul Cornett
142004884f Build fixes for wxUSE_UNICODE==0 2017-11-12 09:35:12 -08:00
Paul Cornett
cdb9436975 Use wxFALLTHROUGH 2017-11-12 09:34:22 -08:00
Paul Cornett
65cc4c1624 Avoid ifdef-ed override specification
Instead, add the base class functions so the derived class always
overrides. If/when wxX11 and wxMotif are removed there won't be an
ifdef that no one ever notices isn't needed anymore.
2017-11-12 09:33:37 -08:00
Vadim Zeitlin
4e226d6784 Merge branch 'extra-warn-fixes'
Fix a few harmless warnings given with -Wextra.
2017-11-12 17:48:16 +01:00
Vadim Zeitlin
4e593b9f06 Document switch to submodules for 3rd party libraries
Update the build instructions and the change log.
2017-11-12 17:47:09 +01:00
Vadim Zeitlin
e35f01384f Merge branch 'jpeg-submodule'
Switch to using submodule and update the library version.
2017-11-12 17:43:22 +01:00
Vadim Zeitlin
fc9d41fad3 Avoid -Wmissing-field-initializers for Dl_info struct
Rely on the default initialization, this is arguably slightly less
clear, but allows to avoid the warning (which is disabled by default,
but still).

Closes #17997.
2017-11-12 17:07:35 +01:00
Scott Furry
b39d29f433 Fix harmless -Wmissing-field-initializers in wxGTK
Closes #17996.
2017-11-12 17:05:55 +01:00
Scott Furry
3653b753d3 Fix clang -Winconsistent-missing-override in wxGLApp
Use "override" for wxGLApp::GetXVisualInfo(), but only for wxGTK2 where
it really overrides it, unlike in wxX11.

Closes #17995.
2017-11-12 17:02:43 +01:00
Vadim Zeitlin
a03441f959 Suppress harmless -Wmissing-fields-initialize in wxSecretStore
This warning is difficult to avoid as we don't want to initialize the
unused/reserved fields of SecretSchema struct, yet the compiler warns
about it (when using -Wextra).
2017-11-12 16:57:40 +01:00
Vadim Zeitlin
cc8657e436 Upgrade libjpeg to the latest version 9b
There don't seem to be any really important changes affecting our use of
the library, but it seems better to use the 2016 version instead of the
1998 one and it also allows to get rid of many hacks that were needed
before as the things they worked around are now taken care of by the
library itself.
2017-11-12 16:32:35 +01:00
Vadim Zeitlin
0fe8d68c11 Replace jpeg subdirectory with a Git submodule
Use libjpeg-turbo repository as upstream, even if we don't use
libjpeg-turno library itself (yet?) because it also has all the historic
libjpeg versions in its repository, including 6b (dating from 1998!)
that our sources were based on.
2017-11-12 00:54:11 +01:00
Vadim Zeitlin
edf0db1eb3 Update libtiff to the latest 4.0.8 version 2017-11-11 23:39:00 +01:00
Vadim Zeitlin
03c81535ab Replace tiff subdirectory with a Git submodule
Try to preserve most of the manual changes done to libtiff sources in
wxWidgets, dropping just some VC6-specific workarounds which are not
needed any more.
2017-11-11 23:39:00 +01:00
Vadim Zeitlin
2cee986e03 Merge branch 'expat-submodule'
Switch to using submodule and update the library version.
2017-11-11 20:51:24 +01:00
Vadim Zeitlin
1a1cfc2d02 Upgrade Expat submodule to the latest 2.2.5 version
No special changes, just propagate submodules changes to the main
repository.
2017-11-11 20:50:51 +01:00
Vadim Zeitlin
b9af392704 Remove obsolete COMPILED_FROM_DSP from Expat project files
This symbol is not used any longer since 2.2.0, see the corresponding
entry in Expat change log file.
2017-11-11 20:50:51 +01:00
Vadim Zeitlin
824134d427 Replace Expat sources directory with a Git submodule
This will make it simpler to track upstream in the future.
2017-11-11 20:50:50 +01:00
Vadim Zeitlin
e1c54ff032 Update 3rd party libraries updating instructions
Explain how to do it now when Git submodules are used for them instead
of speaking about svn vendor branches.
2017-11-11 15:35:35 +01:00
Vadim Zeitlin
ddb28af028 Merge branch 'png-submodule'
Switch to using submodule and update the library version.
2017-11-11 15:32:41 +01:00
Vadim Zeitlin
c443b4c264 Don't use multi-character constants for portability reasons
Instead of using numeric constants for MinGW and character constants
otherwise, just always use the former as this code can also be compiled
with non-MinGW gcc when building under Cygwin and this results in the
same warnings as for MinGW.

Additionally, it's not guaranteed that other MSW compilers actually
support multi-character constants at all, even if they don't warn about
them, so just avoid them completely.
2017-11-11 15:30:22 +01:00
Vadim Zeitlin
617250bc11 Upgrade libpng to 1.6.34
Upgrade src/png submodule to the latest library version and slightly
update its upgrade instructions.
2017-11-11 14:13:30 +01:00
Vadim Zeitlin
a8e7d0ee12 Replace png sources directory with a Git submodule
This will make it simpler to track libpng upstream in the future.
2017-11-11 13:42:14 +01:00
Vadim Zeitlin
c98fa0ca98 Add wxWindowBase::SetDoubleBuffered() stub
This method was already provided by wxGTK and wxMSW, but not wxOSX nor
any other ports.

Provide a stub for it in wxWindowBase to allow user code to call it on
all platforms, there is no harm in that even if it doesn't (and can't)
do anything under macOS.
2017-11-11 11:47:56 +01:00
Paul Cornett
7a7f715160 Fix "chaining up" to parent class in key-press-event handler
Getting the parent class was done incorrectly in 819638a7, causing
the chain-up to go to the current class rather than the parent.
2017-11-10 22:54:58 -08:00
Vadim Zeitlin
147eb12f91 Replace zlib subdirectory with a Git submodule
This should make it much simpler to update to newer library versions in
the future.
2017-11-10 18:16:07 +01:00
Vadim Zeitlin
6022a51881 Merge branch 'expat-entropy-fix' 2017-11-10 18:15:36 +01:00
Vadim Zeitlin
e35aff4684 Checkout submodules in Appveyor builds
Unlike Travis CI, Appveyor doesn't do this automatically, but we will
need them soon (the currently existing Catch submodule is not used by
Appveyor builds but, arguably, should be too).
2017-11-10 17:44:03 +01:00
Vadim Zeitlin
fc8b7e4e61 Build bundled 3rd party libraries on Travis
Configure Travis CI to run at least one build using the bundled versions
of third party libraries to make sure this is tested too.
2017-11-10 17:43:01 +01:00
Vadim Zeitlin
99be9a25f2 Compile expat even without entropy source when using configure
There is no other choice but to continue without a high quality entropy
source if it's just not available on the current system as determined by
configure.

This problem was fixed in Expat fd9581a34e5665958939e3db408893fd4fac7398
which is not yet included in our version, and the (hopefully soon to be
implemented) real solution is to just upgrade Expat version, but for now
at least allow building without any extra hacks such as putting
XML_POOR_ENTROPY in CPPFLAGS.
2017-11-10 17:39:38 +01:00
Vadim Zeitlin
66c644fe20 Merge branch 'text-stream-nuls'
Fixes for wxTextInputStream and wxMBConvUTF{7,16} classes bug fixes.
2017-11-10 03:14:01 +01:00
Kevin Ollivier
0ad45d3e0e Fix generic wxTimePickerCtrl to accept max values from keyboard
Allow entering times such as 23:59:59 which were previously mistakenly
flagged as invalid due to off by one error in the comparison in the
validation function.
2017-11-10 00:02:49 +01:00
Vadim Zeitlin
4502e7563b Fix wxTextInputStream for input starting with BOM-like bytes
Contrary to what a comment in wxTextInputStream::GetChar() said, it is
actually possible to get more than one wide character from a call to
wxMBConv::ToWChar(len+1) even if a previous call to ToWChar(len) failed
to decode anything at all. This happens with wxConvAuto because it keeps
returning an error while it doesn't have enough data to determine if the
input contains a BOM or not, but then returns all the characters
examined so far at once if it turns out that there was no BOM, after
all.

The simplest case in which this created problems was just input starting
with a NUL byte as it as this could be a start of UTF-32BE BOM.

The fix consists in keeping all the bytes read but not yet decoded in
the m_lastBytes buffer and retrying to decode them during the next
GetChar() call. This implies keeping track of how much valid data is
there in m_lastBytes exactly, as we can't discard the already decoded
data immediately, but need to keep it in the buffer too, in order to
allow implementing UngetLast(). Incidentally, UngetLast() was totally
broken for UTF-16/32 input (containing NUL bytes in the middle of the
characters) before and this change fixes this as a side effect.

Also add test cases for previously failing inputs.
2017-11-09 23:49:59 +01:00
Vadim Zeitlin
46ea3cb8c0 Refactor: merge decode_utf16() into wxDecodeSurrogate()
No real changes, but just get rid of two functions doing the same thing
but using (semantically) different API, this was just too confusing.

Change all the code to use wxDecodeSurrogate() that encapsulates
decoding the surrogate and advancing the input pointer as needed and so
is less error-prone.

More generally, change the code to use end pointers instead of
decrementing the length to check for the end condition: this is more
clear, simpler and probably even more efficient.
2017-11-09 23:49:53 +01:00
Vadim Zeitlin
d82e3d4429 Never read uninitialized memory when decoding UTF-16 again
Pass length value to decode_utf16() and end pointer to
wxDecodeSurrogate() to ensure that we never read beyond the end of the
buffer when decoding UTF-16 when the last (complete) 16 bit value in the
buffer is the first half of a surrogate.

This had been previously partially addressed by ad hoc changes, e.g.
f72aa7b1c9 did it for wxMBConvUTF16swap,
but the problem still remained for wxMBConvUTF16straight. Ensure that
this bug is fixed everywhere now but making it impossible to even try
decoding a surrogate without providing the buffer length.
2017-11-09 23:48:20 +01:00
Vadim Zeitlin
2ee199acac Change decode_utf16() to take wxChar16 instead of wxUint16
Under Unix systems, this is the same thing, but under MSW, where
sizeof(wchar_t) == 2, this allows to pass wchar_t pointers to this
function without casts.

It also makes it consistent with wxDecodeSurrogate() and allows to get
rid of another ugly cast there.

No real changes.
2017-11-09 23:47:22 +01:00