summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-11-07 12:03:33 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-11-07 21:11:53 +0100
commit1ad3f06427fc6c9da106666768fdf5b16a7bfc6b (patch)
treede6e607fd345f5753ef7ce1e9d60abc6678472dd /vcl/inc
parentf71427293fcf85818dda72b295177259c41fb80a (diff)
Fix harfbuzz font lifecycle in CommonSalLayout
The harfbuzz font is attached to the system font face and therefore inherits its lifecycle. This means it can be used in multiple CommonSalLayout objects, so the user data parameter of hb_face_create_for_tables can't be the layout, but must be the font. This moves the special Qt5Font handling into it's own function, so accessing the switching parameter mbUseQt5 is not needed. Regression from commit b66a7cbd8491fe436126e11975c360f47ae346ed. Change-Id: Ic34cc5b60e401562c73b239a58176a59fe4bf9be Reviewed-on: https://gerrit.libreoffice.org/44398 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/CommonSalLayout.hxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index a8808bac8414..0947f9eaba2c 100644
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -60,7 +60,12 @@ class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout
#if ENABLE_QT5
const bool mbUseQt5;
Qt5Font* mpQFont;
+
+ explicit CommonSalLayout(const FontSelectPattern &rFSP,
+ FreetypeFont *pFreetypeFont,
+ Qt5Font *pFont, bool bUseQt5);
#endif
+ void InitFromFreetypeFont();
#endif
void ParseFeatures(const OUString& name);
@@ -88,9 +93,6 @@ public:
explicit CommonSalLayout(FreetypeFont&);
const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; }
#if ENABLE_QT5
- explicit CommonSalLayout(const FontSelectPattern &rFSP,
- FreetypeFont *pFreetypeFont,
- Qt5Font *pFont, bool bUseQt5);
explicit CommonSalLayout(Qt5Font&);
const Qt5Font* getQt5Font() const { return mpQFont; }
bool useQt5() const { return mbUseQt5; }