Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: Source/platform/text/TextBoundaries.cpp

Issue 400543004: Rename WebCore namespace to blink in Platform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/text/TextBoundaries.h ('k') | Source/platform/text/TextBreakIterator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com> 3 * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 15 matching lines...) Expand all
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "platform/text/TextBoundaries.h" 28 #include "platform/text/TextBoundaries.h"
29 29
30 #include "platform/text/TextBreakIterator.h" 30 #include "platform/text/TextBreakIterator.h"
31 #include "wtf/text/StringImpl.h" 31 #include "wtf/text/StringImpl.h"
32 32
33 using namespace WTF; 33 using namespace WTF;
34 using namespace Unicode; 34 using namespace Unicode;
35 35
36 namespace WebCore { 36 namespace blink {
37 37
38 int endOfFirstWordBoundaryContext(const UChar* characters, int length) 38 int endOfFirstWordBoundaryContext(const UChar* characters, int length)
39 { 39 {
40 for (int i = 0; i < length; ) { 40 for (int i = 0; i < length; ) {
41 int first = i; 41 int first = i;
42 UChar32 ch; 42 UChar32 ch;
43 U16_NEXT(characters, i, length, ch); 43 U16_NEXT(characters, i, length, ch);
44 if (!requiresContextForWordBoundary(ch)) 44 if (!requiresContextForWordBoundary(ch))
45 return first; 45 return first;
46 } 46 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void findWordBoundary(const UChar* chars, int len, int position, int* start, int * end) 93 void findWordBoundary(const UChar* chars, int len, int position, int* start, int * end)
94 { 94 {
95 TextBreakIterator* it = wordBreakIterator(chars, len); 95 TextBreakIterator* it = wordBreakIterator(chars, len);
96 *end = it->following(position); 96 *end = it->following(position);
97 if (*end < 0) 97 if (*end < 0)
98 *end = it->last(); 98 *end = it->last();
99 *start = it->previous(); 99 *start = it->previous();
100 } 100 }
101 101
102 102
103 } // namespace WebCore 103 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/text/TextBoundaries.h ('k') | Source/platform/text/TextBreakIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698