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

Side by Side Diff: Source/platform/text/StringTruncator.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/StringTruncator.h ('k') | Source/platform/text/SuffixTree.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) 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 18 matching lines...) Expand all
29 #include "config.h" 29 #include "config.h"
30 #include "platform/text/StringTruncator.h" 30 #include "platform/text/StringTruncator.h"
31 31
32 #include "platform/fonts/Font.h" 32 #include "platform/fonts/Font.h"
33 #include "platform/text/TextBreakIterator.h" 33 #include "platform/text/TextBreakIterator.h"
34 #include "platform/text/TextRun.h" 34 #include "platform/text/TextRun.h"
35 #include "wtf/Assertions.h" 35 #include "wtf/Assertions.h"
36 #include "wtf/Vector.h" 36 #include "wtf/Vector.h"
37 #include "wtf/unicode/CharacterNames.h" 37 #include "wtf/unicode/CharacterNames.h"
38 38
39 namespace WebCore { 39 namespace blink {
40 40
41 #define STRING_BUFFER_SIZE 2048 41 #define STRING_BUFFER_SIZE 2048
42 42
43 typedef unsigned TruncationFunction(const String&, unsigned length, unsigned kee pCount, UChar* buffer); 43 typedef unsigned TruncationFunction(const String&, unsigned length, unsigned kee pCount, UChar* buffer);
44 44
45 static inline int textBreakAtOrPreceding(const NonSharedCharacterBreakIterator& it, int offset) 45 static inline int textBreakAtOrPreceding(const NonSharedCharacterBreakIterator& it, int offset)
46 { 46 {
47 if (it.isBreak(offset)) 47 if (it.isBreak(offset))
48 return offset; 48 return offset;
49 49
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 String StringTruncator::rightTruncate(const String& string, float maxWidth, cons t Font& font) 192 String StringTruncator::rightTruncate(const String& string, float maxWidth, cons t Font& font)
193 { 193 {
194 return truncateString(string, maxWidth, font, rightTruncateToBuffer); 194 return truncateString(string, maxWidth, font, rightTruncateToBuffer);
195 } 195 }
196 196
197 float StringTruncator::width(const String& string, const Font& font) 197 float StringTruncator::width(const String& string, const Font& font)
198 { 198 {
199 return stringWidth(font, string); 199 return stringWidth(font, string);
200 } 200 }
201 201
202 } // namespace WebCore 202 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/text/StringTruncator.h ('k') | Source/platform/text/SuffixTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698