[iOS] Fix build failure in WebCore::findEndWordBoundary()
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 04:13:43 +0000 (04:13 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 04:13:43 +0000 (04:13 +0000)
Filed Bug 126830 for the proper fix:
<http://webkit.org/b/126830>

* editing/VisibleUnits.cpp:
(WebCore::endWordBoundary): Switch back to using
WebCore::findWordBoundary() on iOS.

* platform/text/mac/TextBoundaries.mm:
(WebCore::findEndWordBoundary): Add FIXME for iOS implementation
that doesn't use NSAttributedString.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161795 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/platform/text/mac/TextBoundaries.mm

index ac931baf89c51431294daebdb5363a04e7e9a9ce..77d7b3791d0056503ecb17d1eafe9689740ddd76 100644 (file)
@@ -1,3 +1,18 @@
+2014-01-11  David Kilzer  <ddkilzer@apple.com>
+
+        [iOS] Fix build failure in WebCore::findEndWordBoundary()
+
+        Filed Bug 126830 for the proper fix:
+        <http://webkit.org/b/126830>
+
+        * editing/VisibleUnits.cpp:
+        (WebCore::endWordBoundary): Switch back to using
+        WebCore::findWordBoundary() on iOS.
+
+        * platform/text/mac/TextBoundaries.mm:
+        (WebCore::findEndWordBoundary): Add FIXME for iOS implementation
+        that doesn't use NSAttributedString.
+
 2014-01-11  Andy Estes  <aestes@apple.com>
 
         [iOS] Move text autosizing code from RenderBlock to RenderBlockFlow
index 80ebf317cf434b5f2349e91a72c9852f30e966a6..780c699ac970f5019545786e86ab8fb8995e04b7 100644 (file)
@@ -658,8 +658,14 @@ static unsigned endWordBoundary(const UChar* characters, unsigned length, unsign
         return length;
     }
     needMoreContext = false;
+#if PLATFORM(IOS)
+    // FIXME: Bug 126830: [iOS] Implement WebCore::findEndWordBoundary()
+    int start, end;
+    findWordBoundary(characters, length, offset, &start, &end);
+#else
     int end;
     findEndWordBoundary(characters, length, offset, &end);
+#endif
     return end;
 }
 
index 336d7f5e1662be7a701c4fc06b8694f26ff53c72..77743d212e4b7a50070aed737e47eaa7dd749cba 100644 (file)
@@ -247,6 +247,7 @@ void findWordBoundary(const UChar* chars, int len, int position, int* start, int
 
 void findEndWordBoundary(const UChar* chars, int len, int position, int* end)
 {
+#if !PLATFORM(IOS)
     NSString* string = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(chars)
         length:len freeWhenDone:NO];
     NSAttributedString* attr = [[NSAttributedString alloc] initWithString:string];
@@ -254,6 +255,13 @@ void findEndWordBoundary(const UChar* chars, int len, int position, int* end)
     [attr release];
     [string release];
     *end = range.location + range.length;
+#else
+    // FIXME: Bug 126830: [iOS] Implement WebCore::findEndWordBoundary()
+    UNUSED_PARAM(chars);
+    UNUSED_PARAM(len);
+    UNUSED_PARAM(position);
+    UNUSED_PARAM(end);
+#endif
 }
 
 int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward)