diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-11-03 18:43:30 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-06 12:05:50 +0100 |
commit | 0b1e8399df0045fe900d5558afc8590114d4b922 (patch) | |
tree | 7376fc4ce608266439bc57a91439386d9db5b902 /vcl/source/gdi | |
parent | e8526657a20b6c9c25cf885a7f6caa6bb38e3f7c (diff) |
QT5 fix build issues & cleanups
1. Linking problem on Windows due to Windows macros via
<vcl/sysdata.hxx> include
2. Drop the custom MOC target for the old KF5 plugin
3. Correctly handle QT5 build without using QFont
4. ImplJobSetup is in the VL library, not the gen plugin
Change-Id: Iad97b1b9b57a8c356aaa88178aff03d0c14558c7
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 936369983d14..2871b99c7ddb 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -32,11 +32,9 @@ #if ENABLE_QT5 #include <qt5/Qt5Font.hxx> #include <QtGui/QRawFont> -#else -class Qt5Font; #endif -hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData) +static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData) { char pTagName[5]; pTagName[0] = (char)(nTableTag >> 24); @@ -70,12 +68,12 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData } #else const char* pBuffer = nullptr; -#if ENABLE_QT5 CommonSalLayout *pLayout = static_cast<CommonSalLayout*>( pUserData ); +#if ENABLE_QT5 QByteArray aTable; - if ( pLayout->mbUseQt5 ) + if ( pLayout->useQt5() ) { - QRawFont aRawFont( QRawFont::fromFont( *pLayout->mpQFont ) ); + QRawFont aRawFont( QRawFont::fromFont( *pLayout->getQt5Font() ) ); aTable = aRawFont.fontTable( pTagName ); pBuffer = reinterpret_cast<const char*>( aTable.data() ); nLength = aTable.size(); @@ -83,9 +81,8 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData else #endif { - FreetypeFont* pFont = static_cast<FreetypeFont*>(pUserData); pBuffer = reinterpret_cast<const char*>( - pFont->GetTable(pTagName, &nLength) ); + pLayout->getFreetypeFont()->GetTable(pTagName, &nLength) ); } #endif @@ -282,27 +279,35 @@ CommonSalLayout::CommonSalLayout(const FontSelectPattern &rFSP, mpFreetypeFont->SetHbFont(mpHbFont); } } -#endif -CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) : - mrFontSelData(rFreetypeFont.GetFontSelData()) -, mpFreetypeFont(&rFreetypeFont) -, mpVertGlyphs(nullptr) +CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) + : CommonSalLayout(rFreetypeFont.GetFontSelData(), + &rFreetypeFont, nullptr, false) { - mpHbFont = rFreetypeFont.GetHbFont(); - if (!mpHbFont) - { - hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, &rFreetypeFont, nullptr); - mpHbFont = createHbFont(pHbFace); - } } -#if ENABLE_QT5 CommonSalLayout::CommonSalLayout(Qt5Font& rQFont) : CommonSalLayout(rQFont.GetFontSelData(), nullptr, &rQFont, true) { } + +#else // ! ENABLE_QT5 + +CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) + : mrFontSelData(rFreetypeFont.GetFontSelData()) + , mpFreetypeFont(&rFreetypeFont) + , mpVertGlyphs(nullptr) +{ + mpHbFont = mpFreetypeFont->GetHbFont(); + if (!mpHbFont) + { + hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, this, nullptr); + mpHbFont = createHbFont(pHbFace); + mpFreetypeFont->SetHbFont(mpHbFont); + } +} + #endif #endif |