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

Side by Side Diff: Source/core/layout/TextRunConstructor.cpp

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return constructTextRunInternal(context, font, static_cast<const LChar*> (nullptr), 0, style, direction); 88 return constructTextRunInternal(context, font, static_cast<const LChar*> (nullptr), 0, style, direction);
89 if (text->is8Bit()) 89 if (text->is8Bit())
90 return constructTextRunInternal(context, font, text->characters8() + off set, length, style, direction); 90 return constructTextRunInternal(context, font, text->characters8() + off set, length, style, direction);
91 return constructTextRunInternal(context, font, text->characters16() + offset , length, style, direction); 91 return constructTextRunInternal(context, font, text->characters16() + offset , length, style, direction);
92 } 92 }
93 93
94 TextRun constructTextRun(LayoutObject* context, const Font& font, const String& string, const ComputedStyle& style, TextDirection direction, TextRunFlags flags) 94 TextRun constructTextRun(LayoutObject* context, const Font& font, const String& string, const ComputedStyle& style, TextDirection direction, TextRunFlags flags)
95 { 95 {
96 unsigned length = string.length(); 96 unsigned length = string.length();
97 if (!length) 97 if (!length)
98 return constructTextRunInternal(context, font, static_cast<const LChar*> (0), length, style, direction, flags); 98 return constructTextRunInternal(context, font, static_cast<const LChar*> (nullptr), length, style, direction, flags);
99 if (string.is8Bit()) 99 if (string.is8Bit())
100 return constructTextRunInternal(context, font, string.characters8(), len gth, style, direction, flags); 100 return constructTextRunInternal(context, font, string.characters8(), len gth, style, direction, flags);
101 return constructTextRunInternal(context, font, string.characters16(), length , style, direction, flags); 101 return constructTextRunInternal(context, font, string.characters16(), length , style, direction, flags);
102 } 102 }
103 103
104 TextRun constructTextRun(LayoutObject* context, const Font& font, const String& string, const ComputedStyle& style, TextRunFlags flags) 104 TextRun constructTextRun(LayoutObject* context, const Font& font, const String& string, const ComputedStyle& style, TextRunFlags flags)
105 { 105 {
106 return constructTextRun(context, font, string, style, string.isEmpty() || st ring.is8Bit() ? LTR : determineDirectionality(string), flags); 106 return constructTextRun(context, font, string, style, string.isEmpty() || st ring.is8Bit() ? LTR : determineDirectionality(string), flags);
107 } 107 }
108 108
109 TextRun constructTextRun(LayoutObject* context, const Font& font, const LayoutTe xt* text, unsigned offset, unsigned length, const ComputedStyle& style) 109 TextRun constructTextRun(LayoutObject* context, const Font& font, const LayoutTe xt* text, unsigned offset, unsigned length, const ComputedStyle& style)
110 { 110 {
111 ASSERT(offset + length <= text->textLength()); 111 ASSERT(offset + length <= text->textLength());
112 if (text->hasEmptyText()) 112 if (text->hasEmptyText())
113 return constructTextRunInternal(context, font, static_cast<const LChar*> (nullptr), 0, style, LTR); 113 return constructTextRunInternal(context, font, static_cast<const LChar*> (nullptr), 0, style, LTR);
114 if (text->is8Bit()) 114 if (text->is8Bit())
115 return constructTextRunInternal(context, font, text->characters8() + off set, length, style, LTR); 115 return constructTextRunInternal(context, font, text->characters8() + off set, length, style, LTR);
116 116
117 TextRun run = constructTextRunInternal(context, font, text->characters16() + offset, length, style, LTR); 117 TextRun run = constructTextRunInternal(context, font, text->characters16() + offset, length, style, LTR);
118 run.setDirection(directionForRun(run)); 118 run.setDirection(directionForRun(run));
119 return run; 119 return run;
120 } 120 }
121 121
122 } // namespace blink 122 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/TextAutosizer.cpp ('k') | Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698