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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 newRuns.lastRun()->setNext(toReplace->next()); | 161 newRuns.lastRun()->setNext(toReplace->next()); |
162 | 162 |
163 // Fix up any of other pointers which may now be stale. | 163 // Fix up any of other pointers which may now be stale. |
164 if (m_lastRun == toReplace) | 164 if (m_lastRun == toReplace) |
165 m_lastRun = newRuns.lastRun(); | 165 m_lastRun = newRuns.lastRun(); |
166 if (m_logicallyLastRun == toReplace) | 166 if (m_logicallyLastRun == toReplace) |
167 m_logicallyLastRun = newRuns.logicallyLastRun(); | 167 m_logicallyLastRun = newRuns.logicallyLastRun(); |
168 m_runCount += newRuns.runCount() - 1; // We added the new runs and removed t
oReplace. | 168 m_runCount += newRuns.runCount() - 1; // We added the new runs and removed t
oReplace. |
169 | 169 |
170 toReplace->destroy(); | 170 delete toReplace; |
171 newRuns.clearWithoutDestroyingRuns(); | 171 newRuns.clearWithoutDestroyingRuns(); |
172 } | 172 } |
173 | 173 |
174 template <class Run> | 174 template <class Run> |
175 void BidiRunList<Run>::clearWithoutDestroyingRuns() | 175 void BidiRunList<Run>::clearWithoutDestroyingRuns() |
176 { | 176 { |
177 m_firstRun = 0; | 177 m_firstRun = 0; |
178 m_lastRun = 0; | 178 m_lastRun = 0; |
179 m_logicallyLastRun = 0; | 179 m_logicallyLastRun = 0; |
180 m_runCount = 0; | 180 m_runCount = 0; |
181 } | 181 } |
182 | 182 |
183 template <class Run> | 183 template <class Run> |
184 void BidiRunList<Run>::deleteRuns() | 184 void BidiRunList<Run>::deleteRuns() |
185 { | 185 { |
186 if (!m_firstRun) | 186 if (!m_firstRun) |
187 return; | 187 return; |
188 | 188 |
189 Run* curr = m_firstRun; | 189 Run* curr = m_firstRun; |
190 while (curr) { | 190 while (curr) { |
191 Run* s = curr->next(); | 191 Run* s = curr->next(); |
192 curr->destroy(); | 192 delete curr; |
193 curr = s; | 193 curr = s; |
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) |
(...skipping 41 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 WebCore | 251 } // namespace WebCore |
252 | 252 |
253 #endif // BidiRunList | 253 #endif // BidiRunList |
OLD | NEW |