harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r556672 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared: ParsingTables.cpp TypeDefinition.cpp TypeDefinition.h
Date Mon, 16 Jul 2007 17:09:25 GMT
Author: apetrenko
Date: Mon Jul 16 10:09:22 2007
New Revision: 556672

URL: http://svn.apache.org/viewvc?view=rev&rev=556672
Log:
Patch for HARMONY-4299 "[classlib][awt] Invalid font's style definition for TrueType fonts
in fontlib"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/ParsingTables.cpp
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/ParsingTables.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/ParsingTables.cpp?view=diff&rev=556672&r1=556671&r2=556672
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/ParsingTables.cpp
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/ParsingTables.cpp
Mon Jul 16 10:09:22 2007
@@ -377,21 +377,21 @@
 						}
 						subFamilyName[j] = 0;
 
-/*#ifdef WIN32
+//#ifdef WIN32
 
-#define COMPARE_IT		(!_wcsicmp((fwchar_t *)subFamilyName,L"Italic"))
-#define COMPARE_BD		(!_wcsicmp((fwchar_t *)subFamilyName,L"Bold"))
-#define COMPARE_BDIT	(!_wcsicmp((fwchar_t *)subFamilyName,L"Bold Italic"))
-#define COMPARE_REG		(!_wcsicmp((fwchar_t *)subFamilyName,L"Regular") || !_wcsicmp((fwchar_t
*)subFamilyName,L"Normal"))
+#define COMPARE_IT		(!fwcscmp((ufshort *)subFamilyName,"Italic"))
+#define COMPARE_BD		(!fwcscmp((ufshort *)subFamilyName,"Bold"))
+#define COMPARE_BDIT	(!fwcscmp((ufshort *)subFamilyName,"Bold Italic"))
+#define COMPARE_REG		(!fwcscmp((ufshort *)subFamilyName,"Regular") || !fwcscmp((fwchar_t
*)subFamilyName,"Normal"))
 
-#else*/
+/*#else
 
 #define COMPARE_IT		(compare((fwchar_t *)subFamilyName, "Italic"))
 #define COMPARE_BD		(compare((fwchar_t *)subFamilyName, "Bold"))
 #define COMPARE_BDIT	(compare((fwchar_t *)subFamilyName, "Bold Italic"))
 #define COMPARE_REG		(compare((fwchar_t *)subFamilyName, "Regular") || compare((fwchar_t
*)subFamilyName, "Normal"))
 
-//#endif
+#endif*/
 
 						if COMPARE_IT
 						{

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp?view=diff&rev=556672&r1=556671&r2=556672
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
Mon Jul 16 10:09:22 2007
@@ -33,10 +33,29 @@
 	return counter;
 }
 
+fint fwcscmp(fwchar_t* str1, fchar* str2)
+{
+    if (str1 == 0 || str2 == 0)
+        return (fint)(str1 - (fwchar_t*)str2);
+        
+	fwchar_t* tmpstr1 = str1; 
+	fchar* tmpstr2 = str2;
+	while(*tmpstr1 != 0 || *tmpstr2 !=0)
+	{
+        if (*tmpstr1 != (fwchar_t)(*tmpstr2))
+			return -1;
+
+		tmpstr1++;
+		tmpstr2++;
+	}
+
+	return 0;
+}
+
 fint fwcscmp(fwchar_t* str1, fwchar_t* str2)
 {
     if (str1 == 0 || str2 == 0)
-        return str1 - str2;
+        return (fint)(str1 - str2);
         
 	fwchar_t* tmpstr1 = str1; 
 	fwchar_t* tmpstr2 = str2;

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h?view=diff&rev=556672&r1=556671&r2=556672
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
Mon Jul 16 10:09:22 2007
@@ -30,6 +30,7 @@
 typedef unsigned short fwchar_t;
 
 fint fwcslen(fwchar_t* str);
+fint fwcscmp(fwchar_t* str1, fchar* str2);
 fint fwcscmp(fwchar_t* str1, fwchar_t* str2);
 
 #endif



Mime
View raw message