[libreoffice] adjust patch to apply

Caolan McNamara caolanm at fedoraproject.org
Thu Oct 27 14:16:13 UTC 2011


commit 375ba1f096d620518336a807c042b386b1bd33a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 27 15:16:08 2011 +0100

    adjust patch to apply

 ...o-32665-handle-that-FreeSerif-lacks-some-.patch |  146 +++++++++-----------
 ...o-41556-font-sub-cache-of-nameA-nameB-is-.patch |   76 ----------
 libreoffice.spec                                   |    6 +-
 3 files changed, 66 insertions(+), 162 deletions(-)
---
diff --git a/0001-Resolves-fdo-32665-handle-that-FreeSerif-lacks-some-.patch b/0001-Resolves-fdo-32665-handle-that-FreeSerif-lacks-some-.patch
index 62c19c7..afc626d 100644
--- a/0001-Resolves-fdo-32665-handle-that-FreeSerif-lacks-some-.patch
+++ b/0001-Resolves-fdo-32665-handle-that-FreeSerif-lacks-some-.patch
@@ -23,36 +23,36 @@ way there by excluding such cases from the caches.
 
 diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
 index be91349..a4f5f7f 100644
---- a/vcl/generic/fontmanager/fontconfig.cxx
-+++ b/vcl/generic/fontmanager/fontconfig.cxx
-@@ -68,6 +68,9 @@ using namespace psp;
- #ifndef FC_EMBOLDEN
-     #define FC_EMBOLDEN "embolden"
- #endif
-+#ifndef FC_MATRIX
-+    #define FC_MATRIX "matrix"
-+#endif
- #ifndef FC_FONTFORMAT
-     #define FC_FONTFORMAT "fontformat"
- #endif
-@@ -747,7 +750,7 @@ static void addtopattern(FcPattern *pPattern,
+--- a/vcl/unx/source/fontmanager/fontconfig.cxx
++++ b/vcl/unx/source/fontmanager/fontconfig.cxx
+@@ -68,6 +68,9 @@
+     #ifndef FC_EMBOLDEN
+         #define FC_EMBOLDEN "embolden"
+     #endif
++    #ifndef FC_MATRIX
++        #define FC_MATRIX "matrix"
++    #endif
+     #ifndef FC_FONTFORMAT
+         #define FC_FONTFORMAT "fontformat"
+     #endif
+@@ -1260,7 +1263,7 @@
  rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
      rtl::OUString& rMissingCodes, const rtl::OString &rLangAttrib,
-     FontItalic &rItalic, FontWeight &rWeight,
--    FontWidth &rWidth, FontPitch &rPitch) const
-+    FontWidth &rWidth, FontPitch &rPitch, bool &rEmbolden, ItalicMatrix &rMatrix) const
+     italic::type &rItalic, weight::type &rWeight,
+-    width::type &rWidth, pitch::type &rPitch) const
++    width::type &rWidth, pitch::type &rPitch, bool &rEmbolden, ItalicMatrix &rMatrix) const
  {
      rtl::OUString aName;
      FontCfgWrapper& rWrapper = FontCfgWrapper::get();
-@@ -834,6 +837,17 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
+@@ -1353,6 +1356,17 @@
                      rPitch = convertSpacing(val);
-                 if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WIDTH, 0, &val))
+                 if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WIDTH, 0, &val))
                      rWidth = convertWidth(val);
 +                FcBool bEmbolden;
-+                if (FcResultMatch == FcPatternGetBool(pSet->fonts[0], FC_EMBOLDEN, 0, &bEmbolden))
++                if (FcResultMatch == rWrapper.FcPatternGetBool(pSet->fonts[0], FC_EMBOLDEN, 0, &bEmbolden))
 +                    rEmbolden = bEmbolden;
 +                FcMatrix *pMatrix = 0;
-+                if (FcResultMatch == FcPatternGetMatrix(pSet->fonts[0], FC_MATRIX, 0, &pMatrix))
++                if (FcResultMatch == rWrapper.FcPatternGetMatrix(pSet->fonts[0], FC_MATRIX, 0, &pMatrix))
 +                {
 +                    rMatrix.xx = pMatrix->xx;
 +                    rMatrix.xy = pMatrix->xy;
@@ -62,39 +62,30 @@ index be91349..a4f5f7f 100644
              }
  
              // update rMissingCodes by removing resolved unicodes
-@@ -844,7 +858,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
-                 FcCharSet* unicodes;
-                 if (!FcPatternGetCharSet(pSet->fonts[0], FC_CHARSET, 0, &unicodes))
-                 {
--                       for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
-+                    for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
-                     {
-                         // also handle unicode surrogates
-                         const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex );
 diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
 index 3bf2d07..2d187b1 100644
---- a/vcl/generic/fontmanager/fontsubst.cxx
-+++ b/vcl/generic/fontmanager/fontsubst.cxx
-@@ -127,10 +127,14 @@ static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData
-     FontWeight eWeight = rFontSelData.GetWeight();
-     FontWidth eWidth = rFontSelData.GetWidthType();
-     FontPitch ePitch = rFontSelData.GetPitch();
+--- a/vcl/unx/source/gdi/salgdi3.cxx
++++ b/vcl/unx/source/gdi/salgdi3.cxx
+@@ -1526,8 +1526,14 @@
+         }
+     }
+ 
 +    bool bEmbolden = rFontSelData.mbEmbolden;
 +    ItalicMatrix aMatrix = rFontSelData.maItalicMatrix;
- 
++
      const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
 -    aRet.maSearchName = rMgr.Substitute( rFontSelData.maTargetName, rMissingCodes, aLangAttrib, eItalic, eWeight, eWidth, ePitch);
 +    aRet.maSearchName = rMgr.Substitute( rFontSelData.maTargetName, rMissingCodes, aLangAttrib, eItalic, eWeight, eWidth, ePitch, bEmbolden, aMatrix );
- 
++
 +    aRet.maItalicMatrix = aMatrix;
 +    aRet.mbEmbolden  = bEmbolden;
-     aRet.meItalic    = eItalic;
-     aRet.meWeight    = eWeight;
-     aRet.meWidthType = eWidth;
+ 
+     switch (eItalic)
+     {
 diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
 index 5322b65..fa712bb 100644
---- a/vcl/generic/glyphs/glyphcache.cxx
-+++ b/vcl/generic/glyphs/glyphcache.cxx
+--- a/vcl/source/glyphs/glyphcache.cxx
++++ b/vcl/source/glyphs/glyphcache.cxx
 @@ -163,6 +163,13 @@ bool GlyphCache::IFSD_Equal::operator()( const ImplFontSelectData& rA, const Imp
          != STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName)
          return false;
@@ -111,31 +102,8 @@ index 5322b65..fa712bb 100644
  
 diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
 index faf2b00..857d944 100644
---- a/vcl/inc/outfont.hxx
-+++ b/vcl/inc/outfont.hxx
-@@ -156,6 +156,22 @@ friend class ImplDevFontListData;
- // - ImplFontSelectData -
- // ----------------------
- 
-+struct ItalicMatrix
-+{
-+    double xx, xy, yx, yy;
-+    ItalicMatrix() : xx(1), xy(0), yx(0), yy(1) {}
-+};
-+
-+inline bool operator ==(const ItalicMatrix& a, const ItalicMatrix& b)
-+{
-+    return a.xx == b.xx && a.xy == b.xy && a.yx == b.yx && a.yy == b.yy;
-+}
-+
-+inline bool operator !=(const ItalicMatrix& a, const ItalicMatrix& b)
-+{
-+    return a.xx != b.xx || a.xy != b.xy || a.yx != b.yx || a.yy != b.yy;
-+}
-+
- class ImplFontSelectData : public ImplFontAttributes
- {
- public:
+--- a/vcl/inc/vcl/outfont.hxx
++++ b/vcl/inc/vcl/outfont.hxx
 @@ -175,6 +191,9 @@ public: // TODO: change to private
      bool                mbVertical;         // vertical mode of requested font
      bool                mbNonAntialiased;   // true if antialiasing is disabled
@@ -150,20 +118,12 @@ diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
 index 0af5e14..4a110ad 100644
 --- a/vcl/inc/vcl/fontmanager.hxx
 +++ b/vcl/inc/vcl/fontmanager.hxx
-@@ -37,6 +37,7 @@
- #include "vcl/dllapi.h"
- #include "vcl/helper.hxx"
- #include "vcl/vclenum.hxx"
-+#include "outfont.hxx"
- #include "com/sun/star/lang/Locale.hpp"
- 
- #include <vector>
-@@ -649,7 +650,7 @@ public:
+@@ -737,7 +737,7 @@
  
      rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
-         const rtl::OString& rLangAttrib, FontItalic& rItalic, FontWeight& rWeight,
--        FontWidth& rWidth, FontPitch& rPitch) const;
-+        FontWidth& rWidth, FontPitch& rPitch, bool &rEmboldening, ItalicMatrix &rMatrix) const;
+         const rtl::OString& rLangAttrib, italic::type& rItalic, weight::type& rWeight,
+-        width::type& rWidth, pitch::type& rPitch) const;
++        width::type& rWidth, pitch::type& rPitch, bool &rEmboldening, ItalicMatrix &rMatrix) const;
      bool hasFontconfig() const { return m_bFontconfigSuccess; }
  
      int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
