[libreoffice/f21] fix patch

Caolán McNamara caolanm at fedoraproject.org
Fri Jan 30 20:41:35 UTC 2015


commit 5b33c97f178e4318b8335502f860c59b4968ee17
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 30 20:41:18 2015 +0000

    fix patch

 ...-font-names-of-apparent-script-suffixes-a.patch |   78 +++++++++-----------
 1 files changed, 35 insertions(+), 43 deletions(-)
---
diff --git a/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch b/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch
index a6181d5..fc24346 100644
--- a/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch
+++ b/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch
@@ -1,4 +1,4 @@
-From 15e1c881684c0127c0ca989924bbf2508b4fd780 Mon Sep 17 00:00:00 2001
+From a771f5e490bb14d81378b57fa096c4a30b29fc28 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
 Date: Mon, 26 Jan 2015 15:00:29 +0000
 Subject: [PATCH] don't strip font names of apparent script suffixes anymore
@@ -16,57 +16,49 @@ left alone now.
 
 Change-Id: Ibb704048d63b33ce510d6b1076700c6e94a0af2a
 ---
- unotools/qa/unit/testGetEnglishSearchName.cxx | 7 +++----
- unotools/source/misc/fontdefs.cxx             | 2 --
- vcl/generic/fontmanager/fontcache.cxx         | 2 +-
- 3 files changed, 4 insertions(+), 7 deletions(-)
+ unotools/source/misc/fontdefs.cxx | 29 +----------------------------
+ 1 file changed, 1 insertion(+), 28 deletions(-)
 
-diff --git a/unotools/qa/unit/testGetEnglishSearchName.cxx b/unotools/qa/unit/testGetEnglishSearchName.cxx
-index dbc8b17..c9d8e1f 100644
---- a/unotools/qa/unit/testGetEnglishSearchName.cxx
-+++ b/unotools/qa/unit/testGetEnglishSearchName.cxx
-@@ -39,12 +39,11 @@ void Test::testSingleElement()
-         //trailingWhitespaces
-         test1 = GetEnglishSearchFontName( "Symbol    " );
-         CPPUNIT_ASSERT_EQUAL(OUString("symbol"),test1);
--        //removing Skripts
-+        //no longer remove script suffixes
-         test1 = GetEnglishSearchFontName( "Symbol(SIP)" );
-         CPPUNIT_ASSERT_EQUAL(OUString("symbol(sip)"),test1);
--        //remove Whitespaces between
--        test1 = GetEnglishSearchFontName( "Symbol (thai)" );
--        CPPUNIT_ASSERT_EQUAL( OUString("symbol"),test1);
-+        test1 = GetEnglishSearchFontName( "CM Roman CE" );
-+        CPPUNIT_ASSERT_EQUAL( OUString("cmromance"),test1);
-         //remove special characters; leave semicolon, numbers
-         test1 = GetEnglishSearchFontName( "sy;mb?=ol129" );
-         CPPUNIT_ASSERT_EQUAL( OUString("sy;mbol129"),test1);
 diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
-index f368cc6..04c6fc4 100644
+index 61f6a07..006ab90 100644
 --- a/unotools/source/misc/fontdefs.cxx
 +++ b/unotools/source/misc/fontdefs.cxx
-@@ -367,8 +367,6 @@ OUString GetEnglishSearchFontName(const OUString& rInName)
+@@ -332,34 +332,7 @@ void GetEnglishSearchFontName( OUString& rName )
      if ( i != nLen )
-          rName.truncate(i);
+         rName = rName.copy( 0, i );
  
 -    // Remove Script at the end
--    rName = StripScriptFromName(rName.toString());
-     nLen = rName.getLength();
+-    // Scriptname must be the last part of the fontname and
+-    // looks like "fontname (scriptname)". So there can only be a
+-    // script name at the and of the fontname, when the last char is ')'
+-    if ( (nLen >= 3) && rName[ nLen-1 ] == ')' )
+-    {
+-        int nOpen = 1;
+-        sal_Int32 nTempLen = nLen-2;
+-        while ( nTempLen )
+-        {
+-            if ( rName[ nTempLen ] == '(' )
+-            {
+-                nOpen--;
+-                if ( !nOpen )
+-                {
+-                    // Remove Space at the end
+-                    if ( nTempLen && (rName[ nTempLen-1 ] == ' ') )
+-                        nTempLen--;
+-                    rName = rName.copy( 0, nTempLen );
+-                    nLen = nTempLen;
+-                    break;
+-                }
+-            }
+-            if ( rName[ nTempLen ] == ')' )
+-                nOpen++;
+-            nTempLen--;
+-        }
+-    }
++    nLen = rName.getLength();
  
      // remove all whitespaces and converts to lower case ASCII
-diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx
-index 56a15bf..e978eb7 100644
---- a/vcl/generic/fontmanager/fontcache.cxx
-+++ b/vcl/generic/fontmanager/fontcache.cxx
-@@ -38,7 +38,7 @@
- #endif
- 
- #define FONTCACHEFILE "/user/psprint/pspfontcache"
--#define CACHE_MAGIC "LibreOffice PspFontCacheFile format 5"
-+#define CACHE_MAGIC "LibreOffice PspFontCacheFile format 6"
- 
- using namespace std;
- using namespace psp;
+     // TODO: better transliteration to ASCII e.g. all digits
 -- 
 1.9.3
 


More information about the scm-commits mailing list