Commit Graph

63279 Commits

Author SHA1 Message Date
Vadim Zeitlin
9d5ff447e1 Add subsections to MBConvTestCase::NonBMPCharTests()
This allows to immediately see which of the tests failed just looking at
the logs instead of having to check the failure line number manually.

No real changes.
2017-11-09 23:38:03 +01:00
Vadim Zeitlin
666ff421bb Fix an out of bounds read in UTF-7 decoding code
Calling wxMBConvUTF7::ToWChar(..., "+", 1) resulted in reading
uninitialized memory as the decoding code didn't check that there were
any bytes left when switching to the "shifted" mode.

Fix this by explicitly checking for this and returning an error if
nothing is left.
2017-11-09 23:38:00 +01:00
PB
022a725bf9 Fix few minor issues in wxAutomationObject documentation
Remove redundant consts, document GetDispatchPtr() return type.
2017-11-09 22:18:57 +01:00
Stefan Csomor
fac481f6ea Removing whitespace which lead to incorrect processing by update-setup-h on macOS 2017-11-09 11:43:05 +01:00
Stefan Csomor
895a86886d Modelling setup.h modification on osx along msw, having a separate file
Note that for update-setup-h to work properly on osx, gnu-sed is needed
2017-11-09 11:35:36 +01:00
Vadim Zeitlin
f365b0712b Get rid of wxTextInputStream code dealing with wxEOT
Having NextChar() returning wxEOT only for GetChar() to turn it back to
NUL didn't make any sense, just return NUL directly and get rid of
GetChar/NextChar() distinction.

No real changes, just simplify the code.
2017-11-08 23:27:13 +01:00
Vadim Zeitlin
46fe849db6 Restore access to wxLogStderr::m_fp from derived classes
This was allowed before, but m_fp became private after the refactoring
of a7dddd9f3b.

Make it protected again now to avoid breaking existing code that
accesses it.
2017-11-07 22:40:32 +01:00
VZ
d3db5b30f6
Fix or disable currently failing wxGTK GUI tests
Try to ensure that the GUI test suite passes so that buildbot has a
chance to warn us if/when anything breaks.
2017-11-07 20:56:09 +01:00
Vadim Zeitlin
b130595975 Remove accidental global variable from the font sample
This variable was never used and appears to have been created
accidentally, so just remove it and avoid variable shadowing warnings
from MSVS 2015 when building the sample.
2017-11-07 18:28:54 +01:00
Vadim Zeitlin
83b02930f4 Remove cppunit.m4 inclusion from aclocal.m4
This should have been done in e70fc11ef1
when CppUnit was replaced with Catch.
2017-11-07 18:27:44 +01:00
Vadim Zeitlin
c212941ad5 Merge branch 'qt-fixes'
See https://github.com/wxWidgets/wxWidgets/pull/589

Closes https://github.com/wxWidgets/wxWidgets/pull/319
2017-11-07 16:42:12 +01:00
Vadim Zeitlin
7ba933c694 Disable wxPaintEvent propagation tests for wxGTK3
They're currently broken and just always fail, it's useless to continue
running them until the issue described in the comment in this commit is
fixed.
2017-11-07 16:37:25 +01:00
Vadim Zeitlin
80a11ae17f Use wxGtkObject instead of g_object_unref() calls in Cairo code
Make the code safer and shorter.

No real changes.
2017-11-07 16:32:36 +01:00
Vadim Zeitlin
3b76e590d4 Return descent from Cairo GetTextExtent() even for empty strings
This method still needs to return the correct descent in this case.

Fixes MeasuringTextTestCase::LeadingAndDescent() unit test failure with
GTK+ 3.
2017-11-07 16:26:12 +01:00
Vadim Zeitlin
643071fc77 Add more new lines around GTK errors in the test suite
Try to make things a bit more readable.
2017-11-07 16:21:38 +01:00
Vadim Zeitlin
c13e28ebfb Disable wxTopLevelWindow::IsActive() unit test for wxGTK
It just doesn't work in the test, so live without it for now.