@@ -280,7 +240,29 @@ index b0f59cd..3cc438c 100755
 +
      return true;
  }
- 
--- 
-1.7.6.4
 
+--- a/vcl/inc/vcl/vclenum.hxx	2011-10-27 15:10:10.402317337 +0100
++++ b/vcl/inc/vcl/vclenum.hxx	2011-10-27 15:10:29.561528762 +0100
+@@ -326,6 +326,22 @@
+ 
+ #endif
+ 
++struct ItalicMatrix
++{
++    double xx, xy, yx, yy;
++    ItalicMatrix() : xx(1), xy(0), yx(0), yy(1) {}
++};
++
++inline bool operator ==(const ItalicMatrix& a, const ItalicMatrix& b)
++{
++    return a.xx == b.xx && a.xy == b.xy && a.yx == b.yx && a.yy == b.yy;
++}
++
++inline bool operator !=(const ItalicMatrix& a, const ItalicMatrix& b)
++{
++    return a.xx != b.xx || a.xy != b.xy || a.yx != b.yx || a.yy != b.yy;
++}
++
+ #endif	// _VCL_VCLENUM_HXX
+ 
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/libreoffice.spec b/libreoffice.spec
index 5523ad6..b65a14d 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -123,8 +123,7 @@ Patch27: 0001-Related-fdo-37195-migrationoo3-not-registered.patch
 Patch28: 0001-Resolves-rhbz-738255-avoid-crash-on-NULL-pointer.patch
 Patch29: 0001-avoid-using-com.sun.org-apis.patch
 Patch30: 0001-add-Oracle-Java-1.7.0-recognition.patch
-Patch31: 0001-Resolves-fdo-41556-font-sub-cache-of-nameA-nameB-is-.patch
-Patch32: 0001-Resolves-fdo-32665-handle-that-FreeSerif-lacks-some-.patch
+Patch31: 0001-Resolves-fdo-32665-handle-that-FreeSerif-lacks-some-.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -797,8 +796,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch28 -p1 -b .rhbz738255-avoid-crash-on-NULL-pointer.patch
 %patch29 -p1 -b .avoid-using-com.sun.org-apis.patch
 %patch30 -p1 -b .add-Oracle-Java-1.7.0-recognition.patch
-%patch31 -p1 -b .fdo41556-font-sub-cache-of-nameA-nameB-is-.patch
-%patch32 -p1 -b .fdo32665-handle-that-FreeSerif-lacks-some-.patch
+%patch31 -p1 -b .fdo32665-handle-that-FreeSerif-lacks-some-.patch
 
 # these are horribly incomplete--empty translations and copied english
 # strings with spattering of translated strings


More information about the scm-commits mailing list