diff --git a/accessible/src/atk/nsMaiInterfaceAction.cpp b/accessible/src/atk/nsMaiInterfaceAction.cpp index e7b9bf31065..c5390867624 100644 --- a/accessible/src/atk/nsMaiInterfaceAction.cpp +++ b/accessible/src/atk/nsMaiInterfaceAction.cpp @@ -139,16 +139,11 @@ getNameCB(AtkAction *aAction, gint aActionIndex) accWrap->GetMaiInterface(MAI_INTERFACE_ACTION)); NS_ENSURE_TRUE(action, nsnull); - const char *name = action->GetName(); - if (!name || !*name) { - nsAutoString autoStr; - nsresult rv = accWrap->GetActionName(aActionIndex, autoStr); - NS_ENSURE_SUCCESS(rv, nsnull); - - action->SetName(autoStr); - name = action->GetName(); - } - return name; + nsAutoString autoStr; + nsresult rv = accWrap->GetActionName(aActionIndex, autoStr); + NS_ENSURE_SUCCESS(rv, nsnull); + action->SetName(autoStr); + return action->GetName(); } const gchar * diff --git a/accessible/src/atk/nsMaiInterfaceAction.h b/accessible/src/atk/nsMaiInterfaceAction.h index 5a96681c546..3c6da3b7f00 100644 --- a/accessible/src/atk/nsMaiInterfaceAction.h +++ b/accessible/src/atk/nsMaiInterfaceAction.h @@ -54,16 +54,16 @@ public: virtual const GInterfaceInfo *GetInterfaceInfo(); const char *GetName() { - return NS_ConvertUCS2toUTF8(mName).get(); + return mName.get(); } - void SetName(nsAString &aString) { mName = aString; } + void SetName(nsAString &aString) { mName = NS_ConvertUCS2toUTF8(aString); } const char *GetKeyBinding() { return NS_ConvertUCS2toUTF8(mKeyBinding).get(); } void SetKeyBinding(nsAString &aString) { mKeyBinding = aString; } private: - nsString mName; + nsCString mName; nsString mKeyBinding; };