This reverts commit 7ec39330d2 because
enabling verbose ASAN output results in too much output for Travis to
handle (and, to be fair, for it to be useful).
In order to be able to use monochrome bitmaps as wxMask, improve support
for them in various ways:
1. Implement loading and saving of monochrome BMP files.
2. Add wxMonoPixelData for direct access to monochrome bitmap pixels.
3. Implement conversion from wxImage to monochrome wxBitmap.
Closes https://github.com/wxWidgets/wxWidgets/pull/2032
While technically it still builds with older versions,
version 1.0.622.22 ist the first non preview release which should
make the included webview loader DLL the most compatible for the
forseable future.
This is useless, all still supported compilers except ancient MSVS
versions (for which configure is not used anyhow) support variadic
macros, so don't waste time testing for them.
Note that the checks for HAVE_VARIADIC_MACROS in the sources are still
left because it is still possible to explicitly disable variadic macros
support using --disable-vararg_macros for strict C++98 compatibility.
All still supported versions of MinGW/Cygwin provide w32api.h file, so
there is no need to test for it.
This allows to simplify the code, but also remove the definition of
HAVE_W32API_H from bake- and makefiles and this, in turn, allows to get
rid of extra flags in MinGW format entirely, as we don't support gcc
2.95 for which they were originally needed neither.
Fix issues found by address/leak sanitizers in the unit tests and add
Travis CI build running tests built with ASAN to ensure they don't
reappear in the future.
See https://github.com/wxWidgets/wxWidgets/pull/2086
The version of glibc used under Ubuntu 20.04 doesn't have "%Z" in the
French date-time locale, which broke the test there.
Instead of adding even more tests for glibc version, just ignore "%Z" if
it's present, we don't really care about it, we just want to check that
wxLocale::GetInfo() returns something recognizably different from C and
English locale here.
Don't rely on just a single GTK version being installed on the system,
as we do now, but select the version we want explicitly, just to avoid
bad surprises in the future (even if it doesn't change anything for
now).
It default to 2 currently, which is rather surprising, so prepare for
requiring specifying it explicitly by adding wxGTK_VERSION to all wxGTK
builds environments.
Also document the need for using WX_CLEAR_LIST() when converting a
list-valued wxVariant to wxAny.
Note that we intentionally don't fix the problem by clearing the list
automatically, even if it could be done, because this would silently
break the existing code which does already clear the list -- and now
would attempt to clear it twice, with fatal consequences. Instead
document the existing behaviour and explain how to avoid memory leaks.
We're not interested in these (one off) leaks and can't do anything
about them anyhow, so just provide a way too suppress leak sanitizer
errors about them.
Remove the unnecessary, and actually harmful, overridden GetProduct(),
as we must delete the pointer returned by the base class version to
avoid leaking it.
Also use wxScopedPtr to avoid leaking a test wxHtmlContainerCell.
Add the sizer item to the sizers items list only after calling of
wxWindowBase::SetContainingSizer() because it can throw (if it asserts
and the assert handler throws an exception, as happens in our own unit
tests) and then the sizer item would be kept in the sizers items list
but m_containingSizer wouldn't be set for the window.
This reverts the changes of 4dc78a33e0 (Fix adding items to a never
opened branch of generic wxDataViewCtrl, 2018-01-17) which was supposed
to fix a problem which doesn't seem to be reproducible any longer (and,
unfortunately, wasn't recorded in the commit message back then), but
introduced another problem instead: postponing adding the node to the
tree didn't work correctly in case of depth-first model traversal in the
user code calling ItemAdded() for all the items, as in this case the
next call to ItemAdded() for a child of the item that wasn't added to
the tree because its parent hadn't been opened yet, would result in
adding this item and all its siblings to the tree when FindNode(parent)
would be called. And this, in turn, would result in the siblings of this
item being added to the tree twice.
Adding a test reproducing this problem is difficult, as we don't have
any way to check the internal state of wxDataViewMainWindow from the
outside, so this commit still doesn't do this, unfortunately.
Closes#18405.
GetItemByRow() returned a valid row even for an item which was collapsed
which is clearly inappropriate for its use in GetItemRect(), which is
supposed return an invalid rectangle if the item is not visible. It also
might be inappropriate in other cases, but this is not totally clear and
it seems like it is supposed to return a valid row even for collapsed
items at least sometimes, so just make its behaviour conditional by
adding a new flags parameter to GetItemRect() and to Walker() helper
used by it itself, so that it could skip over collapsed items.
Update the test to show that it succeeds now even when the item is
present in the tree, as it only passed before because the item had never
been expanded at all, and so wasn't really present in the tree
structure and the updated test would have failed without the changes to
the code in this commit.
Most of them can't be expected to work, e.g. non-ASCII file names can't
be supported without Unicode support.
Some others, e.g. test for NULs in wxDataOutputStream, are questionable,
as it seems that it might be possible to fix them in ANSI build too, but
for now just do the simplest thing to make the tests pass on Travis.