~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to WebCore/platform/gtk/DataObjectGtk.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-20 20:09:57 UTC
  • mfrom: (1.2.7 upstream) (4.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100120200957-3ng8lah18c7pmm52
* New upstream release
- Fixes crashes related to clearing the clipboard, which many users were
  experiencing (Closes: #565166)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "config.h"
20
20
#include "DataObjectGtk.h"
21
21
 
 
22
#include "markup.h"
22
23
#include <gtk/gtk.h>
23
 
#include <wtf/StdLibExtras.h>
24
 
#include <wtf/gtk/GOwnPtr.h>
25
24
 
26
25
namespace WebCore {
27
26
 
28
 
DataObjectGtk::DataObjectGtk()
29
 
{
30
 
}
31
 
 
32
 
DataObjectGtk::~DataObjectGtk()
33
 
{
 
27
String DataObjectGtk::text()
 
28
{
 
29
    if (m_range)
 
30
        return m_range->text();
 
31
    return m_text;
 
32
}
 
33
 
 
34
String DataObjectGtk::markup()
 
35
{
 
36
    if (m_range)
 
37
        createMarkup(m_range.get(), 0, AnnotateForInterchange);
 
38
    return m_markup;
 
39
}
 
40
 
 
41
void DataObjectGtk::setText(const String& newText)
 
42
{
 
43
    m_range = 0;
 
44
    m_text = newText;
 
45
}
 
46
 
 
47
void DataObjectGtk::setMarkup(const String& newMarkup)
 
48
{
 
49
    m_range = 0;
 
50
    m_markup = newMarkup;
34
51
}
35
52
 
36
53
Vector<String> DataObjectGtk::files()
77
94
    return !url().isEmpty();
78
95
}
79
96
 
80
 
void DataObjectGtk::clearImage()
81
 
{
82
 
    setImage(0);
83
 
}
84
 
 
85
97
void DataObjectGtk::clear()
86
98
{
87
 
    clearText();
88
 
    clearMarkup();
89
 
    clearURIList();
90
 
    clearImage();
 
99
    m_text = "";
 
100
    m_markup = "";
 
101
    m_uriList.clear();
 
102
    m_image = 0;
 
103
    m_range = 0;
91
104
}
92
105
 
93
106
DataObjectGtk* DataObjectGtk::forClipboard(GtkClipboard* clipboard)