[dia] [warningectomy] remove unused variables and functions
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [warningectomy] remove unused variables and functions
- Date: Sat, 4 Oct 2014 11:07:07 +0000 (UTC)
commit 70e10d078e87206c89c3a1ea31dc1b05b04193fa
Author: Hans Breuer <hans breuer org>
Date: Fri Oct 3 23:00:46 2014 +0200
[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)
^
app/textedit.c | 73 --------------------------------------------------------
1 files changed, 0 insertions(+), 73 deletions(-)
---
diff --git a/app/textedit.c b/app/textedit.c
index c600829..6bd282f 100644
--- a/app/textedit.c
+++ b/app/textedit.c
@@ -54,9 +54,6 @@ typedef struct TextEditChange {
Text *text;
} TextEditChange;
-static Change *text_edit_create_change(Text *text);
-static void text_edit_update(TextEditChange *change);
-static void text_edit_apply(Change *change, Diagram *dia);
static void textedit_end_edit(DDisplay *ddisp, Focus *focus);
/** Returns TRUE if the given display is currently in text-edit mode. */
@@ -131,9 +128,6 @@ textedit_begin_edit(DDisplay *ddisp, Focus *focus)
ddisplay_set_active_focus(ddisp, focus);
highlight_object(focus->obj, DIA_HIGHLIGHT_TEXT_EDIT, ddisp->diagram);
object_add_updates(focus->obj, ddisp->diagram);
-/* Undo not quite ready yet.
- undo_push_change(ddisp->diagram->undo, text_edit_create_change(focus->text));
-*/
}
/** Stop editing a particular text focus. This must only be called in
@@ -145,7 +139,6 @@ textedit_begin_edit(DDisplay *ddisp, Focus *focus)
static void
textedit_end_edit(DDisplay *ddisp, Focus *focus)
{
- TextEditChange *change;
/* During destruction of the diagram the display may already be gone */
if (!ddisp)
return;
@@ -158,13 +151,6 @@ textedit_end_edit(DDisplay *ddisp, Focus *focus)
highlight_object_off(focus->obj, ddisp->diagram);
object_add_updates(focus->obj, ddisp->diagram);
diagram_object_modified(ddisp->diagram, focus->obj);
-/* Undo not quite ready yet
- change = (TextEditChange *) undo_remove_to(ddisp->diagram->undo,
- text_edit_apply);
- if (change != NULL) {
- text_edit_update(change);
- }
-*/
ddisplay_set_active_focus(ddisp, NULL);
}
@@ -337,62 +323,3 @@ textedit_remove_focus_all(Diagram *diagram)
* changes are not allowed in text edit mode: It would break the undo.
*/
-static void
-text_edit_apply(Change *change, Diagram *dia)
-{
- TextEditChange *te_change = (TextEditChange *) change;
- text_set_string(te_change->text, te_change->new_text);
-}
-
-static void
-text_edit_revert(TextEditChange *change, Diagram *dia)
-{
- if (textedit_mode(ddisplay_active())) {
- DDisplay *ddisp = ddisplay_active();
- textedit_exit(ddisp);
- }
- text_set_string(change->text, change->orig_text);
-}
-
-static void
-text_edit_free(TextEditChange *change)
-{
- g_free(change->orig_text);
- if (change->new_text) {
- g_free(change->new_text);
- }
-}
-
-/** Note that the new text isn't known when this is made. That gets
- * added later.
- */
-static Change *
-text_edit_create_change(Text *text)
-{
- TextEditChange *change;
-
- change = g_new0(TextEditChange, 1);
-
- change->obj_change.apply = (UndoApplyFunc) text_edit_apply;
- change->obj_change.revert = (UndoRevertFunc) text_edit_revert;
- change->obj_change.free = (UndoFreeFunc) text_edit_free;
-
- change->text = text;
- if (text_is_empty(text)) {
- change->orig_text = g_strdup("");
- } else {
- change->orig_text = text_get_string_copy(text);
- }
- /* new_text not ready yet */
-
- return (Change *)change;
-}
-
-/** This should be called when an edit is finished, to store the final
- * text. */
-static void
-text_edit_update(TextEditChange *change)
-{
- change->new_text = text_get_string_copy(change->text);
-}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]