[dasher] Fix cspi a11y direct mode.



commit 5ef4f21570f883ecde8c550a02d26efc0651d689
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Wed Jan 9 22:08:47 2013 +0000

    Fix cspi a11y direct mode.
    
    Unfortunately I had made a functional change in the previous commits.

 Src/Gtk2/dasher_editor.cpp               |   10 ++++------
 Src/Gtk2/dasher_editor_external_cspi.cpp |    4 ++++
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/Src/Gtk2/dasher_editor.cpp b/Src/Gtk2/dasher_editor.cpp
index 54e9847..9ecf590 100644
--- a/Src/Gtk2/dasher_editor.cpp
+++ b/Src/Gtk2/dasher_editor.cpp
@@ -154,13 +154,13 @@ dasher_editor_init(DasherEditor *pSelf) {
   pPrivate->pTextView = GTK_TEXT_VIEW(gtk_text_view_new());
     gtk_text_view_set_wrap_mode(pPrivate->pTextView, GTK_WRAP_WORD);
   pPrivate->pBuffer = gtk_text_view_get_buffer(pPrivate->pTextView);
-  pPrivate->szFilename = NULL;
   pPrivate->pTextClipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
   pPrivate->pPrimarySelection = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
   GtkTextIter oStartIter;
   gtk_text_buffer_get_start_iter(pPrivate->pBuffer, &oStartIter);
   pPrivate->pNewMark =
        gtk_text_buffer_create_mark(pPrivate->pBuffer, NULL, &oStartIter, TRUE);
+  pPrivate->szFilename = NULL;
   pPrivate->bFileModified = FALSE;
   pPrivate->bInControlAction = FALSE;
 
@@ -211,11 +211,9 @@ dasher_editor_initialise(DasherEditor *pSelf, DasherAppSettings *pAppSettings, G
 				     dasher_app_settings_get_string(pPrivate->pAppSettings,
 								    APP_SP_EDIT_FONT));
 
-  if (isdirect(pAppSettings))
-    dasher_editor_external_create_buffer(pSelf);
-  else
-    // TODO: is this still needed?
-    dasher_editor_internal_create_buffer(pSelf);
+  dasher_editor_external_create_buffer(pSelf);
+  // TODO: is this still needed?
+  dasher_editor_internal_create_buffer(pSelf);
 
   // TODO: see note in command_new method
   if(szFullPath)
diff --git a/Src/Gtk2/dasher_editor_external_cspi.cpp b/Src/Gtk2/dasher_editor_external_cspi.cpp
index d30fcb4..96554a4 100644
--- a/Src/Gtk2/dasher_editor_external_cspi.cpp
+++ b/Src/Gtk2/dasher_editor_external_cspi.cpp
@@ -45,6 +45,9 @@ dasher_editor_external_finalize(GObject *pSelf) {
 
   SPI_deregisterGlobalEventListener(pPrivate->pExtPrivate->pFocusListener, "focus:");
   SPI_deregisterGlobalEventListener(pPrivate->pExtPrivate->pCaretListener, "object:text-caret-moved");
+  AccessibleEventListener_unref(pPrivate->pExtPrivate->pFocusListener);
+  AccessibleEventListener_unref(pPrivate->pExtPrivate->pCaretListener);
+  delete pPrivate->pExtPrivate;
 }
 
 void
@@ -55,6 +58,7 @@ dasher_editor_external_create_buffer(DasherEditor *pSelf) {
   if(!initSPI()) {
     g_message("Could not initialise SPI - accessibility options disabled");
   } else {
+    pPrivate->pExtPrivate = new DasherEditorExternalPrivate;
     pPrivate->pExtPrivate->pFocusListener = SPI_createAccessibleEventListener(focus_listener, pSelf);
     pPrivate->pExtPrivate->pCaretListener = SPI_createAccessibleEventListener(caret_listener, pSelf);
     



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]