SwViewOptions has a rather grim and unhelpful global variable: sw/inc/viewopt.hxx: static sal_uInt16 s_nPixelTwips;// 1 Pixel == ? Twips Which is only used in one place: sw/source/uibase/config/viewopt.cxx-void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, bool bIsScript ) Where (it seems to me) - we could more profitably work out how many twips to the pixel there are for the screen the view is rendered to there with: sw/source/uibase/config/viewopt.cxx: s_nPixelTwips = o3tl::narrowing<sal_uInt16>(pWin->PixelToLogic( Size(1,1) ).Height()); And also kill the SwViewOption::Init at the same time. This global static seems to have come from the initial checkin: commit 7b0b5cdfeed656b279bc32cd929630d5fc25878b Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon Sep 18 16:15:01 2000 +0000 +USHORT SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm Thanks !
Any thoughts Miklos =) looked weird to me.
Yes, sounds like a good idea to eliminate that static. It's broken if different views have different DPI / zoom level, I guess.