sw/inc/viewopt.hxx | 4 ---- sw/source/core/view/vnew.cxx | 1 - sw/source/uibase/config/viewopt.cxx | 11 +---------- 3 files changed, 1 insertion(+), 15 deletions(-)
New commits: commit 589cd1b840ccdfb00c74d8ae776d853832bcdf4e Author: bruh <randomfores...@gmail.com> AuthorDate: Thu Jan 16 21:02:46 2025 +0530 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Fri Jan 17 09:05:31 2025 +0100 tdf#153251 remove s_nPixelTwips Change-Id: I43d39925931071b78e08adf47bf3c6c590b1a2ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180360 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Jenkins diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index eff41b5be26d..bc273d58c4f2 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -262,8 +262,6 @@ class SwViewOption static SwViewColors s_aInitialColorConfig; OUString m_sThemeName; - static sal_uInt16 s_nPixelTwips;// 1 Pixel == ? Twips - OUString m_sSymbolFont; // Symbolfont. ViewOptFlags1 m_nCoreOptions; // Bits for SwViewShell. ViewOptCoreFlags2 m_nCore2Options; // Bits for SwViewShell. @@ -317,8 +315,6 @@ public: SW_DLLPUBLIC SwViewOption(const SwViewOption&); SW_DLLPUBLIC ~SwViewOption(); - static void Init(const OutputDevice* pWin); // Initializing of static data. - inline void SetUIOptions( const SwViewOption& ); void SetColorConfig(const SwViewColors& rColorConfig) diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 613a15df633b..2a40c099a393 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -104,7 +104,6 @@ void SwViewShell::Init( const SwViewOption *pNewOpt ) SAL_INFO( "sw.core", "View::Init - after InitPrt" ); if( GetWin() ) { - SwViewOption::Init( GetWin()->GetOutDev() ); GetWin()->GetOutDev()->SetFillColor(); GetWin()->SetBackground(); GetWin()->GetOutDev()->SetLineColor(); diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index 082f8f4331dd..162d6a103d66 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -41,7 +41,6 @@ #include <comphelper/lok.hxx> #include <comphelper/configurationlistener.hxx> -sal_uInt16 SwViewOption::s_nPixelTwips = 0; // one pixel on the screen SwViewColors SwViewOption::s_aInitialColorConfig {}; SwViewColors::SwViewColors() : @@ -212,7 +211,7 @@ void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, bool b Color aOldLineColor( pOut->GetLineColor() ); pOut->SetLineColor( COL_GRAY ); // to make it look nice, we subtract two pixels everywhere - SwTwips nPix = s_nPixelTwips * 2; + SwTwips nPix = o3tl::narrowing<sal_uInt16>(pOut->PixelToLogic( Size(1,1) ).Height()) * 2; if( rRect.Width() <= 2 * nPix || rRect.Height() <= 2 * nPix ) nPix = 0; const Point aTopLeft( rRect.Left() + nPix, rRect.Top() + nPix ); @@ -387,14 +386,6 @@ SwViewOption::~SwViewOption() { } -void SwViewOption::Init(const OutputDevice* pWin) -{ - if( !s_nPixelTwips && pWin ) - { - s_nPixelTwips = o3tl::narrowing<sal_uInt16>(pWin->PixelToLogic( Size(1,1) ).Height()); - } -} - bool SwViewOption::IsAutoCompleteWords() { const SvxSwAutoFormatFlags& rFlags = SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();