wxQt: Suppress the selection event on first display of wxListCtrl Since the wxEVT_LIST_ITEM_SELECTED event is not generated in the other ports when the wxListCtrl is shown for the first time, do not generate it under wxQt for consistency. Closes #26194.
Change return type of wxGetTranslation Change it from 'const wxString&' to just 'wxString' so there is no need to keep a copy around of untranslated strings. This allows to remove thread_local UntranslatedStringHolder used by GetUntranslatedString, which causes many problems with MinGW. Fixes #26195.
Fix building with wxUSE_INTL disabled
Merge branch 'wxtranslations-return-type' of github.com:MaartenBent/wxWidgets Return wxString object instead of reference from wxGetTranslation() to avoid having to store copies of all untranslated strings, which resulted in problems with MinGW that don't exist any more after this change. See #25928, #25897, #26196.
| ... | ... | @@ -210,16 +210,16 @@ public: |
| 210 | 210 | //
|
| 211 | 211 | // domains are searched in the last to first order, i.e. catalogs
|
| 212 | 212 | // added later override those added before.
|
| 213 | - const wxString& GetString(const wxString& origString,
|
|
| 214 | - const wxString& domain = wxEmptyString) const
|
|
| 213 | + wxString GetString(const wxString& origString,
|
|
| 214 | + const wxString& domain = wxEmptyString) const
|
|
| 215 | 215 | {
|
| 216 | 216 | return wxGetTranslation(origString, domain);
|
| 217 | 217 | }
|
| 218 | 218 | // plural form version of the same:
|
| 219 | - const wxString& GetString(const wxString& origString,
|
|
| 220 | - const wxString& origString2,
|
|
| 221 | - unsigned n,
|
|
| 222 | - const wxString& domain = wxEmptyString) const
|
|
| 219 | + wxString GetString(const wxString& origString,
|
|
| 220 | + const wxString& origString2,
|
|
| 221 | + unsigned n,
|
|
| 222 | + const wxString& domain = wxEmptyString) const
|
|
| 223 | 223 | {
|
| 224 | 224 | return wxGetTranslation(origString, origString2, n, domain);
|
| 225 | 225 | }
|
| ... | ... | @@ -10,6 +10,8 @@ |
| 10 | 10 | #ifndef _WX_MSW_PRIVATE_UILOCALE_H_
|
| 11 | 11 | #define _WX_MSW_PRIVATE_UILOCALE_H_
|
| 12 | 12 | |
| 13 | +#if wxUSE_INTL
|
|
| 14 | + |
|
| 13 | 15 | #include "wx/msw/private.h" // Include <windows.h> to get LCID.
|
| 14 | 16 | |
| 15 | 17 | #ifndef LOCALE_SNAME
|
| ... | ... | @@ -23,4 +25,6 @@ WXDLLIMPEXP_BASE wxString wxTranslateFromUnicodeFormat(const wxString& fmt); |
| 23 | 25 | |
| 24 | 26 | WXDLLIMPEXP_BASE wxString wxGetMSWDateTimeFormat(wxLocaleInfo index);
|
| 25 | 27 | |
| 28 | +#endif // wxUSE_INTL
|
|
| 29 | + |
|
| 26 | 30 | #endif // _WX_MSW_PRIVATE_UILOCALE_H_ |
| ... | ... | @@ -10,6 +10,8 @@ |
| 10 | 10 | #ifndef _WX_PRIVATE_UILOCALE_H_
|
| 11 | 11 | #define _WX_PRIVATE_UILOCALE_H_
|
| 12 | 12 | |
| 13 | +#if wxUSE_INTL
|
|
| 14 | + |
|
| 13 | 15 | #include "wx/localedefs.h"
|
| 14 | 16 | #include "wx/object.h"
|
| 15 | 17 | #include "wx/string.h"
|
| ... | ... | @@ -145,4 +147,6 @@ public: |
| 145 | 147 | static bool SameRegionGroup(const wxString& language, const wxString& desiredRegion, const wxString& supportedRegion);
|
| 146 | 148 | };
|
| 147 | 149 | |
| 150 | +#endif // wxUSE_INTL
|
|
| 151 | + |
|
| 148 | 152 | #endif // _WX_PRIVATE_UILOCALE_H_ |
| ... | ... | @@ -179,10 +179,11 @@ public: |
| 179 | 179 | wxString GetHeaderValue(const wxString& header,
|
| 180 | 180 | const wxString& domain = wxEmptyString) const;
|
| 181 | 181 | |
| 182 | - // this is hack to work around a problem with wxGetTranslation() which
|
|
| 183 | - // returns const wxString& and not wxString, so when it returns untranslated
|
|
| 184 | - // string, it needs to have a copy of it somewhere
|
|
| 185 | - static const wxString& GetUntranslatedString(const wxString& str);
|
|
| 182 | + |
|
| 183 | + wxDEPRECATED_INLINE(
|
|
| 184 | + static const wxString& GetUntranslatedString(const wxString& str),
|
|
| 185 | + return str;
|
|
| 186 | + )
|
|
| 186 | 187 | |
| 187 | 188 | private:
|
| 188 | 189 | enum class Translations
|
| ... | ... | @@ -274,9 +275,9 @@ protected: |
| 274 | 275 | // ----------------------------------------------------------------------------
|
| 275 | 276 | |
| 276 | 277 | // get the translation of the string in the current locale
|
| 277 | -inline const wxString& wxGetTranslation(const wxString& str,
|
|
| 278 | - const wxString& domain = wxString(),
|
|
| 279 | - const wxString& context = wxString())
|
|
| 278 | +inline wxString wxGetTranslation(const wxString& str,
|
|
| 279 | + const wxString& domain = wxString(),
|
|
| 280 | + const wxString& context = wxString())
|
|
| 280 | 281 | {
|
| 281 | 282 | wxTranslations *trans = wxTranslations::Get();
|
| 282 | 283 | const wxString *transStr = trans ? trans->GetTranslatedString(str, domain, context)
|
| ... | ... | @@ -284,16 +285,14 @@ inline const wxString& wxGetTranslation(const wxString& str, |
| 284 | 285 | if ( transStr )
|
| 285 | 286 | return *transStr;
|
| 286 | 287 | else
|
| 287 | - // NB: this function returns reference to a string, so we have to keep
|
|
| 288 | - // a copy of it somewhere
|
|
| 289 | - return wxTranslations::GetUntranslatedString(str);
|
|
| 288 | + return str;
|
|
| 290 | 289 | }
|
| 291 | 290 | |
| 292 | -inline const wxString& wxGetTranslation(const wxString& str1,
|
|
| 293 | - const wxString& str2,
|
|
| 294 | - unsigned n,
|
|
| 295 | - const wxString& domain = wxString(),
|
|
| 296 | - const wxString& context = wxString())
|
|
| 291 | +inline wxString wxGetTranslation(const wxString& str1,
|
|
| 292 | + const wxString& str2,
|
|
| 293 | + unsigned n,
|
|
| 294 | + const wxString& domain = wxString(),
|
|
| 295 | + const wxString& context = wxString())
|
|
| 297 | 296 | {
|
| 298 | 297 | wxTranslations *trans = wxTranslations::Get();
|
| 299 | 298 | const wxString *transStr = trans ? trans->GetTranslatedString(str1, n, domain, context)
|
| ... | ... | @@ -301,11 +300,7 @@ inline const wxString& wxGetTranslation(const wxString& str1, |
| 301 | 300 | if ( transStr )
|
| 302 | 301 | return *transStr;
|
| 303 | 302 | else
|
| 304 | - // NB: this function returns reference to a string, so we have to keep
|
|
| 305 | - // a copy of it somewhere
|
|
| 306 | - return n == 1
|
|
| 307 | - ? wxTranslations::GetUntranslatedString(str1)
|
|
| 308 | - : wxTranslations::GetUntranslatedString(str2);
|
|
| 303 | + return n == 1 ? str1 : str2;
|
|
| 309 | 304 | }
|
| 310 | 305 | |
| 311 | 306 | #ifdef wxNO_IMPLICIT_WXSTRING_ENCODING
|
| ... | ... | @@ -314,19 +309,20 @@ inline const wxString& wxGetTranslation(const wxString& str1, |
| 314 | 309 | * It must always be possible to call wxGetTranslation() with const
|
| 315 | 310 | * char* arguments.
|
| 316 | 311 | */
|
| 317 | -inline const wxString& wxGetTranslation(const char *str,
|
|
| 318 | - const char *domain = "",
|
|
| 319 | - const char *context = "") {
|
|
| 312 | + |
|
| 313 | +inline wxString wxGetTranslation(const char *str,
|
|
| 314 | + const char *domain = "",
|
|
| 315 | + const char *context = "") {
|
|
| 320 | 316 | const wxMBConv &conv = wxConvWhateverWorks;
|
| 321 | 317 | return wxGetTranslation(wxString(str, conv), wxString(domain, conv),
|
| 322 | 318 | wxString(context, conv));
|
| 323 | 319 | }
|
| 324 | 320 | |
| 325 | -inline const wxString& wxGetTranslation(const char *str1,
|
|
| 326 | - const char *str2,
|
|
| 327 | - unsigned n,
|
|
| 328 | - const char *domain = "",
|
|
| 329 | - const char *context = "") {
|
|
| 321 | +inline wxString wxGetTranslation(const char *str1,
|
|
| 322 | + const char *str2,
|
|
| 323 | + unsigned n,
|
|
| 324 | + const char *domain = "",
|
|
| 325 | + const char *context = "") {
|
|
| 330 | 326 | const wxMBConv &conv = wxConvWhateverWorks;
|
| 331 | 327 | return wxGetTranslation(wxString(str1, conv), wxString(str2, conv), n,
|
| 332 | 328 | wxString(domain, conv),
|
| ... | ... | @@ -383,7 +379,7 @@ inline wxString wxTRANS_INPUT_STR(const wchar_t* s) |
| 383 | 379 | */
|
| 384 | 380 | |
| 385 | 381 | template<size_t N, typename T>
|
| 386 | -const wxString& wxUnderscoreWrapper(const T (&msg)[N])
|
|
| 382 | +wxString wxUnderscoreWrapper(const T (&msg)[N])
|
|
| 387 | 383 | {
|
| 388 | 384 | return wxGetTranslation(wxTRANS_INPUT_STR(msg));
|
| 389 | 385 | }
|
| ... | ... | @@ -396,9 +392,9 @@ wxString wxUnderscoreWrapper(T) |
| 396 | 392 | }
|
| 397 | 393 | |
| 398 | 394 | template<size_t M, size_t N, typename T>
|
| 399 | -const wxString& wxPluralWrapper(const T (&msg)[M],
|
|
| 400 | - const T (&plural)[N],
|
|
| 401 | - int count)
|
|
| 395 | +wxString wxPluralWrapper(const T (&msg)[M],
|
|
| 396 | + const T (&plural)[N],
|
|
| 397 | + int count)
|
|
| 402 | 398 | {
|
| 403 | 399 | return wxGetTranslation(wxTRANS_INPUT_STR(msg), wxTRANS_INPUT_STR(plural),
|
| 404 | 400 | count);
|
| ... | ... | @@ -412,8 +408,8 @@ wxString wxPluralWrapper(T, U, int) |
| 412 | 408 | }
|
| 413 | 409 | |
| 414 | 410 | template<size_t M, size_t N, typename T>
|
| 415 | -const wxString& wxGettextInContextWrapper(const T (&ctx)[M],
|
|
| 416 | - const T (&msg)[N])
|
|
| 411 | +wxString wxGettextInContextWrapper(const T (&ctx)[M],
|
|
| 412 | + const T (&msg)[N])
|
|
| 417 | 413 | {
|
| 418 | 414 | return wxGetTranslation(wxTRANS_INPUT_STR(msg), wxString(),
|
| 419 | 415 | wxTRANS_INPUT_STR(ctx));
|
| ... | ... | @@ -427,10 +423,10 @@ wxString wxGettextInContextWrapper(T, U) |
| 427 | 423 | }
|
| 428 | 424 | |
| 429 | 425 | template<size_t L, size_t M, size_t N, typename T>
|
| 430 | -const wxString& wxGettextInContextPluralWrapper(const T (&ctx)[L],
|
|
| 431 | - const T (&msg)[M],
|
|
| 432 | - const T (&plural)[N],
|
|
| 433 | - int count)
|
|
| 426 | +wxString wxGettextInContextPluralWrapper(const T (&ctx)[L],
|
|
| 427 | + const T (&msg)[M],
|
|
| 428 | + const T (&plural)[N],
|
|
| 429 | + int count)
|
|
| 434 | 430 | {
|
| 435 | 431 | return wxGetTranslation(wxTRANS_INPUT_STR(msg), wxTRANS_INPUT_STR(plural),
|
| 436 | 432 | count, wxString(), wxTRANS_INPUT_STR(ctx));
|
| ... | ... | @@ -447,30 +443,30 @@ wxString wxGettextInContextPluralWrapper(T, U, V, int) |
| 447 | 443 | |
| 448 | 444 | // Wrapper functions that accept both string literals and variables
|
| 449 | 445 | // as arguments.
|
| 450 | -inline const wxString& wxUnderscoreWrapper(const char *msg)
|
|
| 446 | +inline wxString wxUnderscoreWrapper(const char *msg)
|
|
| 451 | 447 | {
|
| 452 | 448 | return wxGetTranslation(wxTRANS_INPUT_STR(msg));
|
| 453 | 449 | }
|
| 454 | 450 | |
| 455 | -inline const wxString& wxPluralWrapper(const char *msg,
|
|
| 456 | - const char *plural,
|
|
| 457 | - int count)
|
|
| 451 | +inline wxString wxPluralWrapper(const char *msg,
|
|
| 452 | + const char *plural,
|
|
| 453 | + int count)
|
|
| 458 | 454 | {
|
| 459 | 455 | return wxGetTranslation(wxTRANS_INPUT_STR(msg), wxTRANS_INPUT_STR(plural),
|
| 460 | 456 | count);
|
| 461 | 457 | }
|
| 462 | 458 | |
| 463 | -inline const wxString& wxGettextInContextWrapper(const char *ctx,
|
|
| 464 | - const char *msg)
|
|
| 459 | +inline wxString wxGettextInContextWrapper(const char *ctx,
|
|
| 460 | + const char *msg)
|
|
| 465 | 461 | {
|
| 466 | 462 | return wxGetTranslation(wxTRANS_INPUT_STR(msg), wxString(),
|
| 467 | 463 | wxTRANS_INPUT_STR(ctx));
|
| 468 | 464 | }
|
| 469 | 465 | |
| 470 | -inline const wxString& wxGettextInContextPluralWrapper(const char *ctx,
|
|
| 471 | - const char *msg,
|
|
| 472 | - const char *plural,
|
|
| 473 | - int count)
|
|
| 466 | +inline wxString wxGettextInContextPluralWrapper(const char *ctx,
|
|
| 467 | + const char *msg,
|
|
| 468 | + const char *plural,
|
|
| 469 | + int count)
|
|
| 474 | 470 | {
|
| 475 | 471 | return wxGetTranslation(wxTRANS_INPUT_STR(msg), wxTRANS_INPUT_STR(plural),
|
| 476 | 472 | count, wxString(), wxTRANS_INPUT_STR(ctx));
|
| ... | ... | @@ -494,15 +494,15 @@ public: |
| 494 | 494 | /**
|
| 495 | 495 | Calls wxGetTranslation(const wxString&, const wxString&).
|
| 496 | 496 | */
|
| 497 | - const wxString& GetString(const wxString& origString,
|
|
| 498 | - const wxString& domain = wxEmptyString) const;
|
|
| 497 | + wxString GetString(const wxString& origString,
|
|
| 498 | + const wxString& domain = wxEmptyString) const;
|
|
| 499 | 499 | |
| 500 | 500 | /**
|
| 501 | 501 | Calls wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&).
|
| 502 | 502 | */
|
| 503 | - const wxString& GetString(const wxString& origString,
|
|
| 504 | - const wxString& origString2, unsigned n,
|
|
| 505 | - const wxString& domain = wxEmptyString) const;
|
|
| 503 | + wxString GetString(const wxString& origString,
|
|
| 504 | + const wxString& origString2, unsigned n,
|
|
| 505 | + const wxString& domain = wxEmptyString) const;
|
|
| 506 | 506 | |
| 507 | 507 | /**
|
| 508 | 508 | Returns current platform-specific locale name as passed to setlocale().
|
| ... | ... | @@ -612,9 +612,9 @@ public: |
| 612 | 612 | |
| 613 | 613 | @header{wx/intl.h}
|
| 614 | 614 | */
|
| 615 | -const wxString& wxGetTranslation(const wxString& string,
|
|
| 616 | - const wxString& domain = wxEmptyString,
|
|
| 617 | - const wxString& context = wxEmptyString);
|
|
| 615 | +wxString wxGetTranslation(const wxString& string,
|
|
| 616 | + const wxString& domain = wxEmptyString,
|
|
| 617 | + const wxString& context = wxEmptyString);
|
|
| 618 | 618 | |
| 619 | 619 | /**
|
| 620 | 620 | This is an overloaded version of
|
| ... | ... | @@ -638,10 +638,10 @@ const wxString& wxGetTranslation(const wxString& string, |
| 638 | 638 | |
| 639 | 639 | @header{wx/intl.h}
|
| 640 | 640 | */
|
| 641 | -const wxString& wxGetTranslation(const wxString& string,
|
|
| 642 | - const wxString& plural, unsigned n,
|
|
| 643 | - const wxString& domain = wxEmptyString,
|
|
| 644 | - const wxString& context = wxEmptyString);
|
|
| 641 | +wxString wxGetTranslation(const wxString& string,
|
|
| 642 | + const wxString& plural, unsigned n,
|
|
| 643 | + const wxString& domain = wxEmptyString,
|
|
| 644 | + const wxString& context = wxEmptyString);
|
|
| 645 | 645 | |
| 646 | 646 | /**
|
| 647 | 647 | Macro to be used around all literal strings that should be translated.
|
| ... | ... | @@ -173,6 +173,8 @@ void wxNumberFormatter::AddThousandsSeparators(wxString& s, int style) |
| 173 | 173 | grouping = numForm.grouping;
|
| 174 | 174 | decimalSeparator = numForm.decimalSeparator;
|
| 175 | 175 | }
|
| 176 | +#else
|
|
| 177 | + wxUnusedVar(style);
|
|
| 176 | 178 | #endif // wxUSE_INTL
|
| 177 | 179 | |
| 178 | 180 | if (groupingSeparator.empty() )
|
| ... | ... | @@ -320,8 +322,8 @@ void wxNumberFormatter::AddCurrency(wxString& s, int style) |
| 320 | 322 | }
|
| 321 | 323 | }
|
| 322 | 324 | #else
|
| 323 | - wxUnused(s);
|
|
| 324 | - wxUnused(style);
|
|
| 325 | + wxUnusedVar(s);
|
|
| 326 | + wxUnusedVar(style);
|
|
| 325 | 327 | #endif // wxUSE_INTL
|
| 326 | 328 | }
|
| 327 | 329 | |
| ... | ... | @@ -372,7 +374,7 @@ wxString wxNumberFormatter::RemoveCurrencySymbolOrCode(wxString s, int style) |
| 372 | 374 | }
|
| 373 | 375 | return s;
|
| 374 | 376 | #else
|
| 375 | - wxUnused(style);
|
|
| 377 | + wxUnusedVar(style);
|
|
| 376 | 378 | return s;
|
| 377 | 379 | #endif // wxUSE_INTL
|
| 378 | 380 | }
|
| ... | ... | @@ -53,12 +53,7 @@ |
| 53 | 53 | #include "wx/msw/missing.h"
|
| 54 | 54 | #endif
|
| 55 | 55 | |
| 56 | -#ifdef __MINGW32__
|
|
| 57 | - #include <map>
|
|
| 58 | -#endif
|
|
| 59 | - |
|
| 60 | 56 | #include <memory>
|
| 61 | -#include <unordered_set>
|
|
| 62 | 57 | |
| 63 | 58 | // ----------------------------------------------------------------------------
|
| 64 | 59 | // simple types
|
| ... | ... | @@ -1455,97 +1450,6 @@ wxString wxTranslations::DoGetBestAvailableTranslation(const wxString& domain, c |
| 1455 | 1450 | return lang;
|
| 1456 | 1451 | }
|
| 1457 | 1452 | |
| 1458 | -namespace
|
|
| 1459 | -{
|
|
| 1460 | - |
|
| 1461 | -// We use this container to store all strings known not to have translations.
|
|
| 1462 | -// It is thread-specific to avoid using mutexes for every untranslated string
|
|
| 1463 | -// access.
|
|
| 1464 | -using UntranslatedStrings = std::unordered_set<wxString>;
|
|
| 1465 | - |
|
| 1466 | -/*
|
|
| 1467 | - As of October 2025, MinGW still has a long-standing bug in its thread_local
|
|
| 1468 | - variables implementation: their memory is de-allocated *before* their
|
|
| 1469 | - destructor is called, see https://github.com/msys2/MINGW-packages/issues/2519
|
|
| 1470 | - |
|
| 1471 | - The UntranslatedStringHolder class works around this issue, by storing data
|
|
| 1472 | - in global variables outside of this class and only relying on the dtor to
|
|
| 1473 | - be executed when any thread (not necessarily created by wxWidgets) exits to
|
|
| 1474 | - ensure that we always perform the required cleanup.
|
|
| 1475 | - */
|
|
| 1476 | -#ifdef __MINGW32__
|
|
| 1477 | - |
|
| 1478 | -class UntranslatedStringHolder
|
|
| 1479 | -{
|
|
| 1480 | -private:
|
|
| 1481 | - static wxCriticalSection ms_criticalSection;
|
|
| 1482 | - static std::map<wxThreadIdType, UntranslatedStrings> ms_setsMap;
|
|
| 1483 | - |
|
| 1484 | - // This will be set to point to an element of ms_setsMap.
|
|
| 1485 | - UntranslatedStrings* m_holder = nullptr;
|
|
| 1486 | - |
|
| 1487 | -public:
|
|
| 1488 | - UntranslatedStringHolder() = default;
|
|
| 1489 | - |
|
| 1490 | - const wxString& get(const wxString& str)
|
|
| 1491 | - {
|
|
| 1492 | - if ( m_holder == nullptr )
|
|
| 1493 | - {
|
|
| 1494 | - wxCriticalSectionLocker locker(ms_criticalSection);
|
|
| 1495 | - m_holder = &ms_setsMap[wxThread::GetCurrentId()];
|
|
| 1496 | - }
|
|
| 1497 | - |
|
| 1498 | - return *m_holder->insert(str).first;
|
|
| 1499 | - }
|
|
| 1500 | - |
|
| 1501 | - ~UntranslatedStringHolder()
|
|
| 1502 | - {
|
|
| 1503 | - // This code is run after this object memory has been deallocated so we
|
|
| 1504 | - // cannot access any member variables, but we can access global ones.
|
|
| 1505 | - wxCriticalSectionLocker locker(ms_criticalSection);
|
|
| 1506 | - ms_setsMap.erase(wxThread::GetCurrentId());
|
|
| 1507 | - }
|
|
| 1508 | - |
|
| 1509 | - wxDECLARE_NO_COPY_CLASS(UntranslatedStringHolder);
|
|
| 1510 | -};
|
|
| 1511 | - |
|
| 1512 | -wxCriticalSection UntranslatedStringHolder::ms_criticalSection;
|
|
| 1513 | - |
|
| 1514 | -std::map<wxThreadIdType, UntranslatedStrings> UntranslatedStringHolder::ms_setsMap;
|
|
| 1515 | - |
|
| 1516 | -#else // !__MINGW32__
|
|
| 1517 | - |
|
| 1518 | -// When not using MinGW, thread_local variables to work correctly but we still
|
|
| 1519 | -// define this class, even if it's trivial, to use the same code below.
|
|
| 1520 | -class UntranslatedStringHolder
|
|
| 1521 | -{
|
|
| 1522 | -private:
|
|
| 1523 | - UntranslatedStrings m_holder;
|
|
| 1524 | - |
|
| 1525 | -public:
|
|
| 1526 | - UntranslatedStringHolder() = default;
|
|
| 1527 | - |
|
| 1528 | - const wxString& get(const wxString& str)
|
|
| 1529 | - {
|
|
| 1530 | - return *m_holder.insert(str).first;
|
|
| 1531 | - }
|
|
| 1532 | - |
|
| 1533 | - wxDECLARE_NO_COPY_CLASS(UntranslatedStringHolder);
|
|
| 1534 | -};
|
|
| 1535 | - |
|
| 1536 | -#endif // __MINGW32__/!__MINGW32__
|
|
| 1537 | - |
|
| 1538 | -} // Anonymous namespace
|
|
| 1539 | - |
|
| 1540 | - |
|
| 1541 | -/* static */
|
|
| 1542 | -const wxString& wxTranslations::GetUntranslatedString(const wxString& str)
|
|
| 1543 | -{
|
|
| 1544 | - thread_local UntranslatedStringHolder wxPerThreadStrings;
|
|
| 1545 | - return wxPerThreadStrings.get(str);
|
|
| 1546 | -}
|
|
| 1547 | - |
|
| 1548 | - |
|
| 1549 | 1453 | const wxString *wxTranslations::GetTranslatedString(const wxString& origString,
|
| 1550 | 1454 | const wxString& domain,
|
| 1551 | 1455 | const wxString& context) const
|
| ... | ... | @@ -80,6 +80,8 @@ wxDateTimePickerCtrl::MSWCreateDateTimePicker(wxWindow *parent, |
| 80 | 80 | return true;
|
| 81 | 81 | }
|
| 82 | 82 | |
| 83 | +#if wxUSE_INTL
|
|
| 84 | + |
|
| 83 | 85 | void wxDateTimePickerCtrl::MSWSetTimeFormat(wxLocaleInfo index)
|
| 84 | 86 | {
|
| 85 | 87 | const wxString format = wxGetMSWDateTimeFormat(index);
|
| ... | ... | @@ -90,6 +92,8 @@ void wxDateTimePickerCtrl::MSWSetTimeFormat(wxLocaleInfo index) |
| 90 | 92 | }
|
| 91 | 93 | }
|
| 92 | 94 | |
| 95 | +#endif // wxUSE_INTL
|
|
| 96 | + |
|
| 93 | 97 | void wxDateTimePickerCtrl::SetValue(const wxDateTime& dt)
|
| 94 | 98 | {
|
| 95 | 99 | wxCHECK_RET( dt.IsValid() || MSWAllowsNone(),
|
| ... | ... | @@ -98,6 +98,9 @@ |
| 98 | 98 | // For wxCmpNatural()
|
| 99 | 99 | #include <shlwapi.h>
|
| 100 | 100 | |
| 101 | +// For std::unique_ptr
|
|
| 102 | +#include <memory>
|
|
| 103 | + |
|
| 101 | 104 | // In some distributions of MinGW32, this function is exported in the library,
|
| 102 | 105 | // but not declared in shlwapi.h. Therefore we declare it here.
|
| 103 | 106 | #if defined( __MINGW32_TOOLCHAIN__ )
|
| ... | ... | @@ -264,7 +264,9 @@ public: |
| 264 | 264 | m_dataPath = wxStandardPaths::Get().GetUserLocalDataDir();
|
| 265 | 265 | #ifdef __VISUALC__
|
| 266 | 266 | m_webViewEnvironmentOptions = Make<CoreWebView2EnvironmentOptions>().Get();
|
| 267 | +#if wxUSE_INTL
|
|
| 267 | 268 | m_webViewEnvironmentOptions->put_Language(wxUILocale::GetCurrent().GetLocaleId().GetName().wc_str());
|
| 269 | +#endif
|
|
| 268 | 270 | |
| 269 | 271 | wxCOMPtr<ICoreWebView2EnvironmentOptions3> options3;
|
| 270 | 272 | if (SUCCEEDED(m_webViewEnvironmentOptions->QueryInterface(IID_PPV_ARGS(&options3))))
|
| ... | ... | @@ -453,7 +453,9 @@ public: |
| 453 | 453 | |
| 454 | 454 | const QModelIndex modelIndex = index(row, col);
|
| 455 | 455 | |
| 456 | - if ( info.m_mask & wxLIST_MASK_STATE )
|
|
| 456 | + // For consistency with the other ports, don't generate wxEVT_LIST_ITEM_SELECTED
|
|
| 457 | + // event when the list control is shown for the first time.
|
|
| 458 | + if ( m_view->isVisible() && info.m_mask & wxLIST_MASK_STATE )
|
|
| 457 | 459 | {
|
| 458 | 460 | if ( (info.m_stateMask & wxLIST_STATE_FOCUSED) &&
|
| 459 | 461 | (info.m_state & wxLIST_STATE_FOCUSED) )
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help