+2005-02-01 John Sullivan <sullivan@apple.com>
+
+ Written by Darin, reviewed and tested by me
+
+ - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
+ pasted content from Blot
+
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::attributedString):
+ don't emit paragraph breaks if the margins are tiny; matches what
+ we do for plain-text conversion
+
=== Safari-182 ===
2005-02-01 Ken Kocienda <kocienda@apple.com>
if (!next) {
KWQKHTMLPart *parent = KWQ(parentPart());
if (parent) {
- next = parent->nextKeyView(parent->childFrame(this)->m_frame->element(), direction);
+ next = parent->nextKeyViewInFrameHierarchy(parent->childFrame(this)->m_frame->element(), direction);
}
}
int start = (n == _startNode) ? startOffset : -1;
int end = (n == endNode) ? endOffset : -1;
if (renderer->isText()) {
- if (renderer->style()->whiteSpace() == PRE) {
+ if (style->whiteSpace() == PRE) {
if (needSpace && !addedSpace) {
if (text.isEmpty() && linkStartLocation == [result length]) {
++linkStartLocation;
RenderListItem *listRenderer = static_cast<RenderListItem*>(renderer);
maxMarkerWidth = MAX([font pointSize], maxMarkerWidth);
- switch(listRenderer->style()->listStyleType()) {
+ switch(style->listStyleType()) {
case khtml::DISC:
listText += ((QChar)BULLET_CHAR);
break;
case ID_H3:
case ID_H4:
case ID_H5:
- case ID_H6:
+ case ID_H6: {
if (!hasNewLine)
text += '\n';
- if (!hasParagraphBreak) {
- text += '\n';
- hasParagraphBreak = true;
+
+ // In certain cases, emit a paragraph break.
+ int bottomMargin = renderer->collapsedMarginBottom();
+ int fontSize = style->htmlFont().getFontDef().computedPixelSize();
+ if (bottomMargin * 2 >= fontSize) {
+ if (!hasParagraphBreak) {
+ text += '\n';
+ hasParagraphBreak = true;
+ }
}
+
hasNewLine = true;
break;
+ }
case ID_IMG:
if (pendingStyledSpace != nil) {