Argh. You just got bit by the same thing I did. That function needs to be
rethought, and all uses of it rechecked.
this function has served several different purposes over time.
Originally (1.13), it converted from inches to whatever units you wanted.
At the time, I did a lot of testing to make sure that the ruler code used
this logic properly by switching unit systems in code and recompiling.
Later on (1.17), it morphed into a fancy sprintf which didn't convert units.
By the time I started working with Shaw to port the Paragraph dialog (which
does even more unit-conversion work than the ruler), I got bit too. At the
time I tried changing back to the old semantics, but ran across other code
which depended on the new semantics.
Instead (1.21), I added a new function UT_convertInchesToDimension() which
does the other half of the original job, as seen here:
abi/src/wp/ap/xp/ap_Dialog_Paragraph.cpp
What a mess. :-(
At this point, rather than applying your patch, I think we should:
- strip out the last traces of the old semantics from the function,
- rename it to be clearer about its new job, and
- recheck all uses to see which functions should be called.
It's a thankless janitorial task, but it'll help prevent similar confusion
in the future.
Paul