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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 m_firstRun = 0; | 197 m_firstRun = 0; |
198 m_lastRun = 0; | 198 m_lastRun = 0; |
199 m_runCount = 0; | 199 m_runCount = 0; |
200 } | 200 } |
201 | 201 |
202 template <class Run> | 202 template <class Run> |
203 void BidiRunList<Run>::reverseRuns(unsigned start, unsigned end) | 203 void BidiRunList<Run>::reverseRuns(unsigned start, unsigned end) |
204 { | 204 { |
205 if (!m_runCount) | 205 ASSERT(m_runCount); |
206 return; | |
207 | |
208 if (start >= end) | 206 if (start >= end) |
209 return; | 207 return; |
210 | 208 |
211 ASSERT(end < m_runCount); | 209 ASSERT(end < m_runCount); |
212 | 210 |
213 // Get the item before the start of the runs to reverse and put it in | 211 // Get the item before the start of the runs to reverse and put it in |
214 // |beforeStart|. |curr| should point to the first run to reverse. | 212 // |beforeStart|. |curr| should point to the first run to reverse. |
215 Run* curr = m_firstRun; | 213 Run* curr = m_firstRun; |
216 Run* beforeStart = 0; | 214 Run* beforeStart = 0; |
217 unsigned i = 0; | 215 unsigned i = 0; |
(...skipping 30 matching lines...) Expand all Loading... |
248 m_firstRun = endRun; | 246 m_firstRun = endRun; |
249 | 247 |
250 startRun->m_next = afterEnd; | 248 startRun->m_next = afterEnd; |
251 if (!afterEnd) | 249 if (!afterEnd) |
252 m_lastRun = startRun; | 250 m_lastRun = startRun; |
253 } | 251 } |
254 | 252 |
255 } // namespace WebCore | 253 } // namespace WebCore |
256 | 254 |
257 #endif // BidiRunList | 255 #endif // BidiRunList |
OLD | NEW |