This aligns the memory stream's Peek with other streams' Peek impls by
making it set the last read count to 1 when it successfully peeks a
character, or 0 when it does not. While the formal docs do not link
Peek to LastCount directly, the in-source comments on the declaration
of both wxInputStream::Peek and wxInputStream::LastRead both indicate
that Peek will set the last read count.
Newer standard library headers should only be included when the compiler
is targetting that standard, otherwise some compilers (like MSVC) will
warn that you are using a newer C++ include on an older version.
Previously it only inherited from wxTextEntryBase in the generic
implementation (used e.g. in wxMSW).
Update the code, documentation and add new unit tests checking that
wxSearchCtrl member functions inherited from wxTextEntry behave
correctly.
Closes#23686.
Closes#23697.
This implicitly declared operator is deprecated because MyClass has an
explicitly defined copy ctor, so we either need to define the assignment
explicitly too or just not use it at all, as done by this commit.
This code can't be modified as it tests for compatibility with the
existing code of this form, so just disable the warnings it now triggers
with -Wextra.
This should have been done in c2e5749443 (Fix crash when reading
truncated GIF image, 2023-07-02), but was forgotten there -- so do it
now, and add a comment reminding not to forget it the next time.
See #23409.
The changes of c269932c4e (Relax checks on character entry in numeric
validators, 2023-07-02) went a bit too far and not just relaxed the
checks but removed them entirely.
Correct this by ensuring we have a valid value after focus loss.
See #12968.
Add a unit test case checking that we don't crash any longer and still
read the image meta data correctly, even if not the image itself.
Also add another check for EOF and possibly invalid "bits" value in
another place where we were not checking for it when reading from the
stream.
Closes#23409.
Co-authored-by: PB <PBfordev@gmail.com>
Using strcpy() in GetDataHere() added an extra NUL at the end which
didn't fit into the buffer of the size returned by GetDataSize(). This
could have been also fixed by returning an extra byte from the latter
function, but as the string doesn't need to be NUL-terminated,
apparently, just use memcpy() with the correct number of bytes instead.
Also, because the string is not necessarily NUL-terminated, use the
provided length in wxHTMLDataObject::SetData() instead of relying on the
buffer being NUL-terminated and reading uninitialized memory beyond its
size.
Add a unit test confirming that there are no more ASAN errors when using
this class.
Closes#23660.
Co-Authored-By: mcorino <martin@corino.nl>
Use StartFragment and EndFragment headers values in order to extract the
HTML fragment from the entire CF_HTML string, instead of searching for
"<!--StartFragment-->" and "<!--EndFragment-->" comments which could be
wrong (e.g. if a StartFragment comment actually appeared inside the HTML
fragment) and less efficient too.
Also add a simple pseudo-test, disabled by default, allowing to view the
clipboard contents if HTML is available on it.
Revert the change introduced in b473163da2
and restore the setting of the background of delta-RLE bitmaps to the
first entry in the colour table. This retains earlier wxWidgets
behaviour and matches Windows `LoadImage()` with `LR_CREATEDIBSECTION`.
Closes#23638.
Closes#23657.
Clear the cached attributes when replacing the table they were used
with.
Add unit test checking that the attributes are not used any longer.
Closes#23607.
Fix wxSocketImpl::RecvDgram() when caller requests fewer bytes than
are present in datagram, as we must always read all the available bytes
when using UDP -- they are not buffered by the OS and so won't be
provided by the next Read() call.
Closes#23594.
Closes#23604.
This fixes several minor bugs in the loading of `BI_BITFIELDS` bitmaps,
related to handling different header sizes and the colour and alpha
masks.
Closes#23601.
Check that loading BMP files directly using wxDIB and via wxImage
built-in support for them produces the same result (which wasn't the
case for the RLE-compressed bitmaps until the last commit).
In addition to showing whether the locale is supported or not, show all
of its components to allow interactively verifying if an identifier is
being parsed correctly.
Calling Clear() wrongly modified any other wxImage objects reusing the
same data.
Fix this by adding the missing call to AllocExclusive() to this function
and also add a check for the image validity which was missing there as
well ever since this function was added back in fc3762b5fc (add
wxImage::Clear (patch by troelsk); closes#10141, 2009-01-09).
Also add a unit test.
Closes#23553.
No real changes, just don't use compatibility macros any longer.
Also remove URLTestCase as it's useless now when we can just use
wxSocketInitializer directly.
This doesn't work due to LM_GETITEM not returning the expected result
after changing the state using LM_SETITEM under Wine.
It could be worked around by remembering whether we changed the colours
in our own variable, or maybe just reverted later if Wine fixes this,
but for now disable the test.
This isn't supported by the native control, and it doesn't seem worth to
make an extra effort to support it, so just document it and stop
checking that it works in the unit test.
Include the header declaring the stream insertion operators for these
types before including catch.hpp itself as otherwise they may not be
seen when these classes are used and Catch::StringMaker is instantiated
using the "unstreamable" alternative for them.
It would probably be better to specialize Catch::StringMaker for these
types directly instead of relying on stream insertion operators, but
this would require more changes and in the meanwhile this improves the
display of failing checks.
Don't delete the art provider object in Remove() as this contradicted
its contract and do restore the call to Remove() from wxArtProvider dtor
as it's actually documented to work.
This fixes a regression due to the changes of 4a294caacd (Stop using
macro-based wxList in wxArtProvider code, 2023-04-11).
Closes#23513.
Closes#23529.
This partially undoes the changes of bc23b1f4f0 (Use wxBaseArray instead
of object array for wxAuiToolBarItemArray, 2023-04-11) as they broke the
existing code using wxAuiToolBar because the pointers to the tools were
not stable any more.
At least avoid the use of the ugly -WX_DECLARE_USER_EXPORTED_OBJARRAY()
macro by just using wxBaseObjectArray<> directly, which is simpler now,
after the change in the parent commit.
Add a trivial test checking that pointers to wxAuiToolBar tools remain
stable when more tools are added.
Closes#23514.