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.
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.
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.
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).
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.