]> git.lyx.org Git - features.git/commitdiff
fix combo segfault
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 27 Feb 2001 11:03:25 +0000 (11:03 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 27 Feb 2001 11:03:25 +0000 (11:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1631 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/FormCharacter.h

index e7b4dc2274818e56d3c6c2df15e2246b24abb525..c65c2379a94bad533397c2b111667da9fb7b5188 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-27  Lars Gullik Bjønnes  <larsbj@trylle.birdstep.com>
+
+       * FormCharacter.C (FormCharacter): change order of deletion,
+       change combo_language2 to combo_language2_
+
 2001-02-26  Dekel Tsur  <dekelts@tau.ac.il>
 
        * FormRef.C (apply): Update bookmark #0 after inserting a reference.
index be81b82b280c117e0834a1de5f76bdcb04565df1..11ac59c9d16cf56865bb8bb059855b3b47d9f798 100644 (file)
@@ -33,7 +33,7 @@ using Liason::setMinibuffer;
 FormCharacter::FormCharacter(LyXView * lv, Dialogs * d)
        : FormBaseBD(lv, d, _("Character Layout"),
                     new NoRepeatedApplyReadOnlyPolicy),
-       dialog_(0), combo_language2(0)
+       dialog_(0), combo_language2_(0)
 {
    // let the popup be shown
    // This is a permanent connection so we won't bother
@@ -46,9 +46,9 @@ FormCharacter::FormCharacter(LyXView * lv, Dialogs * d)
 
 FormCharacter::~FormCharacter()
 {
-   delete dialog_;
-   delete combo_language2;
-   
+       // This must be done before the deletion of the dialog.
+       delete combo_language2_;
+       delete dialog_;
 }
 
 
@@ -59,6 +59,7 @@ FL_FORM * FormCharacter::form() const
    return 0;
 }
 
+
 void FormCharacter::build()
 {
    dialog_ = build_character();
@@ -93,20 +94,18 @@ void FormCharacter::build()
    // insert default language box manually
    fl_addto_form(dialog_->form);
    FL_OBJECT * ob = dialog_->choice_language;
-   combo_language2 = new Combox(FL_COMBOX_DROPLIST);
-   combo_language2->add(ob->x, ob->y, ob->w, ob->h, 250);
-   combo_language2->shortcut("#L", 1);
+   combo_language2_ = new Combox(FL_COMBOX_DROPLIST);
+   combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250);
+   combo_language2_->shortcut("#L", 1);
    fl_end_form();
 
    // build up the combox entries
-   combo_language2->addline(_("No change"));
-   combo_language2->addline(_("Reset"));
+   combo_language2_->addline(_("No change"));
+   combo_language2_->addline(_("Reset"));
    for (Languages::const_iterator cit = languages.begin(); 
        cit != languages.end(); ++cit) {
-       combo_language2->addto((*cit).second.lang());
+       combo_language2_->addto((*cit).second.lang());
    }
-
-   
 }
 
 
@@ -195,13 +194,13 @@ void FormCharacter::apply()
       case 11: font.setColor(LColor::inherit); break;
    }
    
-   int const choice = combo_language2->get();
+   int const choice = combo_language2_->get();
    if (choice == 1)
      font.setLanguage(ignore_language);
    else if (choice == 2)
      font.setLanguage(lv_->buffer()->params.language);
    else
-     font.setLanguage(languages.getLanguage(combo_language2->getline()));
+     font.setLanguage(languages.getLanguage(combo_language2_->getline()));
 
    
    bool toggleall = fl_get_button(dialog_->check_toggle_all);
@@ -219,5 +218,3 @@ void FormCharacter::update()
    
     bc_.readOnly(lv_->buffer()->isReadonly());
 }
-
-
index 5fc537783cc8d59f726ac456df85c7f74af4a8db..2f5317f8acdfa0caa99348ff7e7a2308968c77f7 100644 (file)
@@ -1,3 +1,4 @@
+// -*- C++ -*-
 /** 
  * \file FormCharacter.h
  * Copyright 2001 The LyX Team.
@@ -50,9 +51,9 @@ private:
    FD_form_character * build_character();
        
    /// Real GUI implementation.
-   FD_form_character  * dialog_;
+   FD_form_character * dialog_;
    
-   Combox * combo_language2;
+   Combox * combo_language2_;
 };
 
 #endif