static/emscripten/environment.js | 1 - vcl/README.vars.md | 6 +----- vcl/inc/qt5/QtInstance.hxx | 2 +- vcl/qt5/QtInstance.cxx | 8 +++----- vcl/unx/kf5/KFSalInstance.cxx | 8 +++----- vcl/unx/kf5/KFSalInstance.hxx | 2 +- 6 files changed, 9 insertions(+), 18 deletions(-)
New commits: commit 2c040dc9919e4c5aa5f582d58ca5717a6ec1e12b Author: Khaled Hosny <kha...@libreoffice.org> AuthorDate: Sat Jul 8 23:34:36 2023 +0300 Commit: خالد حسني <kha...@libreoffice.org> CommitDate: Sun Jul 9 12:02:39 2023 +0200 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.wegh...@posteo.de> Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@libreoffice.org> 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: */ commit f9b16330f13d3ad43de6de026206577bfa1ac85d Author: Khaled Hosny <kha...@libreoffice.org> AuthorDate: Sat Jul 8 22:42:12 2023 +0300 Commit: خالد حسني <kha...@libreoffice.org> CommitDate: Sun Jul 9 12:02:28 2023 +0200 tdf#151273, tdf#151925: Don’t use QFont text layout by default We were enabling QFont for qt5 VCL plugin by default, but it is buggy and some distributions seem to enabled qt5 VCL plugin even if we don't recommend it. Since the QFont code is incomplete and no one is working on it, lets make people’s life easier by making it always off by default. This removed the SAL_VCL_QT5_USE_CAIRO envvar and replaces it with SAL_VCL_QT_USE_QFONT that does the reverse. Also SAL_VCL_KF5_USE_QFONT is dropped in favor of SAL_VCL_QT_USE_QFONT. Change-Id: Id7471acd12fe277908f567140b63ae8d27b03033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154222 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@libreoffice.org> diff --git a/static/emscripten/environment.js b/static/emscripten/environment.js index bc60fddcbbe3..7d04fd76b0f2 100644 --- a/static/emscripten/environment.js +++ b/static/emscripten/environment.js @@ -1,5 +1,4 @@ if (!('preRun' in Module)) Module['preRun'] = []; Module.preRun.push(function() { ENV.SAL_LOG = "+WARN" - ENV.SAL_VCL_QT5_USE_CAIRO = "1" }); diff --git a/vcl/README.vars.md b/vcl/README.vars.md index a2ede5a40855..0fa1a9505cd3 100644 --- a/vcl/README.vars.md +++ b/vcl/README.vars.md @@ -63,11 +63,7 @@ will be used to write the log under `instdir/uitest/`. * `QT_SCALE_FACTOR=2` - for HiDPI testing (also supports float) * `SAL_VCL_QT5_NO_FONTCONFIG` - ignore fontconfig provided font substitutions * `SAL_VCL_QT5_NO_NATIVE` - disable `QStyle`'d controls -* `SAL_VCL_QT5_USE_CAIRO` - use cairo for text rendering and fonts (default for kf5, but not qt5) - -## Kf5 - -* `SAL_VCL_KF5_USE_QFONT` - use `QFont` for text rendering (default for qt5, but not kf5) +* `SAL_VCL_QT_USE_QFONT` - use `QFont` for text layout and rendering (default is to use cairo) ## Mac diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx index 9c4d3def970e..df3df5d17a74 100644 --- a/vcl/qt5/QtInstance.cxx +++ b/vcl/qt5/QtInstance.cxx @@ -751,7 +751,7 @@ void QtInstance::setActivePopup(QtFrame* pFrame) extern "C" { VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance() { - static const bool bUseCairo = (nullptr != getenv("SAL_VCL_QT5_USE_CAIRO")); + static const bool bUseCairo = (nullptr == getenv("SAL_VCL_QT_USE_QFONT")); std::unique_ptr<char* []> pFakeArgv; std::unique_ptr<int> pFakeArgc; diff --git a/vcl/unx/kf5/KFSalInstance.cxx b/vcl/unx/kf5/KFSalInstance.cxx index bec23cc2a6af..b52faf4b2070 100644 --- a/vcl/unx/kf5/KFSalInstance.cxx +++ b/vcl/unx/kf5/KFSalInstance.cxx @@ -73,7 +73,7 @@ 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_KF5_USE_QFONT")); + static const bool bUseCairo = (nullptr == getenv("SAL_VCL_QT_USE_QFONT")); std::unique_ptr<char* []> pFakeArgv; std::unique_ptr<int> pFakeArgc;