diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-07-08 23:34:36 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-07-09 12:02:39 +0200 |
commit | 2c040dc9919e4c5aa5f582d58ca5717a6ec1e12b (patch) | |
tree | bbde7e5bff819b014d5cb99d793f7758da7079c7 /vcl | |
parent | f9b16330f13d3ad43de6de026206577bfa1ac85d (diff) |
qt: Check for SAL_VCL_QT_USE_QFONT in a central place
Change-Id: I7f0a2cf8daaf72de02261e2a9a5c3a70f5a42270
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154224
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/qt5/QtInstance.hxx | 2 | ||||
-rw-r--r-- | vcl/qt5/QtInstance.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/kf5/KFSalInstance.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/kf5/KFSalInstance.hxx | 2 |
4 files changed, 8 insertions, 12 deletions
diff --git a/vcl/inc/qt5/QtInstance.hxx b/vcl/inc/qt5/QtInstance.hxx index df6c4ec5af86..a0a2f6fa60f7 100644 --- a/vcl/inc/qt5/QtInstance.hxx +++ b/vcl/inc/qt5/QtInstance.hxx @@ -99,7 +99,7 @@ protected: void notifyDisplayChanged(); public: - explicit QtInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo = false); + explicit QtInstance(std::unique_ptr<QApplication>& pQApp); virtual ~QtInstance() override; // handle common SalInstance setup diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx index df3df5d17a74..4880c1bdec55 100644 --- a/vcl/qt5/QtInstance.cxx +++ b/vcl/qt5/QtInstance.cxx @@ -218,9 +218,9 @@ OUString QtInstance::constructToolkitID(std::u16string_view sTKname) return sID; } -QtInstance::QtInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo) +QtInstance::QtInstance(std::unique_ptr<QApplication>& pQApp) : SalGenericInstance(std::make_unique<QtYieldMutex>()) - , m_bUseCairo(bUseCairo) + , m_bUseCairo(nullptr == getenv("SAL_VCL_QT_USE_QFONT")) , m_pTimer(nullptr) , m_bSleeping(false) , m_pQApplication(std::move(pQApp)) @@ -751,8 +751,6 @@ void QtInstance::setActivePopup(QtFrame* pFrame) extern "C" { VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance() { - static const bool bUseCairo = (nullptr == getenv("SAL_VCL_QT_USE_QFONT")); - std::unique_ptr<char* []> pFakeArgv; std::unique_ptr<int> pFakeArgc; std::vector<FreeableCStr> aFakeArgvFreeable; @@ -761,7 +759,7 @@ VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance() std::unique_ptr<QApplication> pQApp = QtInstance::CreateQApplication(*pFakeArgc, pFakeArgv.get()); - QtInstance* pInstance = new QtInstance(pQApp, bUseCairo); + QtInstance* pInstance = new QtInstance(pQApp); pInstance->MoveFakeCmdlineArgs(pFakeArgv, pFakeArgc, aFakeArgvFreeable); new QtData(); diff --git a/vcl/unx/kf5/KFSalInstance.cxx b/vcl/unx/kf5/KFSalInstance.cxx index b52faf4b2070..bed513167957 100644 --- a/vcl/unx/kf5/KFSalInstance.cxx +++ b/vcl/unx/kf5/KFSalInstance.cxx @@ -32,8 +32,8 @@ using namespace com::sun::star; -KFSalInstance::KFSalInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo) - : QtInstance(pQApp, bUseCairo) +KFSalInstance::KFSalInstance(std::unique_ptr<QApplication>& pQApp) + : QtInstance(pQApp) { ImplSVData* pSVData = ImplGetSVData(); const OUString sToolkit = u"kf" + OUString::number(QT_VERSION_MAJOR); @@ -73,8 +73,6 @@ KFSalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> con extern "C" { VCLPLUG_KF_PUBLIC SalInstance* create_SalInstance() { - static const bool bUseCairo = (nullptr == getenv("SAL_VCL_QT_USE_QFONT")); - std::unique_ptr<char* []> pFakeArgv; std::unique_ptr<int> pFakeArgc; std::vector<FreeableCStr> aFakeArgvFreeable; @@ -83,7 +81,7 @@ VCLPLUG_KF_PUBLIC SalInstance* create_SalInstance() std::unique_ptr<QApplication> pQApp = QtInstance::CreateQApplication(*pFakeArgc, pFakeArgv.get()); - KFSalInstance* pInstance = new KFSalInstance(pQApp, bUseCairo); + KFSalInstance* pInstance = new KFSalInstance(pQApp); pInstance->MoveFakeCmdlineArgs(pFakeArgv, pFakeArgc, aFakeArgvFreeable); new QtData(); diff --git a/vcl/unx/kf5/KFSalInstance.hxx b/vcl/unx/kf5/KFSalInstance.hxx index b96046fdb89e..b4c12e895e48 100644 --- a/vcl/unx/kf5/KFSalInstance.hxx +++ b/vcl/unx/kf5/KFSalInstance.hxx @@ -29,7 +29,7 @@ class KFSalInstance final : public QtInstance QFileDialog::FileMode) override; public: - explicit KFSalInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo); + explicit KFSalInstance(std::unique_ptr<QApplication>& pQApp); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |