Ticket #659: empty_proj_name_in_stats_tab.patch
File empty_proj_name_in_stats_tab.patch, 2.6 KB (added by , 16 years ago) |
---|
-
clientgui/ViewStatistics.cpp
380 380 wxCoord y0 = 0; 381 381 382 382 if (project1) { 383 head_name = wxString(_("Project")) + wxT(": ") + wxString(project1->project_name.c_str(), wxConvUTF8); 383 if (project1->project_name.length() > 0) 384 head_name = wxString(_("Project")) + wxT(": ") + wxString(project1->project_name.c_str(), wxConvUTF8); 385 else 386 head_name = wxString(_("Project")) + wxT(": ") + wxString(project1->master_url.c_str(), wxConvUTF8); 384 387 dc.GetTextExtent(head_name, &w_temp, &h_temp, &des_temp, &lead_temp); 385 388 x0 = wxCoord(m_WorkSpace_X_start + ((m_WorkSpace_X_end - m_WorkSpace_X_start - double(w_temp)) / 2.0)); 386 389 y0 = wxCoord(m_WorkSpace_Y_start + 1.0); … … 463 466 for (std::vector<PROJECT*>::const_iterator i = proj->projects.begin(); i != proj->projects.end(); ++i) { 464 467 ++count; 465 468 PROJECT* state_project = pDoc->state.lookup_project((*i)->master_url); 466 if (state_project) head_name = wxString(state_project->project_name.c_str(), wxConvUTF8); 469 if (state_project) { 470 if (state_project->project_name.length() > 0) 471 head_name = wxString(state_project->project_name.c_str(), wxConvUTF8); 472 else 473 head_name = wxString(state_project->master_url.c_str(), wxConvUTF8); 474 } 467 475 dc.GetTextExtent(head_name, &w_temp, &h_temp, &des_temp, &lead_temp); 468 476 if (project_name_max_width < w_temp) project_name_max_width = w_temp; 469 477 } … … 548 556 ///Draw project name 549 557 head_name = wxT("?"); 550 558 PROJECT* state_project = pDoc->state.lookup_project((*i)->master_url); 551 if (state_project) head_name = wxString(state_project->project_name.c_str(), wxConvUTF8); 559 if (state_project) { 560 if (state_project->project_name.length() > 0) 561 head_name = wxString(state_project->project_name.c_str(), wxConvUTF8); 562 else 563 head_name = wxString(state_project->master_url.c_str(), wxConvUTF8); 564 } 552 565 553 566 if (SelProj == count){ 554 567 dc.SetBrush(wxBrush(m_brush_LegendSelectColour , wxSOLID)); … … 1240 1253 wxString head_name = wxT("?"); 1241 1254 PROJECT* state_project = pDoc->state.lookup_project((*i)->master_url); 1242 1255 if (state_project) { 1243 head_name = wxString(state_project->project_name.c_str(), wxConvUTF8); 1256 if (state_project->project_name.length() > 0) 1257 head_name = wxString(state_project->project_name.c_str(), wxConvUTF8); 1258 else 1259 head_name = wxString(state_project->master_url.c_str(), wxConvUTF8); 1244 1260 } 1245 1261 //Draw heading 1246 1262 DrawMainHead(dc, head_name);