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

Side by Side Diff: third_party/WebKit/Source/web/mac/WebSubstringUtil.mm

Issue 1651263003: Detemplatize TextIterator::copyTextTo with ForwardsTextBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@text_buffers
Patch Set: Change ref parameters to ptrs Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/WordAwareIterator.cpp ('k') | no next file » | 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, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 if (style->visitedDependentColor(CSSPropertyColor).alpha()) 92 if (style->visitedDependentColor(CSSPropertyColor).alpha())
93 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyCol or)) forKey:NSForegroundColorAttributeName]; 93 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyCol or)) forKey:NSForegroundColorAttributeName];
94 else 94 else
95 [attrs removeObjectForKey:NSForegroundColorAttributeName]; 95 [attrs removeObjectForKey:NSForegroundColorAttributeName];
96 if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha()) 96 if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha())
97 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyBac kgroundColor)) forKey:NSBackgroundColorAttributeName]; 97 [attrs setObject:nsColor(style->visitedDependentColor(CSSPropertyBac kgroundColor)) forKey:NSBackgroundColorAttributeName];
98 else 98 else
99 [attrs removeObjectForKey:NSBackgroundColorAttributeName]; 99 [attrs removeObjectForKey:NSBackgroundColorAttributeName];
100 100
101 Vector<UChar> characters; 101 ForwardsTextBuffer characters;
102 it.copyTextTo(characters); 102 it.copyTextTo(&characters);
103 NSString* substring = 103 NSString* substring =
104 [[[NSString alloc] initWithCharacters:characters.data() 104 [[[NSString alloc] initWithCharacters:characters.data()
105 length:characters.size()] autorelease ]; 105 length:characters.size()] autorelease ];
106 [string replaceCharactersInRange:NSMakeRange(position, 0) 106 [string replaceCharactersInRange:NSMakeRange(position, 0)
107 withString:substring]; 107 withString:substring];
108 [string setAttributes:attrs range:NSMakeRange(position, numCharacters)]; 108 [string setAttributes:attrs range:NSMakeRange(position, numCharacters)];
109 position += numCharacters; 109 position += numCharacters;
110 } 110 }
111 return [string autorelease]; 111 return [string autorelease];
112 } 112 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (ephemeralRange.isNull()) 170 if (ephemeralRange.isNull())
171 return nil; 171 return nil;
172 172
173 NSAttributedString* result = attributedSubstringFromRange(ephemeralRange); 173 NSAttributedString* result = attributedSubstringFromRange(ephemeralRange);
174 if (baselinePoint) 174 if (baselinePoint)
175 *baselinePoint = getBaselinePoint(frame->view(), ephemeralRange, result) ; 175 *baselinePoint = getBaselinePoint(frame->view(), ephemeralRange, result) ;
176 return result; 176 return result;
177 } 177 }
178 178
179 } // namespace blink 179 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/WordAwareIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698