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, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 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 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 | 2355 |
2356 currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP &&
c == noBreakSpace); | 2356 currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP &&
c == noBreakSpace); |
2357 | 2357 |
2358 if ((breakAll || breakWords) && !midWordBreak) { | 2358 if ((breakAll || breakWords) && !midWordBreak) { |
2359 wrapW += charWidth; | 2359 wrapW += charWidth; |
2360 bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && c
urrent.m_pos + 1 < t->textLength() && U16_IS_TRAIL(t->characters()[current.m_pos
+ 1]); | 2360 bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && c
urrent.m_pos + 1 < t->textLength() && U16_IS_TRAIL(t->characters()[current.m_pos
+ 1]); |
2361 charWidth = textWidth(t, current.m_pos, midWordBreakIsBefore
SurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapse
WhiteSpace); | 2361 charWidth = textWidth(t, current.m_pos, midWordBreakIsBefore
SurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapse
WhiteSpace); |
2362 midWordBreak = width.committedWidth() + wrapW + charWidth >
width.availableWidth(); | 2362 midWordBreak = width.committedWidth() + wrapW + charWidth >
width.availableWidth(); |
2363 } | 2363 } |
2364 | 2364 |
2365 if (lineBreakIteratorInfo.first != t) { | 2365 if ((lineBreakIteratorInfo.first != t) || (lineBreakIteratorInfo
.second.string() != t->characters())) { |
2366 lineBreakIteratorInfo.first = t; | 2366 lineBreakIteratorInfo.first = t; |
2367 lineBreakIteratorInfo.second.reset(t->characters(), t->textL
ength(), style->locale()); | 2367 lineBreakIteratorInfo.second.reset(t->characters(), t->textL
ength(), style->locale()); |
2368 } | 2368 } |
2369 | 2369 |
2370 bool betweenWords = c == '\n' || (currWS != PRE && !atStart && i
sBreakable(lineBreakIteratorInfo.second, current.m_pos, current.m_nextBreakableP
osition, breakNBSP) | 2370 bool betweenWords = c == '\n' || (currWS != PRE && !atStart && i
sBreakable(lineBreakIteratorInfo.second, current.m_pos, current.m_nextBreakableP
osition, breakNBSP) |
2371 && (style->hyphens() != HyphensNone || (current.previousInSa
meNode() != softHyphen))); | 2371 && (style->hyphens() != HyphensNone || (current.previousInSa
meNode() != softHyphen))); |
2372 | 2372 |
2373 if (betweenWords || midWordBreak) { | 2373 if (betweenWords || midWordBreak) { |
2374 bool stoppedIgnoringSpaces = false; | 2374 bool stoppedIgnoringSpaces = false; |
2375 if (ignoringSpaces) { | 2375 if (ignoringSpaces) { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2798 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); | 2798 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); |
2799 | 2799 |
2800 setLineGridBox(lineGridBox); | 2800 setLineGridBox(lineGridBox); |
2801 | 2801 |
2802 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying | 2802 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying |
2803 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping | 2803 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping |
2804 // to this grid. | 2804 // to this grid. |
2805 } | 2805 } |
2806 | 2806 |
2807 } | 2807 } |
OLD | NEW |