This is not natural for the non-consecutive values of the font styles and
doesn't properly check for the array indices being valid, resulting in static
analysis tools warnings about a possibly out of bound array access.
This allows to detect errors with retrieving the item label more reliably as
GetMenuItemInfo() sets the last error correctly while GetMenuString() doesn't
seem to always do it and some users report apparently bogus debug messages
about its failure.
Visibility support for Clang was disabled in 7198c33 because of linking
errors when building shared libraries, related to non-inline methods in
exported template classes.
The last Clang version to have these problems is version "4.1
(tags/Apple/clang-421.11.66)" as part of Xcode 4.5.2, and the next
release fixes them (version "4.2 (clang-425.0.24)", Xcode 4.6). Check
for the Clang version and only disable visibility support when compiling
with Apple Clang < 4.2.
Note that Apple Clang 4.2 is based on official Clang 3.2 so also check
for that version in case of non-Apple builds. The only official Clang
that has been tested successfully is 3.4 which worked fine with
visibility. Other versions that were tried (3.1 and 3.2) segfault while
compiling wx.
This flag shouldn't be used in vertical sizers (in wxLongStringProperty and wxPGArrayEditorDialog) because vertical alignment flags are ignored in such sizers and the assertion message is thrown in wxBoxSizer::DoInsert. This can be observed e.g. in propgrid sample when there is launched wxLongStringProperty or ArrayDoubleProperty editor.
The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.
Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.
Also add a unit test verifying that this works as expected.
Closes#17010.
Verify that repeating positional parameters does work with wxString::Format()
instead of keeping these tests commented out in wxVsnprintf() tests, which are
not run at all if we're using the compiler-provided vsprintf().
Closes#9367.
Remove second unnecessary casting from wxWindow to wxTextCtrl and use wxTextCtr::IsEmpty() function to check directly if the text control contains any text instead of examining retrieved string value.
The drag mask passed by Cocoa is conservative and doesn't include
NSDragOperationMove which was added later. Override
draggingSourceOperationMaskForLocal to include that flag if it's wanted.
This also moving of text the default behaviour.
Closes#13819.
Closes#14726.
Commit f40e8bf uncovered a problem with dragging where when the
NSDragOperationLink bit is set in the drag mask (which by default always
is the case) the result is a wxDragLink operation instead of wxDragCopy
or wxDragMove. To fix this give priority to move and copy instead when
converting the drag mask to a wxDrag result.
This fixes copying through DND in wxRichTextCtrl.
See #13819.
To reduce duplication of the same changes, merge the nearly identical
wxWidgetCocoaImpl::draggingEntered and draggingUpdated into private
function wxOnDraggingEnteredOrUpdated.
Instead of moving the frame up every time to be able to reach the
dragging section at the bottom, change the sizer proportion of the log
control in the middle to reduce the frame's height.
Currently, validation flags are initialized when post-process validation is invoked (in wxPropertyGrid::PerformValidation) and when first editing operation fails earlier on the pre-process validation (in wxPropertyGrid::DoEditorValidate) then these flags are not initialized and no validation error message is displayed.
Hence validation flags should be initialized in both validation functions.
Close the device file descriptor in the dtor instead of doing it in the thread
used to poll it, this is more straightforward and ensures that it happens even
if the thread failed to run for whatever reason.
Don't use an uninitialized pointer in wxCairoContext ctor from wxPrinterDC in
wxGTK if retrieving Cairo context of the DC failed, set m_context to NULL in
this case (not sure if this is still not going to crash when used in
cairo_translate() below though).
Don't use heap-allocated wxGIFDecoder when a stack-allocated object would do
just as well.
Don't handle errors different from the defined wxGIF_XXX constants: they can
never happen because LoadGIF() has no way of returning them.
Don't check for "ok" variable being false when it was set to true and never
changed until this check.
At least the width must be non-0 as we allocate a width-sized array below and
0 height is probably problematic -- and definitely not useful -- as well, so
just bail out if either of them is 0.
We could have ended up using (invalid) wxPLATFORM_CURRENT as an index into an
array if neither __WINDOWS__, nor __WXMAC__, nor __WXGTK__ nor __WXMOTIF__
were defined (which would be the case in e.g. wxX11 or wxQt ports). Fix this
by always falling back on wxPLATFORM_UNIX.
The value actually can't be invalid in this code as we ensure that it's never
set to Field_Max elsewhere but as we still have this value in the switch (in
order to avoid compile-time warnings about not handling some enum elements),
ensure that we don't use this invalid value if we end up here to avoid
Coverity warnings about what happens downstream in the code if we did.