From 7dd8b59447ef8c4b59e073ecfb54be820c1e67ac Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgouttes@lyx.org>
Date: Fri, 29 Sep 2000 12:14:15 +0000
Subject: [PATCH] Fixes from Dekel and John

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1057 a592a061-630c-0410-9148-cb99ea01b6c8
---
 ChangeLog     | 11 +++++++++++
 config/kde.m4 | 18 ++++++++++++++++++
 src/combox.h  |  2 +-
 src/intl.C    |  3 ++-
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 09cc72729e..f3430be70e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-09-27  John Levon  <moz@compsoc.man.ac.uk>
+
+	* config/kde.m4: make Qt fail immediately if Qt2 is picked up
+
+2000-09-28  Dekel Tsur  <dekelts@tau.ac.il>
+
+	* src/intl.C (InitKeyMapper): Correct the value of n due to the
+	removal of the "default" language.
+
+	* src/combox.h (getline): Check that sel > 0
+
 2000-09-29  Jos� Ab�lio Matos <jamatos@fep.up.pt>
 
 	* lib/examples/docbook_example.lyx
diff --git a/config/kde.m4 b/config/kde.m4
index cbb8627d7e..f79a9fed8d 100644
--- a/config/kde.m4
+++ b/config/kde.m4
@@ -629,6 +629,24 @@ if test ! "$kde_qt_libs_given" = "yes"; then
 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
 fi
 
+dnl should check it's not Qt2, so it will fail now, rather than in KDE check
+
+SAVE_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -I$qt_includes -L$qt_libraries"
+AC_TRY_COMPILE([
+#include <qglobal.h>
+],
+[
+#if (QT_VERSION >= 200)
+break_me_(\\\);
+#endif
+],
+ac_qt_ok=yes,
+ac_qt_ok=no
+) 
+test "$ac_qt_ok" = no && AC_MSG_ERROR([Found Qt 2 - you must specify the path to the Qt 1 headers and libraries])
+CXXFLAGS="$SAVE_CXXFLAGS"
+
 AC_SUBST(qt_libraries)
 AC_SUBST(qt_includes)
 
diff --git a/src/combox.h b/src/combox.h
index 16c6cd056a..96a01be42a 100644
--- a/src/combox.h
+++ b/src/combox.h
@@ -221,7 +221,7 @@ string const Combox::getline()
     if (type == FL_COMBOX_INPUT) 
       return fl_get_input(label);
     else
-      return browser ? fl_get_browser_line(browser, sel) : 0;
+      return (browser && sel > 0) ? fl_get_browser_line(browser, sel) : string();
 }
 
 #endif
diff --git a/src/intl.C b/src/intl.C
index 28bcae1716..0f33480ee6 100644
--- a/src/intl.C
+++ b/src/intl.C
@@ -273,11 +273,12 @@ void Intl::InitKeyMapper(bool on)
 	Language2->add(120, 110, 160, 30, 300);	// Secondary
 	fl_end_form();
 
-	int n = 1;
+	int n = 0;
 	// Default is not in the language map
 #ifdef DO_USE_DEFAULT_LANGUAGE
 	Language->addto("default");
 	Language2->addto("default");
+	++n;
 #endif
 	for (Languages::const_iterator cit = languages.begin();
 	     cit != languages.end(); ++cit) {