Merge lp:~dmitry-zhulanov/inkscape/xverbs-bugfix into lp:~inkscape.dev/inkscape/trunk

Proposed by Dmitry Zhulanov
Status: Merged
Merged at revision: 15698
Proposed branch: lp:~dmitry-zhulanov/inkscape/xverbs-bugfix
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 63 lines (+5/-33)
1 file modified
src/main-cmdlinexact.cpp (+5/-33)
To merge this branch: bzr merge lp:~dmitry-zhulanov/inkscape/xverbs-bugfix
Reviewer Review Type Date Requested Status
Mc Approve
Review via email: mp+324221@code.launchpad.net

Description of the change

Fixed crash on using xverb XOpenFile
added reference to wiki page
fixed XUndoToLabel naming consistency

To post a comment you must log in.
Revision history for this message
Mc (mc...) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/main-cmdlinexact.cpp'
--- src/main-cmdlinexact.cpp 2016-10-03 14:38:19 +0000
+++ src/main-cmdlinexact.cpp 2017-05-17 23:49:59 +0000
@@ -6,38 +6,9 @@
6 *6 *
7 * Released under GNU GPL v2, read the file 'COPYING' for more information7 * Released under GNU GPL v2, read the file 'COPYING' for more information
8 *8 *
9 * Format of xverbs.yaml9 * more details: http://wiki.inkscape.org/wiki/index.php/Using_xverbs
10 * using: $ inkscape -B xverbs.yaml
11 *
12 * verbose: yes # only "verbose: yes" enable logging
13 * run:
14 * # open document to process
15 * - xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg
16 * - xverb-id: XUndoLabel, fresh_document # set label for UndoToLabel xverb works
17 * # note: if something wrong with undo labels use verb EditUndo instead of XUndoLabel and UndoToLabel at all
18 *
19 * # select element to handle
20 * - xverb-id: XSelectElement, top_sand
21 *
22 * # verbs
23 * - verb-id: EditInvertInAllLayers
24 * - verb-id: EditDelete
25 * - verb-id: FitCanvasToDrawing
26 *
27 * # save element to separated svg document
28 * - xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg
29 *
30 * # also save png preview
31 * - xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png
32 *
33 * # return to the fresh_state of document
34 * - xverb-id: UndoToLabel, fresh_document
35 *
36 * # do any other handling
37 *
38 * # inkscape have a lot of useful verbs
39 * - verb-id: FileQuit
40 */10 */
11
41#ifdef WITH_YAML12#ifdef WITH_YAML
42#include <ui/view/view.h>13#include <ui/view/view.h>
43#include <desktop.h>14#include <desktop.h>
@@ -137,6 +108,7 @@
137 SPDocument *old_document = desktop->getDocument();108 SPDocument *old_document = desktop->getDocument();
138 desktop->setWaitingCursor();109 desktop->setWaitingCursor();
139 Inkscape::DocumentUndo::clearRedo(old_document);110 Inkscape::DocumentUndo::clearRedo(old_document);
111 Inkscape::DocumentUndo::clearUndo(old_document);
140 }112 }
141113
142 SPDocument *doc = NULL;114 SPDocument *doc = NULL;
@@ -504,9 +476,9 @@
504 continue;476 continue;
505 }477 }
506 undo_labels_map[verb.args[1]] = undo_counter;478 undo_labels_map[verb.args[1]] = undo_counter;
507 } else if (verb_word == "UndoToLabel") {479 } else if (verb_word == "XUndoToLabel") {
508 if (verb.args.size() < 2) {480 if (verb.args.size() < 2) {
509 printf("bad arguments for UndoToLabel\n");481 printf("bad arguments for XUndoToLabel\n");
510 continue;482 continue;
511 }483 }
512484