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 2317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 | 2328 |
2329 currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP &&
c == noBreakSpace); | 2329 currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP &&
c == noBreakSpace); |
2330 | 2330 |
2331 if ((breakAll || breakWords) && !midWordBreak) { | 2331 if ((breakAll || breakWords) && !midWordBreak) { |
2332 wrapW += charWidth; | 2332 wrapW += charWidth; |
2333 bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && c
urrent.m_pos + 1 < t->textLength() && U16_IS_TRAIL(t->characters()[current.m_pos
+ 1]); | 2333 bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && c
urrent.m_pos + 1 < t->textLength() && U16_IS_TRAIL(t->characters()[current.m_pos
+ 1]); |
2334 charWidth = textWidth(t, current.m_pos, midWordBreakIsBefore
SurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapse
WhiteSpace); | 2334 charWidth = textWidth(t, current.m_pos, midWordBreakIsBefore
SurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapse
WhiteSpace); |
2335 midWordBreak = width.committedWidth() + wrapW + charWidth >
width.availableWidth(); | 2335 midWordBreak = width.committedWidth() + wrapW + charWidth >
width.availableWidth(); |
2336 } | 2336 } |
2337 | 2337 |
2338 if (lineBreakIteratorInfo.first != t) { | 2338 if ((lineBreakIteratorInfo.first != t) || (lineBreakIteratorInfo
.second.string() != t->characters())) { |
2339 lineBreakIteratorInfo.first = t; | 2339 lineBreakIteratorInfo.first = t; |
2340 lineBreakIteratorInfo.second.reset(t->characters(), t->textL
ength(), style->locale()); | 2340 lineBreakIteratorInfo.second.reset(t->characters(), t->textL
ength(), style->locale()); |
2341 } | 2341 } |
2342 | 2342 |
2343 bool betweenWords = c == '\n' || (currWS != PRE && !atStart && i
sBreakable(lineBreakIteratorInfo.second, current.m_pos, current.m_nextBreakableP
osition, breakNBSP) | 2343 bool betweenWords = c == '\n' || (currWS != PRE && !atStart && i
sBreakable(lineBreakIteratorInfo.second, current.m_pos, current.m_nextBreakableP
osition, breakNBSP) |
2344 && (style->hyphens() != HyphensNone || (current.previousInSa
meNode() != softHyphen))); | 2344 && (style->hyphens() != HyphensNone || (current.previousInSa
meNode() != softHyphen))); |
2345 | 2345 |
2346 if (betweenWords || midWordBreak) { | 2346 if (betweenWords || midWordBreak) { |
2347 bool stoppedIgnoringSpaces = false; | 2347 bool stoppedIgnoringSpaces = false; |
2348 if (ignoringSpaces) { | 2348 if (ignoringSpaces) { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2747 availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) -
logicalLeft; | 2747 availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) -
logicalLeft; |
2748 float totalLogicalWidth = logicalWidthForChild(child); | 2748 float totalLogicalWidth = logicalWidthForChild(child); |
2749 updateLogicalWidthForAlignment(textAlign, 0l, logicalLeft, totalLogicalWidth
, availableLogicalWidth, 0); | 2749 updateLogicalWidthForAlignment(textAlign, 0l, logicalLeft, totalLogicalWidth
, availableLogicalWidth, 0); |
2750 | 2750 |
2751 if (!style()->isLeftToRightDirection()) | 2751 if (!style()->isLeftToRightDirection()) |
2752 return logicalWidth() - (logicalLeft + totalLogicalWidth); | 2752 return logicalWidth() - (logicalLeft + totalLogicalWidth); |
2753 return logicalLeft; | 2753 return logicalLeft; |
2754 } | 2754 } |
2755 | 2755 |
2756 } | 2756 } |
OLD | NEW |