~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/ui/widget/entity-entry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
            obj = new EntityMultiLineEntry (ent, tt, wr);
50
50
            break;
51
51
        default:
52
 
            g_warning ("Can't happen.");
 
52
            g_warning ("An unknown RDF format was requested.");
53
53
    }
54
54
 
 
55
    g_assert (obj);
55
56
    obj->_label.show();
56
57
    return obj;
57
58
}
78
79
 
79
80
EntityLineEntry::~EntityLineEntry()
80
81
{
81
 
    delete reinterpret_cast<Gtk::Entry*>(_packable);
 
82
    delete static_cast<Gtk::Entry*>(_packable);
82
83
}
83
84
 
84
85
void 
85
86
EntityLineEntry::update (SPDocument *doc)
86
87
{
87
88
    const char *text = rdf_get_work_entity (doc, _entity);
88
 
    reinterpret_cast<Gtk::Entry*>(_packable)->set_text (text ? text : "");
 
89
    static_cast<Gtk::Entry*>(_packable)->set_text (text ? text : "");
89
90
}
90
91
 
91
92
void
95
96
 
96
97
    _wr->setUpdating (true);
97
98
    SPDocument *doc = SP_ACTIVE_DOCUMENT;
98
 
    char const *text = reinterpret_cast<Gtk::Entry*>(_packable)->get_text().c_str();
99
 
    if (rdf_set_work_entity (doc, _entity, text))
100
 
        sp_document_done (doc);
 
99
    Glib::ustring text = static_cast<Gtk::Entry*>(_packable)->get_text();
 
100
    if (rdf_set_work_entity (doc, _entity, text.c_str()))
 
101
        sp_document_done (doc, SP_VERB_NONE, 
 
102
                          /* TODO: annotate */ "entity-entry.cpp:101");
101
103
    _wr->setUpdating (false);
102
104
}
103
105
 
118
120
 
119
121
EntityMultiLineEntry::~EntityMultiLineEntry()
120
122
{
121
 
    delete reinterpret_cast<Gtk::ScrolledWindow*>(_packable);
 
123
    delete static_cast<Gtk::ScrolledWindow*>(_packable);
122
124
}
123
125
 
124
126
void 
125
127
EntityMultiLineEntry::update (SPDocument *doc)
126
128
{
127
129
    const char *text = rdf_get_work_entity (doc, _entity);
128
 
    Gtk::ScrolledWindow *s = reinterpret_cast<Gtk::ScrolledWindow*>(_packable);
129
 
    Gtk::TextView *tv = reinterpret_cast<Gtk::TextView*>(s->get_child());
 
130
    Gtk::ScrolledWindow *s = static_cast<Gtk::ScrolledWindow*>(_packable);
 
131
    Gtk::TextView *tv = static_cast<Gtk::TextView*>(s->get_child());
130
132
    tv->get_buffer()->set_text (text ? text : "");
131
133
}
132
134
 
137
139
 
138
140
    _wr->setUpdating (true);
139
141
    SPDocument *doc = SP_ACTIVE_DOCUMENT;
140
 
    Gtk::ScrolledWindow *s = reinterpret_cast<Gtk::ScrolledWindow*>(_packable);
141
 
    Gtk::TextView *tv = reinterpret_cast<Gtk::TextView*>(s->get_child());
142
 
    char const *text = tv->get_buffer()->get_text().c_str();
143
 
    if (rdf_set_work_entity (doc, _entity, text))
144
 
        sp_document_done (doc);
 
142
    Gtk::ScrolledWindow *s = static_cast<Gtk::ScrolledWindow*>(_packable);
 
143
    Gtk::TextView *tv = static_cast<Gtk::TextView*>(s->get_child());
 
144
    Glib::ustring text = tv->get_buffer()->get_text();
 
145
    if (rdf_set_work_entity (doc, _entity, text.c_str()))
 
146
        sp_document_done (doc, SP_VERB_NONE, 
 
147
                          /* TODO: annotate */ "entity-entry.cpp:146");
145
148
    _wr->setUpdating (false);
146
149
}
147
150