mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 01:19:45 +08:00
Fix dangling references to temporaries in internat sample
In some build variants (e.g. when wxUSE_INTL==0) _() is a macro doing nothing, in particular not involving a function call, and the temporary wxString created by it doesn't survive past the end of the statement and hence a reference to it can't be used. Just make a copy of the string to fix this.
This commit is contained in:
@@ -588,7 +588,7 @@ void MyFrame::OnSave(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
const wxString& title = _("Testing _() (gettext)");
|
||||
const wxString title = _("Testing _() (gettext)");
|
||||
|
||||
// NOTE: using the wxTRANSLATE() macro here we won't show a localized
|
||||
// string in the text entry dialog; we'll simply show the un-translated
|
||||
@@ -611,7 +611,7 @@ void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
const wxString& title = _("Testing _N() (ngettext)");
|
||||
const wxString title = _("Testing _N() (ngettext)");
|
||||
wxTextEntryDialog d(this,
|
||||
_("Please enter range for plural forms of \"n files deleted\" phrase"),
|
||||
title, "0-10");
|
||||
|
||||
Reference in New Issue
Block a user