From 016b2c1135963095074c37128c5e18d8980df8ba Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 2 Oct 2026 16:35:20 +0200 Subject: [PATCH] qt: Don't require to pass QtFrame to QtGraphicsBase::ImplGetResolution Both callers in subclasses pass the own frame. Use it directly instead of requiring that callers pass it explicitly. Change-Id: I5e40e86a0f6b4e76838234aacc32de71aad8ef22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211746 Tested-by: Jenkins Reviewed-by: Dan Williams --- vcl/inc/qt5/QtGraphicsBase.hxx | 2 +- vcl/qt5/QtGraphics.cxx | 2 +- vcl/qt5/QtGraphicsBase.cxx | 6 +++--- vcl/qt5/QtSvpGraphics.cxx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vcl/inc/qt5/QtGraphicsBase.hxx b/vcl/inc/qt5/QtGraphicsBase.hxx index 1039dc8bea7d..e6b1904f618c 100644 --- a/vcl/inc/qt5/QtGraphicsBase.hxx +++ b/vcl/inc/qt5/QtGraphicsBase.hxx @@ -38,7 +38,7 @@ public: protected: QtFrame* GetFrame() const { return m_pFrame; } - static void ImplGetResolution(const QtFrame* pFrame, sal_Int32& rDPIX, sal_Int32& rDPIY); + void ImplGetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt5/QtGraphics.cxx b/vcl/qt5/QtGraphics.cxx index 3134159f7e61..541b7a1928b8 100644 --- a/vcl/qt5/QtGraphics.cxx +++ b/vcl/qt5/QtGraphics.cxx @@ -88,7 +88,7 @@ void QtGraphics::handleDamage(const tools::Rectangle& rDamagedRegion) void QtGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) { - QtGraphicsBase::ImplGetResolution(GetFrame(), rDPIX, rDPIY); + ImplGetResolution(rDPIX, rDPIY); } void QtGraphics::SetTextColor(Color nColor) { m_aTextColor = nColor; } diff --git a/vcl/qt5/QtGraphicsBase.cxx b/vcl/qt5/QtGraphicsBase.cxx index a6b99eb39640..29f35dcf725f 100644 --- a/vcl/qt5/QtGraphicsBase.cxx +++ b/vcl/qt5/QtGraphicsBase.cxx @@ -16,7 +16,7 @@ #include -void QtGraphicsBase::ImplGetResolution(const QtFrame* pFrame, sal_Int32& rDPIX, sal_Int32& rDPIY) +void QtGraphicsBase::ImplGetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) { char* pForceDpi; if ((pForceDpi = getenv("SAL_FORCEDPI"))) @@ -25,10 +25,10 @@ void QtGraphicsBase::ImplGetResolution(const QtFrame* pFrame, sal_Int32& rDPIX, return; } - if (!pFrame) + if (!m_pFrame) return; - QScreen* pScreen = pFrame->GetQWidget().screen(); + QScreen* pScreen = m_pFrame->GetQWidget().screen(); qreal devicePixelRatio = GetQtInstance().EmscriptenLightweightRunInMainThread( [pScreen] { return pScreen->devicePixelRatio(); }); rDPIX = pScreen->logicalDotsPerInchX() * devicePixelRatio + 0.5; diff --git a/vcl/qt5/QtSvpGraphics.cxx b/vcl/qt5/QtSvpGraphics.cxx index 9bf7975ecb58..3d1aa838871e 100644 --- a/vcl/qt5/QtSvpGraphics.cxx +++ b/vcl/qt5/QtSvpGraphics.cxx @@ -90,7 +90,7 @@ void QtSvpGraphics::handleDamage(const tools::Rectangle& rDamagedRegion) void QtSvpGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) { - QtGraphicsBase::ImplGetResolution(GetFrame(), rDPIX, rDPIY); + ImplGetResolution(rDPIX, rDPIY); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */