]> 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 d49e7c088fef9123e7b9f88207cedeb01ae921d1..1c3bee9ad7a5b2f7ff871353c167ff11743c12c8 100644 (file)
@@ -5,35 +5,41 @@
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * 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 {
+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)
 {
@@ -66,4 +72,5 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
        return langs;
 }
 
-} // namespace frnt
+} // namespace frontend
+} // namespace lyx