diff --git a/gui/gui/src/TGSimpleTableInterface.cxx b/gui/gui/src/TGSimpleTableInterface.cxx index 72b4af4851f687435f5476cd7e1e583060d820c5..d23a90d1c096daaac754df422685462f4f7d2184 100644 --- a/gui/gui/src/TGSimpleTableInterface.cxx +++ b/gui/gui/src/TGSimpleTableInterface.cxx @@ -64,9 +64,7 @@ const char *TGSimpleTableInterface::GetValueAsString(UInt_t row, UInt_t column) // FIXME use template string for string format instead of hardcoded format - TString str; - str.Form("%5.2f", GetValue(row, column)); - return str.Data(); + return Form("%5.2f", GetValue(row, column)); } //______________________________________________________________________________ @@ -74,9 +72,7 @@ const char *TGSimpleTableInterface::GetRowHeader(UInt_t row) { // Return a name for the header at row. - TString str("DRow "); - str += row; - return str.Data(); + return Form("DRow %d", row); } //______________________________________________________________________________ @@ -84,7 +80,5 @@ const char *TGSimpleTableInterface::GetColumnHeader(UInt_t column) { // Return a name for the header at column. - TString str("DCol "); - str += column; - return str.Data(); + return Form("DCol %d", column); } diff --git a/tree/treeplayer/src/TTreeTableInterface.cxx b/tree/treeplayer/src/TTreeTableInterface.cxx index 883498d7291fd32efce47afcdbfbc098ac001f46..e8a086f598d1a503550fc4c240007c491464696c 100644 --- a/tree/treeplayer/src/TTreeTableInterface.cxx +++ b/tree/treeplayer/src/TTreeTableInterface.cxx @@ -362,13 +362,11 @@ const char *TTreeTableInterface::GetValueAsString(UInt_t row, UInt_t column) } if (column < fNColumns) { TTreeFormula *formula = (TTreeFormula *)fFormulas->At(column); - TString str; if(formula->IsString()) { - str.Form("%s", formula->EvalStringInstance()); + return Form("%s", formula->EvalStringInstance()); } else { - str.Form("%5.2f", (Double_t)formula->EvalInstance()); + return Form("%5.2f", (Double_t)formula->EvalInstance()); } - return str.Data(); } else { Error("TTreeTableInterface", "Column requested does not exist"); return 0; @@ -381,9 +379,7 @@ const char *TTreeTableInterface::GetRowHeader(UInt_t row) // Return a string to use as a label for rowheader at column. if (row < fNRows) { - TString str; - str.Form("%d", fEntries->GetEntry(row)); - return str.Data(); + return Form("%d", fEntries->GetEntry(row)); } else { Error("TTreeTableInterface", "Row requested does not exist"); return "";