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
1=== modified file 'src/main-cmdlinexact.cpp'
2--- src/main-cmdlinexact.cpp 2016-10-03 14:38:19 +0000
3+++ src/main-cmdlinexact.cpp 2017-05-17 23:49:59 +0000
4@@ -6,38 +6,9 @@
5 *
6 * Released under GNU GPL v2, read the file 'COPYING' for more information
7 *
8- * Format of xverbs.yaml
9- * using: $ inkscape -B xverbs.yaml
10- *
11- * verbose: yes # only "verbose: yes" enable logging
12- * run:
13- * # open document to process
14- * - xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg
15- * - xverb-id: XUndoLabel, fresh_document # set label for UndoToLabel xverb works
16- * # note: if something wrong with undo labels use verb EditUndo instead of XUndoLabel and UndoToLabel at all
17- *
18- * # select element to handle
19- * - xverb-id: XSelectElement, top_sand
20- *
21- * # verbs
22- * - verb-id: EditInvertInAllLayers
23- * - verb-id: EditDelete
24- * - verb-id: FitCanvasToDrawing
25- *
26- * # save element to separated svg document
27- * - xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg
28- *
29- * # also save png preview
30- * - xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png
31- *
32- * # return to the fresh_state of document
33- * - xverb-id: UndoToLabel, fresh_document
34- *
35- * # do any other handling
36- *
37- * # inkscape have a lot of useful verbs
38- * - verb-id: FileQuit
39+ * more details: http://wiki.inkscape.org/wiki/index.php/Using_xverbs
40 */
41+
42 #ifdef WITH_YAML
43 #include <ui/view/view.h>
44 #include <desktop.h>
45@@ -137,6 +108,7 @@
46 SPDocument *old_document = desktop->getDocument();
47 desktop->setWaitingCursor();
48 Inkscape::DocumentUndo::clearRedo(old_document);
49+ Inkscape::DocumentUndo::clearUndo(old_document);
50 }
51
52 SPDocument *doc = NULL;
53@@ -504,9 +476,9 @@
54 continue;
55 }
56 undo_labels_map[verb.args[1]] = undo_counter;
57- } else if (verb_word == "UndoToLabel") {
58+ } else if (verb_word == "XUndoToLabel") {
59 if (verb.args.size() < 2) {
60- printf("bad arguments for UndoToLabel\n");
61+ printf("bad arguments for XUndoToLabel\n");
62 continue;
63 }
64