[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:21:24 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b7856bb7372a3a52aad774e45c302d0aa4904574
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jun 26 02:26:51 2002 +0000
Support for khtml style selection drawing. Ugly,
we'll want to make this more Mac like.
* khtml/rendering/font.cpp:
(Font::drawText):
Enable khtml code path. Removed APPLE_CHANGES
* kwq/KWQFontMetrics.mm:
(QFontMetrics::charWidth):
Implemented in terms of width().
* kwq/KWQPainter.mm:
(QPainter::drawText):
Implemented.
* kwq/qt/qfontmetrics.h:
Added QFontMetrics::charWidth.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 05f2c1b..3ac1ab2 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,4 +1,21 @@
2002-06-25 Richard Williamson <rjw at apple.com>
+
+ Support for khtml style selection drawing. Ugly,
+ we'll want to make this more Mac like.
+
+ * khtml/rendering/font.cpp:
+ (Font::drawText):
+ Enable khtml code path. Removed APPLE_CHANGES
+ * kwq/KWQFontMetrics.mm:
+ (QFontMetrics::charWidth):
+ Implemented in terms of width().
+ * kwq/KWQPainter.mm:
+ (QPainter::drawText):
+ Implemented.
+ * kwq/qt/qfontmetrics.h:
+ Added QFontMetrics::charWidth.
+
+2002-06-25 Richard Williamson <rjw at apple.com>
Support for rudimentary plain text 'copy'.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 05f2c1b..3ac1ab2 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,4 +1,21 @@
2002-06-25 Richard Williamson <rjw at apple.com>
+
+ Support for khtml style selection drawing. Ugly,
+ we'll want to make this more Mac like.
+
+ * khtml/rendering/font.cpp:
+ (Font::drawText):
+ Enable khtml code path. Removed APPLE_CHANGES
+ * kwq/KWQFontMetrics.mm:
+ (QFontMetrics::charWidth):
+ Implemented in terms of width().
+ * kwq/KWQPainter.mm:
+ (QPainter::drawText):
+ Implemented.
+ * kwq/qt/qfontmetrics.h:
+ Added QFontMetrics::charWidth.
+
+2002-06-25 Richard Williamson <rjw at apple.com>
Support for rudimentary plain text 'copy'.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 05f2c1b..3ac1ab2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,4 +1,21 @@
2002-06-25 Richard Williamson <rjw at apple.com>
+
+ Support for khtml style selection drawing. Ugly,
+ we'll want to make this more Mac like.
+
+ * khtml/rendering/font.cpp:
+ (Font::drawText):
+ Enable khtml code path. Removed APPLE_CHANGES
+ * kwq/KWQFontMetrics.mm:
+ (QFontMetrics::charWidth):
+ Implemented in terms of width().
+ * kwq/KWQPainter.mm:
+ (QPainter::drawText):
+ Implemented.
+ * kwq/qt/qfontmetrics.h:
+ Added QFontMetrics::charWidth.
+
+2002-06-25 Richard Williamson <rjw at apple.com>
Support for rudimentary plain text 'copy'.
diff --git a/WebCore/khtml/rendering/font.cpp b/WebCore/khtml/rendering/font.cpp
index 8895efa..135f275 100644
--- a/WebCore/khtml/rendering/font.cpp
+++ b/WebCore/khtml/rendering/font.cpp
@@ -38,15 +38,16 @@ using namespace khtml;
void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len,
int toAdd, QPainter::TextDirection d, int from, int to, QColor bg ) const
{
-#ifdef APPLE_CHANGES
- p->drawText(x, y, QConstString(str + pos, slen - pos).string(), len, d);
-#else
QString qstr = QConstString(str, slen).string();
// hack for fonts that don't have a welldefined nbsp
if ( !fontDef.hasNbsp ) {
+#ifdef APPLE_CHANGES
+ qstr.truncate( slen );
+#else
// str.setLength() always does a deep copy, so the replacement code below is safe.
qstr.setLength( slen );
+#endif
QChar *uc = (QChar *)qstr.unicode();
for( int i = 0; i < slen; i++ )
if ( (uc+i)->unicode() == 0xa0 )
@@ -94,7 +95,6 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i
x += chw;
}
}
-#endif
}
diff --git a/WebCore/kwq/KWQFontMetrics.h b/WebCore/kwq/KWQFontMetrics.h
index 1ca48a6..debd42a 100644
--- a/WebCore/kwq/KWQFontMetrics.h
+++ b/WebCore/kwq/KWQFontMetrics.h
@@ -51,6 +51,7 @@ public:
int width(QChar) const;
int width(char) const;
int width(const QString &, int len=-1) const;
+ int charWidth(QString &s, int pos) const;
int width(const QChar *, int len) const;
QRect boundingRect(const QString &, int len=-1) const;
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index fa805d7..e266259 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -114,6 +114,12 @@ int QFontMetrics::width(QChar qc) const
return [data->getRenderer() widthForCharacters:&c length:1];
}
+int QFontMetrics::charWidth(QString &s, int pos) const
+{
+ return width(s[pos]);
+}
+
+
int QFontMetrics::width(char c) const
{
UniChar ch = (uchar) c;
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 9c6f30c..873c7ca 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -453,9 +453,12 @@ void QPainter::drawText (int x, int y, const QString &qstring, int len, TextDire
}
-void QPainter::drawText (int x, int y, const QString &qstring, int len, int pos, TextDirection dir)
+void QPainter::drawText (int x, int y, const QString &qstring, int pos, int len, TextDirection dir)
{
- _logNotYetImplemented();
+ if (pos != 0)
+ drawText(x, y, qstring.mid(pos, len), len, dir);
+ else
+ drawText(x, y, qstring, len, dir);
}
diff --git a/WebCore/kwq/qt/qfontmetrics.h b/WebCore/kwq/qt/qfontmetrics.h
index 1ca48a6..debd42a 100644
--- a/WebCore/kwq/qt/qfontmetrics.h
+++ b/WebCore/kwq/qt/qfontmetrics.h
@@ -51,6 +51,7 @@ public:
int width(QChar) const;
int width(char) const;
int width(const QString &, int len=-1) const;
+ int charWidth(QString &s, int pos) const;
int width(const QChar *, int len) const;
QRect boundingRect(const QString &, int len=-1) const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list