OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |