Commit graph

74957 commits

Author SHA1 Message Date
Kaya Zeren
3d5354831b Update Turkish translations
Turkish translation updates and refinements.

Closes #23688.
2023-07-08 00:37:39 +02:00
Vadim Zeitlin
d1ee86df3c Merge branch 'gcc-wextra'
Enable -Wextra for the Unix CI builds after fixing all the existing
warnings.

See #23662.
2023-07-08 00:36:47 +02:00
Stefan Ziegler
e35257d2b6 Fix possible crash in wxWindowsPrintNativeData initialization
If the printer name is specified, avoid fall back to the default printer
via the use of PRINTDLG, as the default printer DEVMODE may be
incompatible with that of the printer we're actually going to use and
could possible result in a crash if their size differs.

Use a temporary printer if necessary to retrieve the correct DEVMODE for
the given printer name.

Closes #23685.
2023-07-08 00:30:04 +02:00
Vadim Zeitlin
78760c3538 Enable -Wextra for the CI builds
Try detecting more warnings that can be useful when building the
library.

Don't use -Wextra with gcc 4.8 which generates several completely
spurious warnings not generated by later compiler versions and which are
not worth fixing/working around.
2023-07-04 02:19:14 +02:00
Vadim Zeitlin
e802eaa44d Suppress a warning for g_object_ref_sink() use in widgets sample
The glib macro always triggers this warning when -Wextra is on, so we
have no choice but to suppress it.
2023-07-04 02:19:14 +02:00
Vadim Zeitlin
4040e35f41 Use wxEVENT_HANDLER_CAST() in socket sample
This macro avoids a -Wcast-function-type from gcc 8+.
2023-07-04 02:19:07 +02:00
Vadim Zeitlin
008e72c3ac Avoid using implicit assignment operator in wxAny test
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.
2023-07-04 02:08:32 +02:00
Vadim Zeitlin
b6d082a7a6 Suppress warning in tests checking legacy Connect()
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.
2023-07-04 02:08:32 +02:00
Carlo Bramini
590cd0bd18 Fix linking with EGL under Cygwin in CMake builds
Link with OPENGL_egl_LIBRARY if OpenGL::EGL is not defined.

