Commit 329e627d authored by zack's avatar zack
Browse files

Path implementing more Cliboard from Marius Bugge Monsen.

Adding implementations of some of the missing methods.
r=me


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 088e3448
2007-05-22 Marius Bugge Monsen <mbm@trolltech.com>
Reviewed by Zack.
Implement some more functions in ClipboardQt.
* platform/qt/ClipboardQt.cpp:
(WebCore::ClipboardQt::ClipboardQt):
(WebCore::ClipboardQt::getData):
(WebCore::ClipboardQt::setData):
(WebCore::ClipboardQt::types):
2007-05-21 Oliver Hunt <oliver@apple.com>
 
Reviewed by Sam.
......@@ -48,7 +48,7 @@ ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, const QMimeData* readable
, m_readableData(readableClipboard)
, m_writableData(0)
{
ASSERT(m_readableData);
ASSERT(m_readableData);
}
ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, bool forDragging)
......@@ -79,22 +79,30 @@ void ClipboardQt::clearAllData()
String ClipboardQt::getData(const String& type, bool& success) const
{
notImplemented();
return "";
ASSERT(m_writableData);
QByteArray data = m_writableData->data(QString(type));
success = !data.isEmpty();
return String(data.data(), data.size());
}
bool ClipboardQt::setData(const String& type, const String& data)
{
ASSERT(m_writableData);
notImplemented();
return false;
QByteArray array(reinterpret_cast<const char*>(data.characters()),
data.length());
m_writableData->setData(QString(type), array);
return true;
}
// extensions beyond IE's API
HashSet<String> ClipboardQt::types() const
HashSet<String> ClipboardQt::types() const
{
notImplemented();
HashSet<String> result;
QStringList formats = m_writableData->formats();
for (int i = 0; i < formats.count(); ++i) {
String type(formats.at(i).toLatin1().data());
result.add(type);
}
return result;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment