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.
Hey I've released a patch here: https://gerrit.libreoffice.org/c/core/+/180360 Can you please let me know if I am headed in the right direction. Thanks!
bruh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/589cd1b840ccdfb00c74d8ae776d853832bcdf4e tdf#153251 remove s_nPixelTwips It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.