]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormToc.C
Tiny clean-ups.
[lyx.git] / src / frontends / xforms / FormToc.C
index 4876aefadd30d3f23a08c918245476ea6f5b5c07..a14c5f5ea06cb5dd6ae862c4571678dbf651e71d 100644 (file)
@@ -1,37 +1,36 @@
 /**
- * \file xforms/FormToc.C
- * Copyright 2000-2001 The LyX Team.
- * See the file COPYING.
+ * \file FormToc.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming <leeming@lyx.org>
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "FormToc.h"
-#include "xformsBC.h"
-#include "xforms_helpers.h"
 #include "ControlToc.h"
 #include "forms/form_toc.h"
+
+#include "xforms_helpers.h"
+#include "xformsBC.h"
+
 #include "support/lstrings.h" // frontStrip, strip
-#include "debug.h"
-#include "gettext.h"
-#include FORMS_H_LOCATION
 
-#include <vector>
+#include "lyx_forms.h"
+
+using lyx::support::getStringFromVector;
 
 using std::vector;
-using std::endl;
+using std::string;
 
 
-typedef FormCB<ControlToc, FormDB<FD_toc> > base_class;
+typedef FormController<ControlToc, FormView<FD_toc> > base_class;
 
-FormToc::FormToc()
-       : base_class(_("Table of Contents"))
+FormToc::FormToc(Dialog & parent)
+       : base_class(parent, _("Table of Contents"))
 {}
 
 
@@ -40,14 +39,14 @@ void FormToc::build()
        dialog_.reset(build_toc(this));
 
        vector<string> types = controller().getTypes();
-       
-       
+
+
        string const choice =
-               " " + getStringFromVector(controller().getTypes(), " | ") + " ";
+               ' ' + getStringFromVector(controller().getTypes(), " | ") + ' ';
        fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
 
        // Manage the cancel/close button
-       bc().setCancel(dialog_->button_close);
+       bcview().setCancel(dialog_->button_close);
 }
 
 
@@ -87,7 +86,7 @@ void FormToc::updateType()
        fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
 
        // And select the correct one
-       string const type = toc::getType(controller().params().getCmdName());
+       string const type = lyx::toc::getType(controller().params().getCmdName());
        fl_set_choice_text(dialog_->choice_toc_type, type.c_str());
 }
 
@@ -98,12 +97,12 @@ void FormToc::updateContents()
        if (type.empty()) {
                fl_clear_browser(dialog_->browser_toc);
                fl_add_browser_line(dialog_->browser_toc,
-                                   _("*** No Lists ***"));
+                                   _("*** No Lists ***").c_str());
                setEnabled(dialog_->browser_toc, false);
                return;
        }
 
-       toc::Toc const contents = controller().getContents(type);
+       lyx::toc::Toc const contents = controller().getContents(type);
 
        // Check if all elements are the same.
        if (toc_ == contents) {
@@ -116,7 +115,7 @@ void FormToc::updateContents()
        if (contents.empty()) {
                fl_clear_browser(dialog_->browser_toc);
                fl_add_browser_line(dialog_->browser_toc,
-                                   _("*** No Lists ***"));
+                                   _("*** No Lists ***").c_str());
                setEnabled(dialog_->browser_toc, false);
                return;
        }
@@ -128,8 +127,8 @@ void FormToc::updateContents()
        fl_clear_browser(dialog_->browser_toc);
        setEnabled(dialog_->browser_toc, true);
 
-       toc::Toc::const_iterator cit = contents.begin();
-       toc::Toc::const_iterator end = contents.end();
+       lyx::toc::Toc::const_iterator cit = contents.begin();
+       lyx::toc::Toc::const_iterator end = contents.end();
        for (; cit != end; ++cit) {
                fl_add_browser_line(dialog_->browser_toc,
                                    cit->asString().c_str());