On 2010-03-09 17:17, Niklas Nebel wrote:
On 03/09/10 14:14, Jan Holst Jensen wrote:
I am dabbling with in-cell rendering of molecules and proteins in Calc. I have made a custom build of DEV300_M60 (I know - it's old now) where I have added code that to some extent can do the job. You can take a look at my progress so far at

http://www.biochemfusion.com/work/in-cell/status1.html

I haven't found myself able to sufficiently grok the logic in output2.cxx's ScOutputData::DrawStrings() so I can override the cell rendering reliably enough. Also, I could use a hint as to how I should implement proper preview and print support - seems like it is mostly a matter of scaling (?).

ScOutputData has member variables nPPTX and nPPTY for the factor of pixels per twip. Just use those instead of a fixed factor, and scaling will adjust to the printer (or different zoom in the view).

There is still a special case to be handled though: If the configuration option "User printer metrics for text formatting" is set, the bPixelToLogic parameter to DrawStrings is TRUE, and PixelToLogic / LogicToPixel has to be used.

Thanks Niklas. That should get me going with the preview / printing.

Can anyone give me input on what variables / flags I should set to really override cell drawing and effectively get OwnerDraw mode in specific cells ? I am currently changing bNeedEdit when I encounter a "molecule-formatted" cell so I can do cell rendering instead of the in-place editor doing it (as far as I have understood the meaning of that flag).

I have also tried changing bDoCell but with somewhat unpredictable results. Is this caused by cell rendering also being done in other places than ScOutputData::DrawStrings() ?

Cheers
-- Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to