[Libreoffice-commits] core.git: vcl/README.vars vcl/unx
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Sun Apr 11 19:15:27 UTC 2021
vcl/README.vars | 4 ++++
vcl/unx/kf5/KF5SalInstance.cxx | 8 +++++---
vcl/unx/kf5/KF5SalInstance.hxx | 2 +-
3 files changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 7a0e0a84a02f505200331c19b28d45e898cd5a12
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sun Apr 11 14:09:09 2021 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sun Apr 11 21:14:45 2021 +0200
KF5 allow changing the font backend to QFont
Implements SAL_VCL_KF5_USE_QFONT to switch the used font backend,
like SAL_VCL_QT5_USE_CAIRO for the qt5 backend.
Change-Id: If3f163973c2e251eafe3bd734fd7525a8127cbcf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113946
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/vcl/README.vars b/vcl/README.vars
index 4b2e326d67ef..60551e1e4173 100644
--- a/vcl/README.vars
+++ b/vcl/README.vars
@@ -58,3 +58,7 @@ 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)
diff --git a/vcl/unx/kf5/KF5SalInstance.cxx b/vcl/unx/kf5/KF5SalInstance.cxx
index c1ee2f61a48d..1335d4123a2e 100644
--- a/vcl/unx/kf5/KF5SalInstance.cxx
+++ b/vcl/unx/kf5/KF5SalInstance.cxx
@@ -33,8 +33,8 @@
using namespace com::sun::star;
-KF5SalInstance::KF5SalInstance(std::unique_ptr<QApplication>& pQApp)
- : Qt5Instance(pQApp, true)
+KF5SalInstance::KF5SalInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo)
+ : Qt5Instance(pQApp, bUseCairo)
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->maAppData.mxToolkitName = OUString("kf5");
@@ -82,6 +82,8 @@ KF5SalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> co
extern "C" {
VCLPLUG_KF5_PUBLIC SalInstance* create_SalInstance()
{
+ static const bool bUseCairo = (nullptr == getenv("SAL_VCL_KF5_USE_QFONT"));
+
std::unique_ptr<char* []> pFakeArgv;
std::unique_ptr<int> pFakeArgc;
std::vector<FreeableCStr> aFakeArgvFreeable;
@@ -90,7 +92,7 @@ VCLPLUG_KF5_PUBLIC SalInstance* create_SalInstance()
std::unique_ptr<QApplication> pQApp
= Qt5Instance::CreateQApplication(*pFakeArgc, pFakeArgv.get());
- KF5SalInstance* pInstance = new KF5SalInstance(pQApp);
+ KF5SalInstance* pInstance = new KF5SalInstance(pQApp, bUseCairo);
pInstance->MoveFakeCmdlineArgs(pFakeArgv, pFakeArgc, aFakeArgvFreeable);
new Qt5Data(pInstance);
diff --git a/vcl/unx/kf5/KF5SalInstance.hxx b/vcl/unx/kf5/KF5SalInstance.hxx
index 1d9ed8bc5d92..635f51ec9bc7 100644
--- a/vcl/unx/kf5/KF5SalInstance.hxx
+++ b/vcl/unx/kf5/KF5SalInstance.hxx
@@ -32,7 +32,7 @@ class KF5SalInstance final : public Qt5Instance
SalFrame* CreateChildFrame(SystemParentData* pParent, SalFrameStyleFlags nStyle) override;
public:
- explicit KF5SalInstance(std::unique_ptr<QApplication>& pQApp);
+ explicit KF5SalInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list