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

Side by Side Diff: Source/platform/text/BidiRunList.h

Issue 421383002: Fix loop condition in BidiRunList::replaceRunWithRuns (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/test Created 6 years, 4 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 | « LayoutTests/fast/text/bidi-replace-runs-crash-expected.txt ('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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved.
4 * Copyright (C) 2011 Google, Inc. All rights reserved. 4 * Copyright (C) 2011 Google, Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 { 146 {
147 ASSERT(newRuns.runCount()); 147 ASSERT(newRuns.runCount());
148 ASSERT(m_firstRun); 148 ASSERT(m_firstRun);
149 ASSERT(toReplace); 149 ASSERT(toReplace);
150 150
151 if (m_firstRun == toReplace) { 151 if (m_firstRun == toReplace) {
152 m_firstRun = newRuns.firstRun(); 152 m_firstRun = newRuns.firstRun();
153 } else { 153 } else {
154 // Find the run just before "toReplace" in the list of runs. 154 // Find the run just before "toReplace" in the list of runs.
155 Run* previousRun = m_firstRun; 155 Run* previousRun = m_firstRun;
156 while (previousRun->next() != toReplace) 156 while (previousRun->next() && previousRun->next() != toReplace)
157 previousRun = previousRun->next(); 157 previousRun = previousRun->next();
158 ASSERT(previousRun); 158 ASSERT(previousRun);
159 previousRun->setNext(newRuns.firstRun()); 159 previousRun->setNext(newRuns.firstRun());
160 } 160 }
161 161
162 newRuns.lastRun()->setNext(toReplace->next()); 162 newRuns.lastRun()->setNext(toReplace->next());
163 163
164 // Fix up any of other pointers which may now be stale. 164 // Fix up any of other pointers which may now be stale.
165 if (m_lastRun == toReplace) 165 if (m_lastRun == toReplace)
166 m_lastRun = newRuns.lastRun(); 166 m_lastRun = newRuns.lastRun();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 m_firstRun = endRun; 244 m_firstRun = endRun;
245 245
246 startRun->m_next = afterEnd; 246 startRun->m_next = afterEnd;
247 if (!afterEnd) 247 if (!afterEnd)
248 m_lastRun = startRun; 248 m_lastRun = startRun;
249 } 249 }
250 250
251 } // namespace blink 251 } // namespace blink
252 252
253 #endif // BidiRunList 253 #endif // BidiRunList
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/bidi-replace-runs-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698