Double conversion fails for negative values when using *MENU* setter function


I have come across a funny conversion issue when using setter functions with negative Double_t arguments from the drop down menu of an object in a canvas and I wonder if anybody can reproduce this. I noticed it first with TEllipse::SetTheta() which is also easy to check from ROOT console:

  1. Open a TCanvas and show the Toolbar (canvas “View” menu)
  2. Select the ellipse and draw a reasonably non-circular ellipse, so that you can visually see the effect of SetTheta
  3. Play around with SetTheta from the TEllipse drop down menu

Issue: For positive theta, it doesn’t matter if I type, say “45” or “45.” into the number entry, for negative values, “-45.” with a dot will work correctly while “-45” without dot produces a very large seemingly random positive number. Funny enough, after setting “-45.” with dot and then selecting SetTheta again, the number entry will display “-45” without dot and just clicking “OK” will mess things up again.

I see this only in ROOT 6.05 which was compiled with C++11 support in case that matters. I don’t see it in ROOT 5.34.32 which is absolutely happy about converting “-45” to “-45.” properly. Also, when calling SetTheta from a different method in a compiled program, the problem does not occur. It only shows when using the dropdown menu, so I suspect it has something to do with the way ROOT handles the user input from the drop down menu.

Any ideas where this comes from?



A fix has been committed in the master (in the context menu dialog). Note that the real problem comes from “TObject::Execute()” (and not from the GUI per se) and remains to be investigated
A JIRA Issue has been created (ROOT-7684).
Cheers, Bertrand.

The underlying issue has been solved.