It was possible to call SetAttribute() to change this attribute value but not
to get it back. Override DoGetAttribute() to also allow the latter.
See #15625.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75978 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Document the somewhat counter intuitive (but difficult to change) behaviour of
the splitter when both sash position and gravity are set.
See #15996.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Memory allocated by wxFindFirstFile() was only freed when no more files could
be found by wxFindNextFile(), resulting in a memory leak if the iteration was
never finished.
Closes#4631.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxPGProperty::GetItemAtY() uses its input/output "nextItem" parameter, so it
must be initialized before calling it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Replace wxASSERT() with wxCHECK_MSG() to ensure that we don't read beyond the
end of the array even if we are given an invalid index.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Delete the pointer before returning from the function if we don't pass its
ownership to CGDataProviderCreateWithData().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxScopedPtr to make memory management simpler and to ensure that all
pointers allocated in this function are deleted: this wasn't the case when we
returned false earlier due to the MO file being invalid.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code was written to use the default resolution if getting it from the
printer failed but only handled failure of PMPrinterGetOutputResolution() and
not of PMSessionGetCurrentPrinter() itself.
Use default resolution if obtaining it failed for any reason (alternative
could be to return error if obtaining it failed for any return...).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't return invalid column pointer if it was freed because actually appending
it to the control failed.
Fixes corresponding Coverity warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When not using compiler TLS support (which is the default now), TLS variable
itself needs to be initialized and user-defined code in the global objects
ctor could be called before this happened, resulting in using uninitialized
CRITICAL_SECTION under Windows and a crash.
Fix this by wrapping global wxThreadSpecificInfo itself in an accessor
function ensuring that it is always initialized before use.
Notice that this required adding wxTLS_TYPE_REF() as wxTLS_TYPE() itself can't
be used for the function return value (__thread or similar can only be used on
the variables).
Closes#16009.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using base class methods such as AppendBitmapColumn() resulted in
wxDataViewListCtrl::AppendColumn() being called but this function always
assumed the column was of "string" variant type -- which was, of course, false
for bitmap columns and so resulted in heap corruption (thanks to the
wonderfully type unsafe code using wxVariant) and a crash.
Get the correct type to use from the column itself now to fix this.
Closes#16008.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We kept doing it for compatibility with pre-2.5.3 versions but this was a long
time ago and we don't need this any longer.
See #2508.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calling Found() without providing the second "value" argument started
generating an assert since introduction of the negated options as it reused
FoundSwitch() which can only be used for switches, i.e. options without
values.
Fix this to revert a regression since 2.8 and also add unit tests for the
different Found() overloads.
Closes#15986, #16001.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just extract the code for finding options from their names
into a separate function instead of repeating it 4 (and 5, after the next
commit changes) times.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We can receive WM_NOTIFY for other than CDN_XXX messages if we have a native
control as our immediate child (which can happen with "extra" controls) and
the LPARAM is not a pointer to OFNOTIFY at all in this case, so don't try to
use it as such.
This fixes a crash when adding a "bare" extra control, see #16003.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMSW automatically extended wxTextCtrl length limit beyond the tiny standard
32KB when it was exceeded, but part of the text being appended into the
control was lost when doing it.
Fix this by retrying insertion after extending the limit.
Closes#15980.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do it only once now that it's used in 3 different places (it recently started
to be used in src/msw/anybutton.cpp as well) instead of defining it thrice.
This also fixes MinGW build.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is an incompatible change compared to 2.8 which can make the existing
code crash and it also goes against the usual rule that the windows are never
owned by sizers, only other windows.
Closes#15698.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Owner drawn buttons were not drawn in the same way as normal ones when they
were disabled, use Win32 DrawState() to do it now to achieve the correct
appearance.
Closes#11746.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Appending the names of all fonts could take a significant amount of time if
there were a lot of them, freeze the controls while doing it to speed it up.
Closes#15978.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Starting to watch a path, stopping to watch it, starting to watch it again and
stopping again resulted in a crash in wxMSW wxFileSystemWatcher implementation
because the watcher object wasn't kept artificially kept alive when it was
stopped for the second time. This happened because our way of keeping it alive
was to store it in a hash map indexed by path, but if a watcher for the same
path (added there when this path was first unwatched) was already present in
the map, the watcher wasn't added to it and not kept alive.
Fix this by using a vector instead of a map. We obviously sacrifice quick
access to it by path but at least this doesn't crash any more. And we could
actually still use a map, just indexed by the (unique) pointer to the object
stored inside wxSharedPtr itself, and not its path. But a vector might be a
more efficient data structure in practice, if we keep it from becoming too big
as we should try to do by triggering artificial port completions when a watch
is removed.
At any rate, at least the crash is fixed for now.
Closes#15995.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Attempts to wait for thread termination after wxTheApp was destroyed resulted
in an error in wxMSW since 2.9.something whereas it used to work in 2.8 and
also generally makes sense to be allowed. So do make this work again by
falling back to the simple non-interruptible wait for thread if we don't have
the application object any more.
Closes#13391.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Due to a typo when copy-and-pasting code wrong control was being updated.
It would be better to have a function updating the given control from the
given flag, of course, but for now just fix the bug.
Closes#15990.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't crash by accessing an out of bands array element if the format string
index had been set to an invalid value, just use the default (decimal) format
in this case.
Closes#15984.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just use symbolic constants instead of hard coded magical
constants. The code is still difficult to understand but slightly better than
before.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775