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