From a3beb62f6586b1cb6aad289aeeb438a9aa31e8f0 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 10 Jul 2000 14:14:18 +0000 Subject: [PATCH] Patches from Dekel; try to fix solaris build problems with gcc 2.95.2 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/lyx-1_1_5@871 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 18 ++++++++++++++++++ configure.in | 8 ++++++++ src/WorkArea.C | 9 ++++----- src/bufferview_funcs.C | 2 +- src/lyx_cb.C | 20 +++++++++----------- src/lyx_cb.h | 4 +++- src/lyx_gui.C | 3 ++- 7 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index c44a5bab51..c6aaca8d25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2000-07-10 Jean-Marc Lasgouttes + + * configure.in: use -isystem instead of -I for X headers. This + fixes a problem on solaris with a recent gcc. + +2000-06-20 Dekel Tsur + + * src/lyx_gui.C (create_forms): Add "Reset" option to the language + combox in the character popup + + * src/lyx_cb.C (UserFreeFont): Add argument to the method: + BufferParams const & params + +2000-07-08 Dekel Tsur + + * src/WorkArea.C (request_clipboard_cb): Set clipboard_read to + true when clipboard is empty. + 2000-07-07 Jean-Marc Lasgouttes * configure.in: add check for strings.h header. diff --git a/configure.in b/configure.in index e02a6f17a8..8fb821b50d 100644 --- a/configure.in +++ b/configure.in @@ -126,6 +126,14 @@ AC_CHECK_LIB(pt,ptsname,X_EXTRA_LIBS="-lpt $X_EXTRA_LIBS") # The real thing. AC_PATH_XTRA LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" +# Since solaris X headers use int as implicit return type and modern +# gcc's do not like that, let's use -isystem instead of -I. +# We should test for gcc version and see whether it supports -isystem, +# but since at least gcc 2.6.x supports it and it is still too old for +# us, it seems we are safe. +if test -n "$GXX" ; then + X_CFLAGS=`echo ${X_CFLAGS} | sed -e 's/-I/-isystem/'` +fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ## Check whether X is new enough to handle the input method stuff diff --git a/src/WorkArea.C b/src/WorkArea.C index 5a5917b4e7..815b15f0b3 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -369,12 +369,11 @@ int request_clipboard_cb(FL_OBJECT * /*ob*/, long /*type*/, void const * data, long size) { clipboard_selection.erase(); - if (size == 0) return 0; // no selection - - clipboard_selection.reserve(size); - for (int i = 0; i < size; ++i) { + + if (size > 0) + clipboard_selection.reserve(size); + for (int i = 0; i < size; ++i) clipboard_selection += static_cast(data)[i]; - } clipboard_read = true; return 0; } diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index f4765b4205..fcfbc1ee50 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -122,7 +122,7 @@ void changeDepth(BufferView * bv, int decInc) void Free(BufferView * bv) { - ToggleAndShow(bv, UserFreeFont()); + ToggleAndShow(bv, UserFreeFont(bv->buffer()->params)); } diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 03adbb42d5..408cb4fdfa 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -1976,7 +1976,7 @@ void MenuLayoutSave() // This is both GUI and LyXFont dependent. Don't know where to put it. (Asger) // Well, it's mostly GUI dependent, so I guess it will stay here. (Asger) -LyXFont UserFreeFont() +LyXFont UserFreeFont(BufferParams const & params) { LyXFont font(LyXFont::ALL_IGNORE); @@ -2058,20 +2058,18 @@ LyXFont UserFreeFont() case 11: font.setColor(LColor::inherit); break; } - string language = combo_language2->getline(); - Languages::iterator lit = languages.find(language); - if (lit != languages.end()) - font.setLanguage(&(*lit).second); - else - font.setLanguage(ignore_language); - + int choice = combo_language2->get(); + if (choice == 1) + font.setLanguage(ignore_language); + else if (choice == 2) + font.setLanguage(params.language_info); + else + font.setLanguage(&languages[combo_language2->getline()]); return font; } - - /* callbacks for form form_title */ extern "C" void TimerCB(FL_OBJECT *, long) { @@ -2233,7 +2231,7 @@ extern "C" void CharacterApplyCB(FL_OBJECT *, long) // we set toggleall locally here, since it should be true for // all other uses of ToggleAndShow() (JMarc) toggleall = fl_get_button(fd_form_character->check_toggle_all); - ToggleAndShow(current_view, UserFreeFont()); + ToggleAndShow(current_view, UserFreeFont(current_view->buffer()->params)); current_view->setState(); toggleall = true; } diff --git a/src/lyx_cb.h b/src/lyx_cb.h index 295c80d4db..e0fcb07b7a 100644 --- a/src/lyx_cb.h +++ b/src/lyx_cb.h @@ -2,6 +2,8 @@ #ifndef LYX_CB_H #define LYX_CB_H +class BufferParams; + /// extern bool quitting; extern bool toggleall; @@ -9,7 +11,7 @@ extern bool toggleall; // When still false after reading lyxrc, warn user //about failing \bind_file command. RVDK_PATCH_5 extern bool BindFileSet; -extern LyXFont UserFreeFont(); +extern LyXFont UserFreeFont(BufferParams const & params); #endif diff --git a/src/lyx_gui.C b/src/lyx_gui.C index 4ce93fec78..6841d5c1c1 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -397,7 +397,8 @@ void LyXGUI::create_forms() // "default" is not part of the languages array any more. combo_language->addto("default"); - combo_language2->addto("No change"); + combo_language2->addto(_("No change")); + combo_language2->addto(_("Reset")); for(Languages::const_iterator cit = languages.begin(); cit != languages.end(); ++cit) { combo_language->addto((*cit).second.lang.c_str());