Am 18.05.2011 13:44, schrieb tora - Takamichi Akiyama:
The motivation of this topic comes from a different point. I have been
looking for a way to prevent a well-known phenomenon "A single sheet
that fits in a A4 paper with Excel turns into two or four A4 papers with
Calc."
Tweaking nPPTX and nPPTY ?
Reducing a font size just before calling OutputDevice::SetFont() from
the inside of sc and editeng ?

Four pages means that both width and height are wrong? They are handled quite differently.

Column widths in Calc are static (stored in twips internally). The conversion from Excel's character-based units is done during import.

Automatic row heights are updated based on cell formats and contents. The edit engine is used only for complex cell contents. With simple cells, we "cheat" a bit and avoid the OutputDevice::SetFont call, for performance reasons. The calculation is based on the height of the default font (determined from an OutputDevice once), the direct value from the font height format, and some tweaking, see lcl_GetAttribHeight in sc/source/core/data/column2.cxx. This obviously leaves lots of room to arrive at different values from Excel. In some cases even correctly so, because optimal height is supposed to fit the cell content with your current setup (system, installed fonts).

Niklas
--
-----------------------------------------------------------------
To unsubscribe send email to dev-unsubscr...@openoffice.org
For additional commands send email to sy...@openoffice.org
with Subject: help

Reply via email to