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 <dcbw@libreoffice.org>
This commit is contained in:
Michael Weghorn
2026-10-06 16:50:13 +02:00
parent 1caec31b97
commit 016b2c1135
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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: */
+1 -1
View File
@@ -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; }
+3 -3
View File
@@ -16,7 +16,7 @@
#include <QtGui/QScreen>
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;
+1 -1
View File
@@ -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: */