• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Révision70e10d078e87206c89c3a1ea31dc1b05b04193fa (tree)
l'heure2014-10-04 18:43:26
AuteurHans Breuer <hans@breu...>
CommiterHans Breuer

Message de Log

[warningectomy] remove unused variables and functions

the special text editing 'accumulating' was unfinished for too long.
Now it's gone with it's warnings.

textedit.c:148:19: warning: unused variable 'change' [-Wunused-variable]

TextEditChange *change;

textedit.c:370:1: warning: unused function 'text_edit_create_change' [-Wunused-function]
text_edit_create_change(Text *text)

textedit.c:394:1: warning: unused function 'text_edit_update' [-Wunused-function]
text_edit_update(TextEditChange *change)

Change Summary

Modification

--- a/app/textedit.c
+++ b/app/textedit.c
@@ -54,9 +54,6 @@ typedef struct TextEditChange {
5454 Text *text;
5555 } TextEditChange;
5656
57-static Change *text_edit_create_change(Text *text);
58-static void text_edit_update(TextEditChange *change);
59-static void text_edit_apply(Change *change, Diagram *dia);
6057 static void textedit_end_edit(DDisplay *ddisp, Focus *focus);
6158
6259 /** Returns TRUE if the given display is currently in text-edit mode. */
@@ -131,9 +128,6 @@ textedit_begin_edit(DDisplay *ddisp, Focus *focus)
131128 ddisplay_set_active_focus(ddisp, focus);
132129 highlight_object(focus->obj, DIA_HIGHLIGHT_TEXT_EDIT, ddisp->diagram);
133130 object_add_updates(focus->obj, ddisp->diagram);
134-/* Undo not quite ready yet.
135- undo_push_change(ddisp->diagram->undo, text_edit_create_change(focus->text));
136-*/
137131 }
138132
139133 /** Stop editing a particular text focus. This must only be called in
@@ -145,7 +139,6 @@ textedit_begin_edit(DDisplay *ddisp, Focus *focus)
145139 static void
146140 textedit_end_edit(DDisplay *ddisp, Focus *focus)
147141 {
148- TextEditChange *change;
149142 /* During destruction of the diagram the display may already be gone */
150143 if (!ddisp)
151144 return;
@@ -158,13 +151,6 @@ textedit_end_edit(DDisplay *ddisp, Focus *focus)
158151 highlight_object_off(focus->obj, ddisp->diagram);
159152 object_add_updates(focus->obj, ddisp->diagram);
160153 diagram_object_modified(ddisp->diagram, focus->obj);
161-/* Undo not quite ready yet
162- change = (TextEditChange *) undo_remove_to(ddisp->diagram->undo,
163- text_edit_apply);
164- if (change != NULL) {
165- text_edit_update(change);
166- }
167-*/
168154 ddisplay_set_active_focus(ddisp, NULL);
169155 }
170156
@@ -337,62 +323,3 @@ textedit_remove_focus_all(Diagram *diagram)
337323 * changes are not allowed in text edit mode: It would break the undo.
338324 */
339325
340-static void
341-text_edit_apply(Change *change, Diagram *dia)
342-{
343- TextEditChange *te_change = (TextEditChange *) change;
344- text_set_string(te_change->text, te_change->new_text);
345-}
346-
347-static void
348-text_edit_revert(TextEditChange *change, Diagram *dia)
349-{
350- if (textedit_mode(ddisplay_active())) {
351- DDisplay *ddisp = ddisplay_active();
352- textedit_exit(ddisp);
353- }
354- text_set_string(change->text, change->orig_text);
355-}
356-
357-static void
358-text_edit_free(TextEditChange *change)
359-{
360- g_free(change->orig_text);
361- if (change->new_text) {
362- g_free(change->new_text);
363- }
364-}
365-
366-/** Note that the new text isn't known when this is made. That gets
367- * added later.
368- */
369-static Change *
370-text_edit_create_change(Text *text)
371-{
372- TextEditChange *change;
373-
374- change = g_new0(TextEditChange, 1);
375-
376- change->obj_change.apply = (UndoApplyFunc) text_edit_apply;
377- change->obj_change.revert = (UndoRevertFunc) text_edit_revert;
378- change->obj_change.free = (UndoFreeFunc) text_edit_free;
379-
380- change->text = text;
381- if (text_is_empty(text)) {
382- change->orig_text = g_strdup("");
383- } else {
384- change->orig_text = text_get_string_copy(text);
385- }
386- /* new_text not ready yet */
387-
388- return (Change *)change;
389-}
390-
391-/** This should be called when an edit is finished, to store the final
392- * text. */
393-static void
394-text_edit_update(TextEditChange *change)
395-{
396- change->new_text = text_get_string_copy(change->text);
397-}
398-