All pastes #1059530 Raw Edit

Miscellany

public text v1 · immutable
#1059530 ·published 2008-06-30 23:28 UTC
rendered paste body
void CViewWork::GetDocApplicationName(wxInt32 item, wxString& strBuffer) const {    CMainDocument* pDoc = wxGetApp().GetDocument();    RESULT* result = wxGetApp().GetDocument()->result(item);    RESULT* state_result = NULL;    wxString strLocalBuffer;    wxASSERT(pDoc);    wxASSERT(wxDynamicCast(pDoc, CMainDocument));    if (result) {        state_result = pDoc->state.lookup_result(result->project_url, result->name);        if (!state_result) {            pDoc->ForceCacheUpdate();            state_result = pDoc->state.lookup_result(result->project_url, result->name);        }        wxASSERT(state_result);        wxString strLocale = wxString(setlocale(LC_NUMERIC, NULL), wxConvUTF8);        setlocale(LC_NUMERIC, "C");        if (state_result->wup->app->user_friendly_name.size()) {            strLocalBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8));        } else {            strLocalBuffer = HtmlEntityDecode(wxString(state_result->wup->avp->app_name.c_str(), wxConvUTF8));        }        wxString planClassBuffer = wxEmptyString;        if (!state_result->wup->avp->plan_class.empty()) {            int* x=0;            x=0;            planClassBuffer.Printf(wxT(" (%s)"), state_result->wup->avp->plan_class.c_str());        }        strBuffer.Printf(            wxT(" %s %.2f%s"),             strLocalBuffer.c_str(),            state_result->wup->avp->version_num/100.0,            planClassBuffer         );        setlocale(LC_NUMERIC, (const char*)strLocale.mb_str());    }}