Changeset 61968 in webkit
- Timestamp:
- Jun 27, 2010 7:14:28 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r61967 r61968 1 2010-06-27 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 editing/execCommand/copy-without-selection.html fails on Qt after r61637 6 https://bugs.webkit.org/show_bug.cgi?id=41025 7 8 Unskip editing/execCommand/copy-without-selection.html for Qt. 9 10 * platform/qt/Skipped: 11 1 12 2010-06-27 Mikhail Naganov <mnaganov@chromium.org> 2 13 -
trunk/LayoutTests/platform/qt/Skipped
r61953 r61968 5438 5438 fast/js/sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T9.html 5439 5439 5440 # Clipboard::setData is broken on Qt5441 # https://bugs.webkit.org/show_bug.cgi?id=410255442 editing/execCommand/copy-without-selection.html5443 5444 5440 # [Qt] Regression(r61749): inspector/debugger-pause-on-debugger-statement.html fails 5445 5441 # https://bugs.webkit.org/show_bug.cgi?id=41147 -
trunk/WebCore/ChangeLog
r61966 r61968 1 2010-06-27 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 editing/execCommand/copy-without-selection.html fails on Qt after r61637 6 https://bugs.webkit.org/show_bug.cgi?id=41025 7 8 The problem was that when getting data back via Clipboard::getData(), 9 the String::String(const char*, int) constructor was called 10 with UTF-16 data. 11 12 The solution is to use QMimeData's text() and setText() for "text/plain". 13 14 setText() which makes sure Qt passes the string in proper format to the 15 system clipboard. (The previous implementation would convert it to UTF-8) 16 17 text() makes sure that the correct encoding is used (UTF-16) and that 18 we get back whatever we originally put in there. 19 20 * platform/qt/ClipboardQt.cpp: 21 (WebCore::isTextMimeType): 22 (WebCore::ClipboardQt::getData): 23 (WebCore::ClipboardQt::setData): 24 1 25 2010-06-27 Adam Barth <abarth@webkit.org> 2 26 -
trunk/WebCore/platform/qt/ClipboardQt.cpp
r61178 r61968 58 58 namespace WebCore { 59 59 60 static bool isTextMimeType(const String& type) 61 { 62 return type == "text/plain" || type.startsWith("text/plain;"); 63 } 64 60 65 ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, const QMimeData* readableClipboard) 61 66 : Clipboard(policy, true) … … 131 136 } 132 137 138 if (isTextMimeType(type) && m_readableData->hasText()) { 139 success = true; 140 return m_readableData->text(); 141 } 142 133 143 ASSERT(m_readableData); 134 144 QByteArray data = m_readableData->data(QString(type)); 135 145 success = !data.isEmpty(); 136 return String(data. data(), data.size());146 return String(data.constData(), data.size()); 137 147 } 138 148 … … 144 154 if (!m_writableData) 145 155 m_writableData = new QMimeData; 146 QByteArray array(reinterpret_cast<const char*>(data.characters()), 147 data.length()*2); 148 m_writableData->setData(QString(type), array); 156 157 if (isTextMimeType(type)) 158 m_writableData->setText(QString(data)); 159 else { 160 QByteArray array(reinterpret_cast<const char*>(data.characters()), data.length() * 2); 161 m_writableData->setData(QString(type), array); 162 } 163 149 164 #ifndef QT_NO_CLIPBOARD 150 165 if (!isForDragging())
Note: See TracChangeset
for help on using the changeset viewer.