Commit Graph

61526 Commits

Author SHA1 Message Date
Vadim Zeitlin
596399f2ec Remove wxLogDebug() from wxColour::FromString()
Just returning false is enough, there is no need to log a debug message as
well.

Also simplify the logic of this function a little by always returning true at
the end and returning false before on failure.

Closes #13759.
2016-05-19 22:05:11 +02:00
Vadim Zeitlin
5817911863 Merge fixes for CVE-2016-0718 in Expat
This merges a branch with a (slightly tweaked to apply) copy of the
cve-2016-0718-fix-2-2-1 branch from the official Expat repository at
https://sourceforge.net/p/expat/code_git/
2016-05-18 14:52:26 +02:00
Lauri Nurmi
d51ce354c1 Document that wxFileSystemWatcher requires a running event loop
On Gtk and OS X, but unfortunately not MSW, an assert fails if a
wxFileSystemWatcher is created too early. Therefore give a hint about
where and when one should be created.

Closes https://github.com/wxWidgets/wxWidgets/pull/287
2016-05-18 14:51:31 +02:00
Pascal Cuoq
06ea3e152c Do not compare an out-of-bounds pointer. See https://lwn.net/Articles/278137/ 2016-05-18 14:50:03 +02:00
Pascal Cuoq
6a3374989c Avoid undefined behavior when computing larger blockSize. The compiler might reason that (end - start)*2 is negative only if (end - start) is negative, see https://godbolt.org/g/wVEoTM 2016-05-18 14:50:03 +02:00
Sebastian Pipping
b6bc23c9b4 Complete XmlConvert return value handling 2016-05-18 14:50:03 +02:00
Sebastian Pipping
7f6194038a Do not grow pool to out-of-memory for incomplete input 2016-05-18 14:50:03 +02:00
Sebastian Pipping
d8d581a382 Make converters tell state on termination (v3) 2016-05-18 14:50:03 +02:00
Sebastian Pipping
a398ccf8ec Prevent out-of-bounds access in text conversion
* big2_toUtf8
* little2_toUtf8
* utf8_toUtf8
* utf8_toUtf16
2016-05-18 14:47:55 +02:00
Gustavo Grieco
a4d77355e3 Fix two integer overflows 2016-05-18 14:47:55 +02:00
Karl Waclawek
0f0c5aa731 Fix overflow (v2)
(Some post-processing by Sebastian Pipping)
2016-05-18 14:47:55 +02:00
Vadim Zeitlin
5b597cd0e8 Fix widgets sample build with MinGW-w64 4.9.1
The headers for this compiler, at least in the version packaged under Debian,
define BCN_DROPDOWN but not the NMBCDROPDOWN struct we also need, so we have
no choice but to redeclare the struct ourselves to allow this code to compile.
2016-05-17 23:36:06 +02:00
Vadim Zeitlin
fb4ff2449c Correct test for MSVC in wxStackWalker::Walk()
Use "#if defined" instead of "#if" for the check for __VISUALC__ added in
e405bf1607 to avoid -Wundef warnings when
compiling this code with gcc.
2016-05-17 20:26:16 +02:00
Vadim Zeitlin
6a2a4ef38b Use "int" instead of "long" for TLW geometry storage
For some reason, "long" was used for window coordinates even though they're
really "int", and implicitly converting from the former to the latter resulted
in warnings in user code including this header with e.g. Apple clang.

Just use int to avoid conversions.
2016-05-15 20:23:01 +02:00
Paul Cornett
8809cb68cf remove disabling comment accidentally committed in 5819b9c 2016-05-15 09:17:46 -07:00
Paul Cornett
5819b9cbc5 Avoid resetting global cursor if no global cursor is set
see #17503
2016-05-15 09:06:09 -07:00
Paul Cornett
4c6dddec21 Fix single line wxTextCtrl selection colors when foreground or background color is set with GTK3
see #17527
2016-05-14 11:38:36 -07:00
Eric Raijmakers
5d671d8136 Fix keyboard navigation crash in single column generic wxDataViewCtrl
Selecting a leaf node in a wxDataViewCtrl and then pressing the right arrow
key resulted in using an out-of-bounds index for accessing the columns list.

Fix this by setting the current column to the first one, and not to the second
one which might not exist.

Closes #17537.
2016-05-14 16:18:14 +02:00
lcrees
311b4d1b14 Fix wxOSX build on case-sensitive filesystem
Use the correct case for AppKit.h to fix the problem with not finding the file
when using a case-sensitive filesystem for the build.

Closes https://github.com/wxWidgets/wxWidgets/pull/284
2016-05-14 15:46:09 +02:00
Benjamin Drung
bc41cbeb25 Define wxIsNaN() as std::isnan() in C++11 mode
std::isnan() is always available when using C++11, so just use it.

