Work around the problem which was previously hidden by 07dfc18cc0
(Disable wxWebView in ASAN CI build, 2021-01-31) by building the webkit
extension shared library without ASAN.
This should ideally be handled at the build system level, but this seems
difficult to do, so use this hack for now -- it at least ensures that
wxWebView unit tests are tested with ASAN too.
(cherry picked from commit 8ee559430b11008ec3825d8470aa281808091b37)
Define HAVE_LARGEFILE_SUPPORT and add '_FILE_OFFSET_BITS=64' compile definition.
Make it a PUBLIC definition so it is part of the interface, and defined when importing a target.
Check if fseeko is available, which is used in the large file code.
Also add the compile definition to wxconfig's cppflags, because configure does this too.
Large file support can be disabled with the wxBUILD_LARGEFILE_SUPPORT option, similar to configure's --disable-largefile.
Fixes#22750
(cherry picked from commit 1051dfd1410673a25a767fb3b448c858f493108a)
Compilation with wxUSE_VALIDATORS==0 would have failed after the recent
changes, so fix this by adding the missing check.
See #23312.
(cherry picked from commit 623591823d503a46a843503c126d2bfc542fef3f)
Replace -1 with wxCOL_WIDTH_DEFAULT in the header and the documentation
for clarity.
See #23307, #23325.
(cherry picked from commit cf3dcb230a009c6748dc9eb986df805edfac84b4)
Ubuntu 18.04 runner environment is being deprecated, so use a container
running inside the latest Ubuntu runner environment instead.
This is a combined cherry-pick of several commits merged into master as
part of e6dfd9748f (Merge branch 'ci-use-containers', 2022-10-10)
excluding those removing pre-C++11 support, which is still needed in
this branch.
Explain the special meaning of 0 and negative values in this function.
See #23299.
(cherry picked from commit 809d2918ccd01ac029ff3d0bc3a143c140832862)
In the process of fixing #22374 by using native best sizes, empty fields
were getting a small, but positive best width, this broke the trigger
for using default widths for empty fields, so fix this by checking that
the width is big enough and not just zero in DoGetSizeFromTextSize().
See #23295, #23250.
(cherry picked from commit fa23d607e9332e884d4ba835cf97c8b954f59cc0)
Don't set it to avoid overriding the "clear background" used for shaped
windows.
Closes#23286.
See #23296.
(cherry picked from commit e49b791ca9a093927e0b06bf3794e32fef0cb644)
There is no real need to document this, it's not a valid enum value and
having it in this file without a trailing comma was a syntax error.
Closes#23298.
(cherry picked from commit 5b6b644e8bcb5b9503ff1a5fb49b2db768cb625c)
The call to wxNativeFontInfo::InitFromFont(), added to
wxFontRefData::Alloc() in 74c0fe6dcc (Serialize font style correctly in
Mac wxNativeFontInfo, 2022-04-28), lost the existing values of the
underline and strike-through attributes that are not represented by
CTFont and so resulted in some underlined fonts being actually rendered
without underline.
Fix this by explicitly preserving and restoring these attributes before
and after calling InitFromFont().
Also remove the unneeded assignment to m_info, as InitFromFont() already
fully reinitializes it anyhow.
See #23264.
(cherry picked from commit 8b5f0493151f1b74180021256e3ee4b6b2617e9e)
Use GetCanonicalWithRegion() (instead of LocaleTag) in the Windows
implementation of method wxLanguageInfo::TrySetLocale() -- as is done in
the non-Windows implementation of this method -- and to ensure that we
use the correct "uk-UA" for Ukrainian instead of the wrong (because
conflicting with the UK English) "uk".
See #23269.
Closes#23210.
(cherry picked from commit a0be352a3f95253dde0de952fb41f7157ebd1840)
Index of edited item can be retrieved from wxListEvent (is set by
associated wxListCtrl in wxEVT_LIST_END_LABEL_EDIT) and there is no reason
to determine it in a alternative way (what can be problematic).
See #23272.
(cherry picked from commit 5704b87152c10c685569b646bc59b55acccc06d4)
Fix building with wxUSE_SOCKETS==0 and avoid deprecation warnings when
using newer libcurl.
See #23257.
(cherry picked from commit f45024134384ecf36647ddc1a6b7b8a9a26de063)
Setting wxFLEX_GROWMODE_ALL for the non-flexible direction broke
handling of proportions in the flexible direction which were
unexpectedly not taken into account at all any more due to not passing
them to DoAdjustForGrowables().
Fix this by still respecting the proportions in this case and add a test
case to ensure this doesn't get broken again.
See #23251, #23253.
(cherry picked from commit 6bfabd7afe16ed734565635228d540cb47b16970)
Keep using just the first three components of the version if
wxSUBRELEASE_NUMBER is 0, but do add it to the version if it isn't, to
allow distinguishing x.y.z releases from x.y.z.w hot-fixes.
(cherry picked from commit cb41471093a4b43f69aaa59557ffef7e81689849)
Pass the current composition mode to wxOSXDrawNSImage() instead of
always using NSCompositeSourceOver in it.
See #23240, #23245.
(cherry picked from commit e269245b97ced95f60b11fb7ea988a3f7a993e7f with
some extra changes for ABI compatibility in 3.2)
This correctly shows the version of the library being actually used when
using shared/dynamic libraries, rather than showing the version of the
library that the sample was compiled against.
Fix y coordinate value passed to wxDC::DrawBitmap() by restoring the
parentheses accidentally removed in 6dd4e73ea3 (Add wxDrawImageBitmap()
helper and use it in wx{List,Tree}Ctrl, 2022-10-25).
(cherry picked from commit 2a13fd238ea499a3e4b089f3ca3a327e94ddb4d9)
See #23255.
Backport locale-related improvements from master to 3.2 branch, notably
fixing handling of "mixed" locales, with the region not matching its
usual language, under Mac.
This cherry-picks all commits merged into master in c4b71b3694 (Merge
branch 'default-locale-improve', 2023-02-08) except for 1cf59d345b
(Remove fallback on locale using different region under Unix,
2023-02-07) which results in a behaviour change that might not be
desired and so is omitted out of abundance of caution.
See #23119, #23147, #23226, #23114.
LC_MESSAGES should only be used for getting the translations language,
so using GetLocaleFromEnvironment(), which uses its value if LC_ALL was
not set, in wxUILocaleImplUnix::InitLocaleNameAndCodeset() was wrong for
the cases when we did call it from there, i.e. when not using glibc and
so _NL_LOCALE_NAME is not defined.
Correct this by replacing GetLocaleFromEnvironment() querying all
environment variables at once with GetLocaleFromEnvVar() getting the
value from just the one environment variable specified by caller and
not calling it for LC_MESSAGES from InitLocaleNameAndCodeset().
See #23217.
(cherry picked from commit db14662116fbf433c928b0caedc1bcde54e72436)
This was broken by the recent changes, so fix it again: we do still want
to return wxLANGUAGE_ENGLISH_US for this particular locale.
(cherry picked from commit 3dfe253d3cf7f8e1bfba6b2cdb3f53628aa224df)
Don't always "succeed" in wxUILocale::UseDefault() and, consequently, in
wxLocale::Init(wxLANGUAGE_DEFAULT), under Unix systems, even if the
locale couldn't actually be set, as it can happen if the environment
variables contain a locale which is not supported on the current system,
e.g. a "mixed" locale such as "en_FR", or even a completely invalid
string such as "bloordyblop", which still used to succeed.
For now only fix it for reasonably modern systems with locale_t support,
it could be done even for the ancient ones without it later too if
anybody still cares about them.
See #23218.
(cherry picked from commit 2ca76449bf636b58b72fccbe5dea485b241d692d)
This function must be used for setting the default CRT locale only and
we can't request arbitrary locales support from it under Mac as it
doesn't support any kind of mixed locales, such as "en-FR".
We do support them in wxUILocale, and calling wxUILocale::UseDefault()
from wxLocale::Init(wxLANGUAGE_DEFAULT) actually worked, but then this
function failed because wxSetlocale(LC_ALL, "") did not work for such
locales.
Fix this simply by removing Mac-specific code from this function.
This makes wxLocale::Init(wxLANGUAGE_DEFAULT) work as well as it ever
can under Mac.
(cherry picked from commit 856c0371faaf17c735efabc7708e79b68e00aaf2)
Use [NSLocale systemLocale] instead of trying to create a locale with
the name "C" which just fails and doesn't create any NSLocale at all.
If nothing else, this makes the behaviour of wxUILocale::GetCurrent()
consistent on all platforms as its GetLocaleId() now returns "C"
everywhere.
(cherry picked from commit e3146f9ac078f6095e6c93651583fcba5fd3feb2)
This function replaces the existing GetSystemLocale() as it can
represent the locales that don't have any corresponding wxLanguage
values and for which GetSystemLocale() has no choice but to return
wxLANGUAGE_UNKNOWN.
(cherry picked from commit 14714856b3956d52ede8bcf27345fdc6efd438e9)
After the changes of the previous commit, GetSystemLocale() started
returning the language, found as due to the fallback logic implemented
in FindLanguageInfo(), for mixed locales, e.g. it would return English
for en_FR which is wrong as the actual locale is rather the French one,
using decimal comma and not period in this case.
Make it always return wxLANGUAGE_UNKNOWN for the mixed locales for now.
(cherry picked from commit 9f2a416f81f76ae23b1f1bc5644c5918c2593b43)
When looking for the language information, we must recognize the
language independently of the region it is followed by, so en_FR is
still English and fr_DE is still French, even if the full locale is
unknown, but this wasn't the case before.
Fix this by comparing the language part of wxLanguageInfo with just the
language of wxLocaleIdent we're trying to match, instead of comparing it
with its full BCP47 tag, which is never going to match.
(cherry picked from commit c13b3645a8825d43b48d60ad297141827b71dad6)
Previously, if LANGUAGE was set, the other locale-related environment
variables (LC_ALL, LC_MESSAGES, LANG) were simply ignored, which seems
wrong as the user running the program after explicitly setting LC_ALL
expects it to use this locale and not en_US from the default value of
LANGUAGE on a typical Linux system using English.
So handle LANGUAGE as a source of supplementary information, but still
honour all the other environment variables. This goes against an
explicit GNU gettext manual recommendation, but this recommendation
seems to only make sense in the usual case, when the first element of
LANGUAGE is the same as LC_ALL/LANG value, but not when they differ.
See #23146.
(cherry picked from commit 98a9cd06880e10627868df5d11b97578ba18abca)