From 9e2a9b55e185b92074b32d3df336920f33b29e5a Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 1 Feb 2015 17:59:23 -0500 Subject: Reduce gettext wide/narrow and string/char* conversions --- src/guiPasswordChange.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/guiPasswordChange.cpp') diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index c8a2214b6..d9a5cc48b 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -96,6 +96,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) v2s32 size = rect.getSize(); v2s32 topleft_client(40, 0); + const wchar_t *text; + /* Add stuff */ @@ -103,7 +105,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - wchar_t* text = wgettext("Old Password"); + text = wgettext("Old Password"); Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; } @@ -119,7 +121,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - wchar_t* text = wgettext("New Password"); + text = wgettext("New Password"); Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; } @@ -134,7 +136,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - wchar_t* text = wgettext("Confirm Password"); + text = wgettext("Confirm Password"); Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; } @@ -150,7 +152,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); - wchar_t* text = wgettext("Change"); + text = wgettext("Change"); Environment->addButton(rect, this, ID_change, text); delete[] text; } @@ -159,7 +161,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 300, 20); rect += topleft_client + v2s32(35, ypos); - wchar_t* text = wgettext("Passwords do not match!"); + text = wgettext("Passwords do not match!"); IGUIElement *e = Environment->addStaticText( text, -- cgit v1.2.3