]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/frnt_lang.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / frnt_lang.C
index 971eb1d9a48d71a70b21bdb53d9ac8bff7e72dcc..1c3bee9ad7a5b2f7ff871353c167ff11743c12c8 100644 (file)
@@ -1,38 +1,45 @@
-/*
+/**
  * \file frnt_lang.C
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * 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 "frnt_lang.h"
 #include "gettext.h"
 #include "language.h"
-#include <iostream>
+
 #include <algorithm>
 
+
+using std::string;
 using std::vector;
 
+
+namespace lyx {
+namespace frontend {
+
 namespace {
 
-struct Sorter {
-       bool operator()(frnt::LanguagePair const & lhs,
-                       frnt::LanguagePair const & rhs) const
-        {
-                return lhs.first < rhs.first;
-        }
+class Sorter
+       : public std::binary_function<LanguagePair,
+                                     LanguagePair, bool>
+{
+public:
+       bool operator()(LanguagePair const & lhs,
+                       LanguagePair const & rhs) const {
+               return lhs.first < rhs.first;
+       }
 };
 
 } // namespace anon
 
-namespace frnt {
 
 vector<LanguagePair> const getLanguageData(bool character_dlg)
 {
@@ -42,8 +49,10 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
        vector<LanguagePair> langs(size);
 
        if (character_dlg) {
-               langs[0].first = _("No change"); langs[0].second = "ignore";
-               langs[1].first = _("Reset");     langs[1].second = "reset";
+               langs[0].first = _("No change");
+               langs[0].second = "ignore";
+               langs[1].first = _("Reset");
+               langs[1].second = "reset";
        }
 
        vector<string>::size_type i = character_dlg ? 2 : 0;
@@ -63,4 +72,5 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
        return langs;
 }
 
-} // namespace frnt
+} // namespace frontend
+} // namespace lyx