Closes #23673.
2023-07-04 01:37:15 +02:00
Vadim Zeitlin
9952af8e93 Define explicit copy ctor for classes with assignment operator
This avoids clang -Wdeprecated-copy enabled by -Wextra when building the
test.
2023-07-04 01:29:51 +02:00
Vadim Zeitlin
0f73473ae6 Update Scintilla submodules to avoid warnings with -Wextra
No real changes, just suppress some warnings (that we don't really care
about as we won't be fixing warnings in 3rd party code anyhow).
2023-07-04 01:25:03 +02:00
Vadim Zeitlin
41b61aad59 Initialize base class in copy ctor in the other ports too
This was already done in wxGTK, do it in wxX11 and wxQt too as not doing
it triggers a (not very useful, but not completely specious) warning
when -Wextra is in effect.
2023-07-04 01:24:43 +02:00
Vadim Zeitlin
3b0aecf254 Disable missing initializers warnings in wxGTK webview code
Just suppress the warnings, this is better than specifying useless
initializers.
2023-07-03 21:25:48 +02:00
Vadim Zeitlin
b692eaa112 Avoid missing initializer warnings in wxrc
Just suppress the warnings because adding all the missing initializers
would make the command line initialization less readable for no real
gain.
2023-07-03 20:55:18 +02:00
Vadim Zeitlin
6881109a22 Avoid always true comparison in wxThread::SetPriority()
Don't compare unsigned priority value with wxPRIORITY_MIN which is 0,
this is useless and results in -Wtype-limits enabled by -Wextra.
2023-07-03 20:55:18 +02:00
Vadim Zeitlin
c2de3b1a5e Rewrite generic wxPaletteRefData to use vector
Don't bother with manual memory allocation of palette entries, just
store them in a vector.

No real changes.
2023-07-03 20:55:18 +02:00
Vadim Zeitlin
4ff436ecc1 Fix xkb_rule_names struct initializer
Use "{}" to initialize all struct fields to the default values instead
of "{0}" which only initializes the first of them.

This also fixes a warning given when building with -Wextra.
2023-07-03 20:51:09 +02:00
Vadim Zeitlin
aa77eb91b0 Add new test GIF image to CMake builds too
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.
2023-07-03 20:20:52 +02:00
Reza Karimi
a9d2a14090 Invalidate wxOwnerDrawnComboBox best size after adding new items
The previously computed best size may become invalid after inserting new
items, so forget it.

Closes #23681.
2023-07-03 20:18:17 +02:00
Stefan Hansson
b84b45161a Implement wxRB_SINGLE support in wxGTK
Create hidden radio button in wxGTK when using wxRB_SINGLE, as
this lets us deactivate the shown button by activating the hidden one.
GTK does not allow deactivating radio buttons by calling them with
gtk_toggle_button_set_active( ..., FALSE), so we need to work around
it like this.

Also update the documentation to mention that this works in wxGTK now.

See #17022.

Closes #23652.

Closes #23677.
2023-07-03 20:14:32 +02:00
Vadim Zeitlin
c3bc4c16c5 Merge branch 'fix_no_intl_no_radiobtn' of https://github.com/matyalatte/wxWidgets
Fix compilation errors when wxUSE_INTL or wxUSE_RADIOBTN is off.

See #23663.
2023-07-03 20:05:49 +02:00
Vadim Zeitlin
39045e1ce5 Ignore keys with modifiers in wxNumValidatorBase
This allows to use accelerators, such as Alt-X, when the focus is on a
key control using numeric validator in wxGTK.
2023-07-02 22:43:15 +02:00
Vadim Zeitlin
67f634dfc4 Don't normalize the value of empty text control on focus loss
This is unexpected, as just TAB-bing in and out of the control changes
its value since the recent changes to wxNumValidator.
2023-07-02 22:40:42 +02:00
Vadim Zeitlin
1c16055713 Still enforce validity on focus loss in numeric validators
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.
2023-07-02 19:13:41 +01:00
Vadim Zeitlin
dccddcdd59 Fix wrong use of WXUNUSED() in the last commit
See #12968.
2023-07-02 18:35:31 +01:00
Vadim Zeitlin
c269932c4e Relax checks on character entry in numeric validators
We can't perform the check for the invalid number in IsCharOk() because
it's perfectly normal for the number to be temporarily invalid while
it's being entered and, worse, sometimes this can't be avoided at all
and the existing behaviour prevented the user from entering _anything_
into a control limited to the values between 10 and 20.

See #23561.

Closes #12968.
2023-07-02 18:27:22 +01:00
Vadim Zeitlin
c2e5749443 Fix crash when reading truncated GIF image
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>
2023-07-02 18:06:03 +01:00
Vadim Zeitlin
e5e37d9878 Add link to the binaries instructions to the release notes
Although the release notes themselves partially repeat the information
there, the manual is more complete, so still link to it.
2023-06-30 17:55:34 +02:00
matyalatte
77e825f89e fix compilation errors when wxUSE_INTL is off 2023-06-30 23:31:52 +09:00
Vadim Zeitlin
3bd5063886 Slightly clarify the code in wxBitmapDataObject::GetDataSize()
The change of 675728e1c0 (Fix crash when using wxDataObjectComposite
with bitmap in wxMSW, 2023-06-20) forgot to replace GetBitmap() call
with the local variable -- even if GetBitmap() returns the same thing,
as this local variable is just a reference to the member one which it
returns, it's more clear to use it here directly instead of using this
function and it was already done like this in GetDataHere(), so this is
also more consistent.
2023-06-30 00:30:53 +01:00
Vadim Zeitlin
b882eb96c3 Ensure CMake tests don't fail due to -Werror being used
Disable warnings while compiling the tests to avoid unnecessary noise in
the CMake output/error files (because we don't really care about
warnings in the test code at all) and also, and more importantly, to
ensure that the tests don't fail even when -Werror is specified in the
CMAKE_CXX_FLAGS globally, as it may happen when wxWidgets is used via
add_subdirectory() from a superproject.

See #23665.
2023-06-30 00:26:58 +01:00
Vadim Zeitlin
f072544bd5 Assume sigaction::sa_handler always takes "int"
This is the standard and there doesn't seem to be any contemporary
systems where this is not the case. The configure check for it was
originally added in 101c20d554 (attempting to fix sa_handler signature
for IRIX, 2000-04-01), but IRIX is not supported/doesn't exist any
longer, so don't waste time on checking for this.

The real motivation for this change is that the test failed in CMake
builds, showing just

-- Performing Test wxTYPE_SA_HANDLER_IS_INT - Failed

in the log and then resulting in -fpermissive warnings when assigning
wxFatalSignalHandler to sa_handler and it's simpler to just remove the
check than to debug it.

See #23664.
2023-06-30 00:26:19 +01:00
Vadim Zeitlin
4cd8869218 Merge branch 'html-dataobj-mem-fix'
Fix problems flagged by ASAN in clipboard/data object code and improve
wxMSW HTML data object.

See #23661.
2023-06-30 00:24:52 +01:00
Vadim Zeitlin
de0595108a Merge branch 'bmp-dataobj-fix'
Fix crash when using wxDataObjectComposite and other clipboard-related
cleanup.

See #23659.
2023-06-30 00:20:12 +01:00
Vadim Zeitlin
0e14cf19d1 Merge branch 'border-fixes'
Various border-related fixes for wxMSW.

See #23644.
2023-06-30 00:19:00 +01:00
Konstantin Bolshakov
691adc8241 Document wxDataViewCheckIconText
This will make wrapping it in wxPython easier.

Closes #23668.

Closes #23669.
2023-06-27 23:41:46 +02:00
Ian McInerney
7669a7e1bd Document already existing wxPrintPreview::GetZoom function
This base function was added over 16 years ago but never documented.

Closes #23667.
2023-06-27 19:21:39 +02:00
taler21
eae24cc3b2 Fix bitmap returned from wxAuiToolBarItem::GetDisabledBitmap()
Return the disabled bitmap and not the normal one.

This fixes a regression introduced in 9a5123afed (Use wxBitmapBundle in
wxAuiToolBar and wxAuiPaneInfo too, 2021-11-14).

Closes #23666.
2023-06-27 19:16:40 +02:00
matyalatte
4d8e3399cf fix compilation errors for wxFileDialog when wxUSE_RADIOBTN is off
fix compilation errors when wxUSE_RADIOBTN, wxUSE_RADIOBOX,
wxUSE_RICHTEXT, and wxUSE_PRINTING_ARCHITECTURE are off.
2023-06-23 02:50:37 +09:00
Vadim Zeitlin
72c5691d2f Fix buffer overrun in wxHTMLDataObject under non-MSW platforms
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>
2023-06-21 20:38:25 +01:00
Vadim Zeitlin
e4bec18505 Compute exact length needed for CF_HTML contents
Instead of just adding 400 and leaving unused and uninitialized data in
the clipboard data, compute exactly the size of the data we need.

Also replace multiple strlen() calls that are not really needed because
we already know the various lengths.

Still NUL-terminate clipboard data because everybody else does it, even
if it's not totally clear if it is required.
2023-06-21 20:38:25 +01:00
Vadim Zeitlin
c7d414bbed Make HTML pasting code more robust and efficient
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.
2023-06-21 20:38:25 +01:00
Vadim Zeitlin
355db874bc Fix offsets in HTML copied to clipboard
Notable use the correct value for StartFragment: header which must
contain the start of the HTML fragment data and not the start of
"<--StartFragment-->" comment.

Also make this code simpler and more efficient by remembering the
offsets as we're creating the string instead of using strstr() to find
them later.
2023-06-21 20:38:25 +01:00
Vadim Zeitlin
93729d8875 Remove extra new lines from HTML copied to clipboard
No other program does it and having these extra new lines means that our
own GetData() returns extra new lines compared to the value passed to
SetData().
2023-06-21 20:24:39 +01:00
Vadim Zeitlin
ede59ecb16 Add a symbolic constant for the offsets lengths too
Get rid of the last hardcoded number in CF_HTML code.
2023-06-21 20:24:39 +01:00
Vadim Zeitlin
649843a646 Use symbolic constants in CF_HTML-related code
No real changes, just use constants instead of a bunch of hardcoded
strings and numbers.
2023-06-21 20:24:39 +01:00
Vadim Zeitlin
1cf83980a2 Refactor wxHTMLDataObject to keep wxMSW-specific parts together
Also add a link to the official CF_HTML format documentation.

No real changes, just prepare for further ones.
2023-06-21 20:24:34 +01:00
Vadim Zeitlin
b52728a62a Fix memory leak of wxClipboard data on exit
When wxClipboard is destroyed as part of the program shutdown,
gdk_selection_owner_get() doesn't return our clipboard widget as owner
any more, so we don't reset the owner when Clear() is called and hence
never free the data.

Do it explicitly if we don't have clipboard ownership in Clear() any
longer to avoid memory leaks -- even though they are mostly harmless (as
they happen only once, on exit), they still show up in LSAN and similar
tools reports.
2023-06-21 18:19:15 +01:00
Brian Nixon
e1e2e982e3 Restore old delta-RLE bitmap background setting
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.
2023-06-20 22:19:47 +02:00
Vadim Zeitlin
b9fd9c7c8e Merge branch 'about-dialog-compat'
Restore compatibility with the existing code using custom controls in
the "About" dialog.

See #23658.
2023-06-20 22:15:17 +02:00