[Libreoffice-commits] core.git: Branch 'feature/qt5' - vcl/CustomTarget_kf5_moc.mk vcl/inc vcl/source vcl/unx

Jan-Marek Glogowski glogow at fbihome.de
Fri Nov 3 17:49:31 UTC 2017


 vcl/CustomTarget_kf5_moc.mk                    |   22 ------------
 vcl/inc/CommonSalLayout.hxx                    |   19 ++++------
 vcl/inc/jobset.h                               |    2 -
 vcl/inc/salgdi.hxx                             |    2 -
 vcl/inc/unx/glyphcache.hxx                     |    2 -
 vcl/source/gdi/CommonSalLayout.cxx             |   45 +++++++++++++------------
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |    2 -
 7 files changed, 37 insertions(+), 57 deletions(-)

New commits:
commit 868d27410d3aae8cd0a8aae70be201b671df091b
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Nov 3 18:43:30 2017 +0100

    Fix multiple problems
    
    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

diff --git a/vcl/CustomTarget_kf5_moc.mk b/vcl/CustomTarget_kf5_moc.mk
deleted file mode 100644
index f636ef5d125c..000000000000
--- a/vcl/CustomTarget_kf5_moc.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kf5))
-
-$(call gb_CustomTarget_get_target,vcl/unx/kf5) : \
-	$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Timer.moc \
-	$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Widget.moc \
-
-$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/%.moc : \
-		$(SRCDIR)/vcl/unx/kf5/%.hxx \
-		| $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/.dir
-	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1)
-	$(MOC5) $< -o $@
-
-# vim: set noet sw=4:
diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index a44fee5cfe10..a8808bac8414 100644
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -45,13 +45,6 @@ class Qt5Font;
 
 class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout
 {
-#if ENABLE_QT5
-    friend hb_blob_t*       getFontTable(hb_face_t*, hb_tag_t, void*);
-    explicit                CommonSalLayout(const FontSelectPattern &rFSP,
-                                            FreetypeFont *pFreetypeFont,
-                                            Qt5Font *pFont, bool bUseQt5);
-#endif
-
     hb_font_t*              mpHbFont;
     const FontSelectPattern& mrFontSelData;
     css::uno::Reference<css::i18n::XBreakIterator> mxBreak;
@@ -84,19 +77,23 @@ class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout
 public:
 #if defined(_WIN32)
     explicit                CommonSalLayout(HDC, WinFontInstance&, const WinFontFace&);
-    const FontSelectPattern& getFontSelData() const { return mrFontSelData; };
+    const FontSelectPattern& getFontSelData() const { return mrFontSelData; }
     HFONT                   getHFONT() const { return mhFont; }
     WinFontInstance&        getWinFontInstance() const { return mrWinFontInstance; }
     bool                    hasHScale() const;
 #elif defined(MACOSX) || defined(IOS)
     explicit                CommonSalLayout(const CoreTextStyle&);
-    const CoreTextStyle&    getFontData() const { return mrCoreTextStyle; };
+    const CoreTextStyle&    getFontData() const { return mrCoreTextStyle; }
 #else
     explicit                CommonSalLayout(FreetypeFont&);
-    const FreetypeFont*     getFreetypeFont() const { return mpFreetypeFont; };
+    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; };
+    const Qt5Font*          getQt5Font() const { return mpQFont; }
+    bool                    useQt5() const { return mbUseQt5; }
 #endif
 #endif
 
diff --git a/vcl/inc/jobset.h b/vcl/inc/jobset.h
index dc04e9a54bd1..5ff4c38e9a24 100644
--- a/vcl/inc/jobset.h
+++ b/vcl/inc/jobset.h
@@ -29,7 +29,7 @@
 #define JOBSETUP_SYSTEM_UNIX        3
 #define JOBSETUP_SYSTEM_MAC         4
 
-class VCL_PLUGIN_PUBLIC ImplJobSetup
+class VCL_DLLPUBLIC ImplJobSetup
 {
 private:
     sal_uInt16      mnSystem;           //< System - JOBSETUP_SYSTEM_xxxx
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index a368630ebd74..1a9157ca9747 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_VCL_INC_SALGDI_HXX
 
 #include <vcl/metric.hxx>
-#include <vcl/sysdata.hxx>
 
 #include "impfontmetricdata.hxx"
 #include "salgdiimpl.hxx"
@@ -46,6 +45,7 @@ class OpenGLContext;
 class OutputDevice;
 class FreetypeFont;
 class CommonSalLayout;
+struct SystemGraphicsData;
 
 #if ENABLE_CAIRO_CANVAS
 struct SystemFontData;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index df183dba2056..c512628862fa 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -133,7 +133,7 @@ public:
     const FontSelectPattern& GetFontSelData() const      { return maFontSelData; }
 
     void                    GetFontMetric(ImplFontMetricDataRef const &) const;
-    const unsigned char*    GetTable( const char* pName, sal_uLong* pLength );
+    const unsigned char*    GetTable( const char* pName, sal_uLong* pLength ) const;
     const FontCharMapRef    GetFontCharMap() const;
     bool                    GetFontCapabilities(vcl::FontCapabilities &) const;
 
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
 
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 57393255bcee..5a55ee47bff3 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -973,7 +973,7 @@ bool FreetypeFont::GetGlyphOutline(const GlyphItem& rGlyph,
     return true;
 }
 
-const unsigned char* FreetypeFont::GetTable(const char* pName, sal_uLong* pLength)
+const unsigned char* FreetypeFont::GetTable(const char* pName, sal_uLong* pLength) const
 {
     return mpFontInfo->GetTable( pName, pLength );
 }


More information about the Libreoffice-commits mailing list