Also pout the test for C++11 implementations of both wxIsNaN() and wxFinite()
first, eventually the rest of the checks will become obsolete and will be
removed.

Closes https://github.com/wxWidgets/wxWidgets/pull/283
2016-05-14 00:13:47 +02:00
Vadim Zeitlin
a5d2f53f41 Inherit wxGauge from wxGaugeBase in wxGTK
Ensure the proper class hierarchy in wxGTK, this notably allows to override
SetValue() in classes derived from wxGauge, which didn't work in wxGTK (but
did in wxMSW and wxOSX) before.

Also remove the now unnecessary IsVertical().
2016-05-13 22:32:16 +02:00
Vadim Zeitlin
189e4c5024 Null-terminate arrays returned from wxCmdLineArgsArray
This is required for compatibility with the real argv array that this class is
supposed to emulate.

Closes #17531.
2016-05-13 15:40:22 +02:00
Jonathan Dagresta
306597c4fa Ensure wxGenericListCtrl item selected from keyboard is visible
When using the keyboard to select an item by typing the first characters of
its name, we need to make the item visible in addition to selecting it.

Closes #16336.
2016-05-13 15:30:13 +02:00
Artur Wieczorek
360416dfed Check if path geometry contents was successfully transferred while cloning wxD2DPathData.
Since only geometry with closed sink (immutable) can be transferred to another geometry object with ID2D1PathGeometry::Stream() so we have to check if actual transfer succeeded and return NULL if not.
2016-05-12 21:34:53 +02:00
Artur Wieczorek
bd55ce4d37 Fixed closing sub-path of wxGraphicsPath with Direct2D renderer.
To ensure compatibility with Cairo renderer the new sub-path should be started at the joined endpoint of the current (just closed) sub-path.

Closes #17532
2016-05-12 21:33:50 +02:00
Artur Wieczorek
4014000a98 Fixed wxGraphicsPath concatenation (with AddPath) for Direct2D renderer.
Because only ID2D1PathGeometry with closed sink (in the immutable state) can be transferred to another geometry object with ID2D1PathGeometry::Stream() so appending one wxGraphicsPath to another has to be done with source path geometry in the non-writable state and closing this geometry has to be done prior to any other operation.
But we want source wxGraphicsPath to stay in the writable state after appending it to another path so we have to prepare a writable copy of the source ID2D1PathGeometry and assign it to the source wxGraphicPath after the appending.

See #17532
2016-05-12 21:32:20 +02:00
Artur Wieczorek
43be7073cd Make closing sub-path of wxGraphicsPath with GDI+ renderer compatible with Cairo renderer.
Cairo renderer places MOVE_TO element into the path immediately after after the CLOSE_PATH element so to ensure that GDI+ will behave in the same way the new sub-path should be started at the joined endpoint of the current just closed sub-path.

See #17532
2016-05-12 21:26:25 +02:00
Artur Wieczorek
49a634e63f Fixed closing sub-path of wxGraphicsPath with GDI+ renderer.
Add additional point to the sub-path being closed only if this sub-path is empty (its native current point is not set).
2016-05-12 21:18:24 +02:00
Artur Wieczorek
5ffbc7c175 Fixed applying transformation to wxGraphicsPath with GDI+ renderer.
Auxiliary points as well as the native path points have to be the subject of the transformation.
2016-05-12 21:16:51 +02:00
Artur Wieczorek
08cb54c4c1 Fixed wxGraphicsPath concatenation with GDI+ renderer.
Since resulting wxGraphicPath should have the same state as appended path so we have to grab in wxGraphicsPath::AddPath also auxiliary data from appended wxGraphicsPath.

See #17532
2016-05-12 21:15:19 +02:00
Vadim Zeitlin
4eababc004 Don't document non-public wxEvtHandler::SearchEventTable()
This method is not part of public wxWidgets API, so don't document it.
2016-05-09 18:58:39 +02:00
Artur Wieczorek
66e3a3f724 Fixed adding a Bezier curve to wxGraphicsPath with Direct2D renderer.
When current point is not set before the call to wxGraphicsPath::AddCurveToPoint() then it should be set at first control point prior to adding a curve (function should behave as if preceded by MoveToPoint).

Closes #17526
2016-05-09 18:41:16 +02:00
Artur Wieczorek
22c520e3e8 Fixed adding a Bezier curve to wxGraphicsPath with GDI+ renderer.
When current point is not set before the call to wxGraphicsPath::AddCurveToPoint() then it should be set at first control point prior to adding a curve (function should behave as if preceded by MoveToPoint).

See #17526
2016-05-09 18:40:10 +02:00
Jouk
d3e57a1dcf define != operator for WatcherWithUserData needed for find on OpenVMS AXP 2016-05-09 10:21:13 +02:00
Artur Wieczorek
43ba49285b Fixed closing sub-path of wxGraphicsPath with Direct2D renderer.
Ensure that sub-path being closed contains at least one point.

