tdf#153251 remove s_nPixelTwips

Change-Id: I43d39925931071b78e08adf47bf3c6c590b1a2ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180360
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
This commit is contained in:
bruh 2025-01-16 21:02:46 +05:30 committed by Ilmari Lauhakangas
parent 1f7a4ef133
commit 589cd1b840
3 changed files with 1 additions and 15 deletions

View File

@ -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)

View File

@ -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();

View File

@ -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();