142 lines
4.6 KiB
Diff
142 lines
4.6 KiB
Diff
2010-03-22 Darin Adler <darin@apple.com>
|
|
|
|
Reviewed by Dan Bernstein.
|
|
|
|
TextBreakIteratorICU.cpp is incompatible with new UBreakIterator type in ICU 4.4
|
|
https://bugs.webkit.org/show_bug.cgi?id=36381
|
|
|
|
* platform/text/TextBreakIteratorICU.cpp:
|
|
(WebCore::setUpIterator): Use reinterpret_cast instead of static_cast or relying
|
|
on conversion to void*.
|
|
(WebCore::textBreakFirst): Ditto.
|
|
(WebCore::textBreakLast): Ditto.
|
|
(WebCore::textBreakNext): Ditto.
|
|
(WebCore::textBreakPrevious): Ditto.
|
|
(WebCore::textBreakPreceding): Ditto.
|
|
(WebCore::textBreakFollowing): Ditto.
|
|
(WebCore::textBreakCurrent): Ditto.
|
|
(WebCore::isTextBreak): Ditto.
|
|
(WebCore::setUpIteratorWithRules): Ditto.
|
|
|
|
2010-03-22 Eric Carlson <eric.carlson@apple.com>
|
|
|
|
Index: /trunk/WebCore/platform/text/TextBreakIteratorICU.cpp
|
|
===================================================================
|
|
--- /trunk/WebCore/platform/text/TextBreakIteratorICU.cpp (revision 50977)
|
|
+++ /trunk/WebCore/platform/text/TextBreakIteratorICU.cpp (revision 56345)
|
|
@@ -25,5 +25,4 @@
|
|
#include "PlatformString.h"
|
|
#include "TextBreakIteratorInternalICU.h"
|
|
-
|
|
#include <unicode/ubrk.h>
|
|
#include <wtf/Assertions.h>
|
|
@@ -39,5 +38,5 @@
|
|
if (!createdIterator) {
|
|
UErrorCode openStatus = U_ZERO_ERROR;
|
|
- iterator = static_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus));
|
|
+ iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus));
|
|
createdIterator = true;
|
|
ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
|
|
@@ -47,5 +46,5 @@
|
|
|
|
UErrorCode setTextStatus = U_ZERO_ERROR;
|
|
- ubrk_setText(iterator, string, length, &setTextStatus);
|
|
+ ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus);
|
|
if (U_FAILURE(setTextStatus))
|
|
return 0;
|
|
@@ -86,42 +85,42 @@
|
|
}
|
|
|
|
-int textBreakFirst(TextBreakIterator* bi)
|
|
-{
|
|
- return ubrk_first(bi);
|
|
-}
|
|
-
|
|
-int textBreakLast(TextBreakIterator* bi)
|
|
-{
|
|
- return ubrk_last(bi);
|
|
-}
|
|
-
|
|
-int textBreakNext(TextBreakIterator* bi)
|
|
-{
|
|
- return ubrk_next(bi);
|
|
-}
|
|
-
|
|
-int textBreakPrevious(TextBreakIterator* bi)
|
|
-{
|
|
- return ubrk_previous(bi);
|
|
-}
|
|
-
|
|
-int textBreakPreceding(TextBreakIterator* bi, int pos)
|
|
-{
|
|
- return ubrk_preceding(bi, pos);
|
|
-}
|
|
-
|
|
-int textBreakFollowing(TextBreakIterator* bi, int pos)
|
|
-{
|
|
- return ubrk_following(bi, pos);
|
|
-}
|
|
-
|
|
-int textBreakCurrent(TextBreakIterator* bi)
|
|
-{
|
|
- return ubrk_current(bi);
|
|
-}
|
|
-
|
|
-bool isTextBreak(TextBreakIterator* bi, int pos)
|
|
-{
|
|
- return ubrk_isBoundary(bi, pos);
|
|
+int textBreakFirst(TextBreakIterator* iterator)
|
|
+{
|
|
+ return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator));
|
|
+}
|
|
+
|
|
+int textBreakLast(TextBreakIterator* iterator)
|
|
+{
|
|
+ return ubrk_last(reinterpret_cast<UBreakIterator*>(iterator));
|
|
+}
|
|
+
|
|
+int textBreakNext(TextBreakIterator* iterator)
|
|
+{
|
|
+ return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator));
|
|
+}
|
|
+
|
|
+int textBreakPrevious(TextBreakIterator* iterator)
|
|
+{
|
|
+ return ubrk_previous(reinterpret_cast<UBreakIterator*>(iterator));
|
|
+}
|
|
+
|
|
+int textBreakPreceding(TextBreakIterator* iterator, int pos)
|
|
+{
|
|
+ return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos);
|
|
+}
|
|
+
|
|
+int textBreakFollowing(TextBreakIterator* iterator, int pos)
|
|
+{
|
|
+ return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos);
|
|
+}
|
|
+
|
|
+int textBreakCurrent(TextBreakIterator* iterator)
|
|
+{
|
|
+ return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator));
|
|
+}
|
|
+
|
|
+bool isTextBreak(TextBreakIterator* iterator, int position)
|
|
+{
|
|
+ return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), position);
|
|
}
|
|
|
|
@@ -137,5 +136,5 @@
|
|
UErrorCode openStatus = U_ZERO_ERROR;
|
|
String rules(breakRules);
|
|
- iterator = static_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus));
|
|
+ iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus));
|
|
createdIterator = true;
|
|
ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
|
|
@@ -145,5 +144,5 @@
|
|
|
|
UErrorCode setTextStatus = U_ZERO_ERROR;
|
|
- ubrk_setText(iterator, string, length, &setTextStatus);
|
|
+ ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus);
|
|
if (U_FAILURE(setTextStatus))
|
|
return 0;
|