Closes #17525
2016-05-08 21:54:11 +02:00
Artur Wieczorek
fa5f3818b9 Fixed adding a line to wxGraphicsPath with Direct2D renderer.
When current point is not yet set then wxGraphicsPath::AddLineToPoint() should behave as MoveToPoint(). We have to determine whether current point is set or not using additional flag because native renderer doesn't provide any support regarding this matter.

See #17525
2016-05-08 21:53:15 +02:00
Artur Wieczorek
24dfd62fc0 Fixed closing sub-path of wxGraphicsPath with GDI+ renderer.
Ensure that sub-path being closed contains at least one point.

See #17525.
2016-05-08 21:52:04 +02:00
Artur Wieczorek
17e24fec73 Fixed adding a line to wxGraphicsPath with GDI+ renderer.
When current point is not yet set then wxGraphicsPath::AddLineToPoint() should behave as MoveToPoint().

See #17525
2016-05-08 21:51:01 +02:00
Eric Jensen
e7a526604c Implement auto complete in generic wxSearchCtrl
Just forward the relevant methods to the embedded wxTextCtrl.

Closes #17519.
2016-05-07 01:49:22 +02:00
Vadim Zeitlin
e85b8f1a4b Define CFE_AUTOBACKCOLOR ourselves if necessary
Older MinGW cross-compiler versions don't have this symbol in their headers.
2016-05-06 18:55:41 +02:00
Vadim Zeitlin
8677b7eb0a Move our own CFM_BACKCOLOR definition to src/msw/textctrl.cpp
It is only needed/used in this source file, no need to have it in the global
header.
2016-05-06 18:54:40 +02:00
Artur Wieczorek
fab6d0e757 Fixed closing sub-path of wxGraphicsPath with GDI+ renderer.
Close sub-path only if it is really open.
2016-05-06 18:51:01 +02:00
Artur Wieczorek
a6d97acc31 Update documentation regarding wxGraphicsPath::AddRoundedRectangle(). 2016-05-06 18:50:04 +02:00
Artur Wieczorek
dc75ae2bf7 Fixed appending a curve to wxGraphicsPath with Direct2D renderer.
If there is necessary to start a new D2D figure prior to appending a curve to the path then this new figure should be started at the current point and not always at (0,0).

Closes #17521
2016-05-06 18:49:05 +02:00
Artur Wieczorek
984e54ffdd Fixed closing sub-paths of wxGraphicsPath with GDI+ renderer.
When sub-path is closed with CloseSubpath() then current point should be moved to the joined endpoint of the sub-path (what is equivalent of moving it to the starting point of the sub-path). Native CloseFigure() doesn't move the native current point to the starting point of the figure so we need to maintain it on our own in this case.
To implement this behaviour we need to store the starting point of the figure in a dedicate data member and use it to update the current point when the figure is closed.
But native GDI+ renderer doesn't offer any support for updating directly the current point (only explicit drawing operations update its value) so we need also to remember our "logical" current point (being the result of calling CloseSubPath, MoveToPoint, etc.) in a dedicated data member and use it instead of the native current point in the next operation which requires current point location.

Closes #17520
2016-05-05 13:52:12 +02:00
Artur Wieczorek
329aee5660 Fixed closing sub-path of wxGraphicsPath with Direct2D renderer.
When sub-path is closed with CloseSubpath() then current point should be moved to the joined endpoint of the sub-path (what is equivalent of moving it to the starting point of the sub-path). To implement this behaviour we need to store on our own the starting point of the figure in a dedicate data member because native D2D renderer apparently doesn't offer any support for retrieving it.

See #17520
2016-05-05 13:51:27 +02:00
Artur Wieczorek
6879311b98 Fixed appending a line to wxGraphicsPath with GDI+ renderer.
New line appended to the path should be started explicitly at the current point.

See #17520
2016-05-05 13:50:52 +02:00
Artur Wieczorek
a28f1b7f44 Fixed appending a line to wxGraphicsPath with Direct2D renderer.
If there is necessary to start a new D2D figure prior to appending the line to the path it should be started at the current point and not always at (0,0).

See #17520
2016-05-05 13:50:09 +02:00
Artur Wieczorek
008a162241 Fixed appending circle/ellipse to wxGraphicsPath with Direct2D renderer.
Circle/ellipse should be appended as a closed sub-path and the current point after the operation should be moved to "the rightmost point" of the figure ((x+r,y) and (x+w,y+h/2) respectively).

See #17520
2016-05-05 13:49:36 +02:00
Vadim Zeitlin
e2b13a7b8e Fix background colour returned by wxTextCtrl::GetStyle() in wxMSW
Don't return the background colour unless it's really set, otherwise we
returned black background even if it was never changed.
2016-05-05 03:05:45 +02:00