Also use CHECK() instead of CPPUNIT_ASSERT(), which expands into
REQUIRE(), for independent tests to let later tests to still be done
even if an earlier one fails.
2017-11-07 16:16:08 +01:00
Vadim Zeitlin
548d7a0518 Disable keyboard event unit tests for wxGTK
They suffer from the same problem as all the other tests using
wxUIActionSimulator: it is flaky with GTK+ 2 and doesn't work at all
with GTK+ 3.
2017-11-07 16:10:19 +01:00
Vadim Zeitlin
f0a32f0e1f Wait for the focus event to occur in the unit test
The test failed unless we dispatched events with wxGTK (both 2 and 3).
2017-11-07 15:44:18 +01:00
Vadim Zeitlin
66324470f1 Fix wxTextCtrl::GetStyle() with GTK+ 3
The text and background colours are now stored in the rgba array instead
of fg_color and bg_color as with GTK+ 2 (the latter ones seem to have
been repurposed for the underline and strike-through colours!).

Also make the unit test for this method more robust.
2017-11-07 15:40:29 +01:00
Vadim Zeitlin
5fb740fed8 Add a layout hack to PositionToCoords() unit test for wxGTK
The text control needs a few event loop iterations in order to layout
itself correctly, so give it up to 1 second to do it in order to avoid
spurious test failures that occurred if just a single call to wxYield()
were done (or, worse, none at all as it was the case before).

Also log the value returned by PositionToCoords() in case of test
failures.
2017-11-07 15:03:59 +01:00
Vadim Zeitlin
407d38d9ed Always use wxTE_MULTILINE explicitly in PositionToCoords() test
While it is added implicitly when running all tests in the order, this
style wasn't used if just this test was ran using "-c PositionToCoords"
option.

Specify wxTE_MULTILINE in it explicitly to allow this to work too.
2017-11-07 14:23:07 +01:00
Vadim Zeitlin
faad429b0f Fix wxTextCtrl::XYToPosition() for last position in wxGTK
Change this method to consider the coordinates corresponding to the last
position (i.e. the one beyond the last text character) as valid, for
consistency with wxMSW and to conform to the documented behaviour.

Also give more information about the failures in the corresponding unit
test to make debugging problems with this function simpler.
2017-11-07 14:12:48 +01:00
Vadim Zeitlin
af9f78852a Fix archivers test suite broken by transition to Catch
The code of ziptest and tartest classes still compiled, but actually
didn't do anything during the run-time because makeSuite() method was
never called.

Replace this unused method with DoRunTest() and override runTest() in
the test suite classes to actually run the tests.
2017-11-07 13:50:47 +01:00
Vadim Zeitlin
5195e788d4 Fix unsigned integer overflow in ZIP reading code
Blindly adding 4 to an unsigned length field could result in 0 and this
led to an infinite loop while iterating over all header fields.

Avoid this by promoting the length to int first, before adding 4 to it.

Credit to OSS-Fuzz: this solves its issue 4083.
2017-11-07 13:24:29 +01:00
Martin Srebotnjak
8fe3745b14 Complete Slovenian translations
All messages are translated now.
2017-11-07 13:03:37 +01:00
Vadim Zeitlin
6d55a533a3 Add overview of wxTextCtrl positions and coordinates
Explain the various coordinates that can be used and which positions are
considered valid and which are not.
2017-11-07 03:46:50 +01:00
Vadim Zeitlin
1c4e8377b7 Fix XYToPosition() for the last position in first line in wxGTK
This is similar to e74fb5effe for wxMSW
and ensures that we don't consider the last position on the first line
invalid in wxGTK neither.

This fixes TextCtrlTestCase::XYToPositionSingleLine() unit test failure.
2017-11-07 03:46:26 +01:00
Vadim Zeitlin
72fe57ec18 Use wxTextEntry::Clear() in wxOwnerDrawnComboBox::Clear()
This seems more natural than calling SetValue(wxEmptyString).

No real changes.
2017-11-07 03:14:49 +01:00
Vadim Zeitlin
13163fb315 Send event when clearing wxTextCtrl in wxGTK again
This was broken by 1c946a469a and resulted
in test failures in OwnerDrawnComboBoxTestCase::TextChangeEvents() unit
test because wxOwnerDrawnComboBox::Clear() used SetValue("") and didn't
generate any events any more.

Fix this regression by explicitly sending an event if we're returning
early and add a unit test explicitly checking that SetValue("") does
generate an event.
2017-11-07 03:12:10 +01:00
Vadim Zeitlin
3069167dd4 Do set the current test name when running the tests
The variables and helper TempStringAssign class were added in order to
implement this, but somehow it was never done, so wxGetCurrentTestName()
always returned an empty string.

Fix this and so store the class/method name of the currently running
test in the global variables to give more context, notably for GTK+
errors.
2017-11-07 02:54:25 +01:00
Vadim Zeitlin
79d35109f0 Avoid assert if there is no selection in wxListCtrl::DeleteItem()
Don't try making the current item visible if there is no current item.

This is another fix after 99d7b13e3f (in
addition to the previous 925a1c0734).
2017-11-07 02:54:24 +01:00
Vadim Zeitlin
cacb49c4ad Remove "test" from the sections names in Catch unit tests
It doesn't really add anything and it's more convenient to specify the
section on the command line (using the "-c" option) if it's just a
single word, without spaces, as it doesn't need to be quoted then.
2017-11-07 02:54:18 +01:00
Vadim Zeitlin
e8ceaabb87 Avoid gcc -Wunused-function warnings in wxEvtHandler unit test
The warnings are justified as the functions defined by the event table
macros are indeed not used here because we only write them to test that
they compile, but not useful, so suppress them.
2017-11-07 02:54:05 +01:00
Vadim Zeitlin
2b02da2bbd Revert "fix build without graphics context"
This reverts commit 44c91fedb8 which is
not necessary for wxQt any more as wxGraphicsContext is available for it
now and didn't make much sense because wxActivityIndicator just can't be
used without wxGraphicsContext, so a proper fix would be to disable the
former completely if the latter is unavailable.
2017-11-06 02:16:07 +01:00
R.J.V. Bertin
3da6b9c14f Make wxQt build again, with less compiler warnings
This fixes a missing include in qt/nonownedwnd.cpp and a missing method
in qt/glcanvas.cpp, allowing the build to complete again. A number of
missing wxOVERRIDE statements were added to reduce the important number of
compiler warnings about those missing labels.
2017-11-06 02:06:02 +01:00
Sean D'Epagnier
1c249a6934 additional code style improvements from github comments 2017-11-06 02:06:02 +01:00
Sean D'Epagnier
7338f32dfd declare member override to ensure virtual overload 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
169d61edb7 wxqt: correct formatting and casting, no functional change 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
42144b93b7 improve wxqt color implementation thanks @catalinr 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
bf9eacad16 correct ppi implementation in wxqtdc 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
2a2e17c050 correct small errors in wxqt implementation 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
5261d3eb05 correct null reference if set flags is called in Init 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
7e7530f010 return correct dialog return code for exec 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
52a7a1c5e6 windows should not be destroyed just because the close event succeeds 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
27df7100b4 correct wxqt listctrl for invalid index 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
988bc8b306 correct text extent to not require active painter 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
cc01fbc3c0 defer dc screen grab until blit 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
694decea6e apply mask to result after paint operations so that qt doesn't clobber the mask
also fixes small memory leak
2017-11-06 02:05:40 +01:00
Sean D'Epagnier
65af28271e improve selection (base class handles this better already) 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
1cb7120ac9 support masked or partially transparent windows in wxqt 2017-11-06 02:05:40 +01:00