~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/document-undo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        sp_document_maybe_done (doc, NULL, event_type, event_description);
126
126
}
127
127
 
128
 
void
129
 
sp_document_reset_key (Inkscape::Application */*inkscape*/, SPDesktop */*desktop*/, GtkObject *base)
 
128
void sp_document_reset_key( Inkscape::Application * /*inkscape*/, SPDesktop * /*desktop*/, GtkObject *base )
130
129
{
131
 
    SPDocument *doc = (SPDocument *) base;
132
 
    doc->actionkey = NULL;
 
130
    SPDocument *doc = reinterpret_cast<SPDocument *>(base);
 
131
    doc->actionkey.clear();
133
132
}
134
133
 
135
134
namespace {
171
170
        g_assert (doc != NULL);
172
171
        g_assert (doc->priv != NULL);
173
172
        g_assert (doc->priv->sensitive);
 
173
        if ( key && !*key ) {
 
174
            g_warning("Blank undo key specified.");
 
175
        }
174
176
 
175
177
        Inkscape::Debug::EventTracker<CommitEvent> tracker(doc, key, event_type);
176
178
 
188
190
                return;
189
191
        }
190
192
 
191
 
        if (key && doc->actionkey && !strcmp (key, doc->actionkey) && doc->priv->undo) {
 
193
        if (key && !doc->actionkey.empty() && (doc->actionkey == key) && doc->priv->undo) {
192
194
                ((Inkscape::Event *)doc->priv->undo->data)->event =
193
195
                    sp_repr_coalesce_log (((Inkscape::Event *)doc->priv->undo->data)->event, log);
194
196
        } else {
198
200
                doc->priv->undoStackObservers.notifyUndoCommitEvent(event);
199
201
        }
200
202
 
201
 
        doc->actionkey = key;
 
203
        if ( key ) {
 
204
            doc->actionkey = key;
 
205
        } else {
 
206
            doc->actionkey.clear();
 
207
        }
202
208
 
203
209
        doc->virgin = FALSE;
204
210
        doc->setModifiedSinceSave();
257
263
        doc->priv->sensitive = FALSE;
258
264
        doc->priv->seeking = true;
259
265
 
260
 
        doc->actionkey = NULL;
 
266
        doc->actionkey.clear();
261
267
 
262
268
        finish_incomplete_transaction(*doc);
263
269
 
303
309
        doc->priv->sensitive = FALSE;
304
310
        doc->priv->seeking = true;
305
311
 
306
 
        doc->actionkey = NULL;
 
312
        doc->actionkey.clear();
307
313
 
308
314
        finish_incomplete_transaction(*doc);
309
315