[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

mitz at apple.com mitz at apple.com
Fri Jan 21 14:36:22 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 4feb06215314661a02bcbed0af09b87f6e88246d
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 23 01:35:51 2010 +0000

    Replace runtime checks for hyphenation API availability with compile-time checks.
    
    Reviewed by Darin Adler.
    
    * platform/text/cf/HyphenationCF.cpp:
    (WebCore::::createValueForNullKey): Changed to use CFLocaleCopyCurrent() instead of using the
    search locale, which is empty on Windows. On Mac, this is equivalent to using the search locale.
    (WebCore::canHyphenate): Added this implementation for when the hyphenation API is not available.
    It is identical to the implementation in Hyphenation.cpp.
    (WebCore::lastHyphenLocation): Ditto.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74526 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2452ffc..31edc74 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-22  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Replace runtime checks for hyphenation API availability with compile-time checks.
+
+        * platform/text/cf/HyphenationCF.cpp:
+        (WebCore::::createValueForNullKey): Changed to use CFLocaleCopyCurrent() instead of using the
+        search locale, which is empty on Windows. On Mac, this is equivalent to using the search locale.
+        (WebCore::canHyphenate): Added this implementation for when the hyphenation API is not available.
+        It is identical to the implementation in Hyphenation.cpp.
+        (WebCore::lastHyphenLocation): Ditto.
+
 2010-12-22  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/text/cf/HyphenationCF.cpp b/WebCore/platform/text/cf/HyphenationCF.cpp
index 0866cfd..3adacad 100644
--- a/WebCore/platform/text/cf/HyphenationCF.cpp
+++ b/WebCore/platform/text/cf/HyphenationCF.cpp
@@ -33,45 +33,14 @@
 #include <wtf/ListHashSet.h>
 #include <wtf/RetainPtr.h>
 
-#if PLATFORM(WIN)
-
-#include "SoftLinking.h"
-
-#ifdef DEBUG_ALL
-SOFT_LINK_DEBUG_LIBRARY(CoreFoundation)
-#else
-SOFT_LINK_LIBRARY(CoreFoundation)
-#endif
-
-SOFT_LINK_OPTIONAL(CoreFoundation, CFStringGetHyphenationLocationBeforeIndex, CFIndex, , (CFStringRef string, CFIndex location, CFRange limitRange, CFOptionFlags options, CFLocaleRef locale, UTF32Char *character))
-SOFT_LINK_OPTIONAL(CoreFoundation, CFStringIsHyphenationAvailableForLocale, Boolean, , (CFLocaleRef locale))
-
-static CFIndex wkCFStringGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex location, CFRange limitRange, CFOptionFlags options, CFLocaleRef locale, UTF32Char *character)
-{
-    static CFStringGetHyphenationLocationBeforeIndexPtrType cfStringGetHyphenationLocationBeforeIndex = CFStringGetHyphenationLocationBeforeIndexPtr();
-    if (!cfStringGetHyphenationLocationBeforeIndex)
-        return kCFNotFound;
-    return cfStringGetHyphenationLocationBeforeIndex(string, location, limitRange, options, locale, character);
-}
-
-static Boolean wkCFStringIsHyphenationAvailableForLocale(CFLocaleRef locale)
-{
-    static CFStringIsHyphenationAvailableForLocalePtrType cfStringIsHyphenationAvailableForLocale = CFStringIsHyphenationAvailableForLocalePtr();
-    return cfStringIsHyphenationAvailableForLocale && cfStringIsHyphenationAvailableForLocale(locale);
-}
-
-#define CFStringGetHyphenationLocationBeforeIndex wkCFStringGetHyphenationLocationBeforeIndex
-#define CFStringIsHyphenationAvailableForLocale wkCFStringIsHyphenationAvailableForLocale
-
-#endif // PLATFORM(WIN)
-
 namespace WebCore {
 
+#if !PLATFORM(WIN) || (defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
+
 template<>
 RetainPtr<CFLocaleRef> AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef> >::createValueForNullKey()
 {
-    RetainPtr<CFStringRef> cfLocaleIdentifier(AdoptCF, CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(currentSearchLocaleID()), strlen(currentSearchLocaleID()), kCFStringEncodingASCII, false, kCFAllocatorNull));
-    RetainPtr<CFLocaleRef> locale(AdoptCF, CFLocaleCreate(kCFAllocatorDefault, cfLocaleIdentifier.get()));
+    RetainPtr<CFLocaleRef> locale(AdoptCF, CFLocaleCopyCurrent());
 
     return CFStringIsHyphenationAvailableForLocale(locale.get()) ? locale : 0;
 }
@@ -107,6 +76,21 @@ size_t lastHyphenLocation(const UChar* characters, size_t length, size_t beforeI
     return result == kCFNotFound ? 0 : result;
 }
 
+#else
+
+bool canHyphenate(const AtomicString&)
+{
+    return false;
+}
+
+size_t lastHyphenLocation(const UChar*, size_t, size_t, const AtomicString&)
+{
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+#endif // PLATFORM(WIN) && (!defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
+
 } // namespace WebCore
 
 #endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list