]> git.lyx.org Git - features.git/commitdiff
Angus inseterror patch + Dekel mathed fix + added language_country code and
authorJürgen Vigna <jug@sad.it>
Fri, 22 Sep 2000 15:09:51 +0000 (15:09 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 22 Sep 2000 15:09:51 +0000 (15:09 +0000)
support this for pspell.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1033 a592a061-630c-0410-9148-cb99ea01b6c8

26 files changed:
ChangeLog
src/frontends/Dialogs.h
src/frontends/gnome/Dialogs.C
src/frontends/gnome/Makefile.am
src/frontends/kde/Dialogs.C
src/frontends/kde/Makefile.am
src/frontends/xforms/Dialogs.C
src/frontends/xforms/FormBase.C [new file with mode: 0644]
src/frontends/xforms/FormBase.h [new file with mode: 0644]
src/frontends/xforms/FormCopyright.h
src/frontends/xforms/FormError.C [new file with mode: 0644]
src/frontends/xforms/FormError.h [new file with mode: 0644]
src/frontends/xforms/Makefile.am
src/frontends/xforms/form_error.C [new file with mode: 0644]
src/frontends/xforms/form_error.h [new file with mode: 0644]
src/frontends/xforms/forms/form_error.fd [new file with mode: 0644]
src/frontends/xforms/forms/makefile
src/insets/insetcommand.h
src/insets/inseterror.C
src/insets/inseterror.h
src/language.C
src/language.h
src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/spellchecker.C
src/tabular.C

index b35fde8e6a9855f35f1c594ddee0c6c0d9f66dd4..440ab03e1b95e0d67fc31d21eb8b01c70f2f3113 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2000-09-22  Juergen Vigna  <jug@sad.it>
+
+       * src/frontends/kde/Dialogs.C: added credits forms.
+
+       * src/frontends/gnome/Makefile.am (libgnome_la_OBJADD): added forms.
+
+       * src/frontends/gnome/Dialogs.C: added some forms.
+
+       * src/spellchecker.C (init_spell_checker): set language in pspell code
+       (RunSpellChecker): some modifications for setting language string.
+
+       * src/language.[Ch]: added language_country code.
+
+2000-09-21  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * src/frontends/Dialogs.h: added new signal showError.
+       Rearranged existing signals in some sort of alphabetical order.
+
+       * src/frontends/xforms/Makefile.am: added new files, FormBase.[Ch],
+       FormError.[Ch], form_error.[Ch]
+       * src/frontends/xforms/forms/makefile: added new file form_error.fd
+       * src/frontends/xforms/Dialogs.C: added new xforms dialog FormError.
+
+       * src/frontends/xforms/FormBase.[Ch]: new base class for xforms
+       dialogs. I think that this can be used as the base to all these
+       dialogs.
+
+       * src/frontends/xforms/FormError.[Ch]
+       * src/frontends/xforms/forms/form_error.fd: new files. Xforms
+       implementation of InsetError dialog.
+       
+       * src/insets/inseterror.[Ch]: rendered GUI-independent.
+
+       * src/frontends/kde/Dialogs.C: added new xforms dialog FormError.
+       * src/frontends/kde/Makefile.am: ditto
+
+2000-09-21  Dekel Tsur  <dekel@math.tau.ac.il>
+
+       * src/mathed/math_cursor.[Ch]: Removed class members macroln and
+       macrobf. This fixes a bug of invisible text.
+
 2000-09-22  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lib/doc/LaTeXConfig.lyx.in: updated.
index a01394b0be5c0c4c75913b1d1f6c61e3c636a8d6..3c544417e84c387a5454f64faa0f07d66f5fe1fa 100644 (file)
@@ -32,6 +32,7 @@ class LyXView;
 class InsetGraphics;
 class InsetBibKey;
 class InsetBibtex;
+class InsetError;
 class InsetInclude;
 class InsetInfo;
 class InsetTabular;
@@ -71,38 +72,27 @@ public:
        Signal0<void> updateBufferDependent;
        //@}
 
-       /**@name Dialog Access Signals */
+       /**@name Dialog Access Signals.
+          Put into some sort of alphabetical order */
        //@{
-       /// Opens the Preamble Dialog.
-       Signal0<void> showPreamble;
-       ///
-       Signal0<void> showLogFile;
-       ///
-       Signal1<void, InsetTabular *> showTabular;
-       ///
-       Signal1<void, InsetTabular *> updateTabular;
+       /// Do we really have to push this?
+       Signal1<void, vector<string> const &> SetDocumentClassChoice;
        ///
-       Signal1<void, InsetTabular *> hideTabular;
+       Signal1<void, InsetBibKey *> showBibkey;
        ///
-       Signal0<void> showTabularCreate;
+       Signal1<void, InsetBibtex *> showBibtex;
        ///
        Signal0<void> showCharacter;
        ///
-       Signal0<void> updateCharacter;  // allow update as cursor moves
-       ///
-       Signal0<void> showParagraph;
-       /// Do we really have to push this?
-       Signal1<void, vector<string> const &> SetDocumentClassChoice;
+       Signal1<void, InsetCommand *> showCitation;
        ///
-       Signal0<void> showPrint;
+       Signal1<void, string const &> createCitation;
        ///
        Signal0<void> showCopyright;
        ///
        Signal0<void> showCredits;
        ///
-       Signal0<void> showPreferences;
-       ///
-       Signal0<void> showLayoutDocument;
+       Signal1<void, InsetError *> showError;
        ///
        Signal1<void, InsetGraphics *> showGraphics;
        ///
@@ -112,16 +102,32 @@ public:
        ///
        Signal1<void, string const &> createIndex;
        ///
-       Signal1<void, InsetBibKey *> showBibkey;
+       Signal1<void, InsetInfo *> showInfo;
        ///
-       Signal1<void, InsetCommand *> showCitation;
+       Signal0<void> showLayoutDocument;
        ///
-       Signal1<void, string const &> createCitation;
+       Signal0<void> showLogFile;
+       ///
+       Signal0<void> showParagraph;
+       ///
+       Signal0<void> showPreamble;
+       ///
+       Signal0<void> showPreferences;
+       ///
+       Signal0<void> showPrint;
        ///
        Signal1<void, InsetCommand *> showRef;
        ///
        Signal1<void, string const &> createRef;
        ///
+       Signal1<void, InsetTabular *> showTabular;
+       ///
+       Signal1<void, InsetTabular *> updateTabular;
+       ///
+       Signal1<void, InsetTabular *> hideTabular;
+       ///
+       Signal0<void> showTabularCreate;
+       ///
        Signal1<void, InsetCommand *> showTOC;
        ///
        Signal1<void, string const &> createTOC;
@@ -130,9 +136,7 @@ public:
        ///
        Signal1<void, string const &> createUrl;
        ///
-       Signal1<void, InsetBibtex *> showBibtex;
-       ///
-       Signal1<void, InsetInfo *> showInfo;
+       Signal0<void> updateCharacter;  // allow update as cursor moves
        //@}
 private:
        ///
index 309dd2bca339af452c33b7585938e2a14934b68c..a6674e5b74674fd79fd8e39d61a364421effe1bd 100644 (file)
@@ -2,9 +2,10 @@
 #include FORMS_H_LOCATION
 
 #include "Dialogs.h"
-#include "FormCopyright.h"
 #include "FormCitation.h"
+#include "FormCopyright.h"
 #include "FormDocument.h"
+#include "FormError.h"
 #include "FormGraphics.h"
 #include "FormIndex.h"
 #include "FormPreferences.h"
 #include "FormToc.h"
 #include "FormUrl.h"
 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+// temporary till ported
+extern void ShowCredits();
+
 
 Dialogs::Dialogs(LyXView * lv)
 {
        dialogs_.push_back(new FormCitation(lv, this));
        dialogs_.push_back(new FormCopyright(lv, this));
        dialogs_.push_back(new FormDocument(lv, this));
+       dialogs_.push_back(new FormError(lv, this));
        dialogs_.push_back(new FormGraphics(lv, this));
        dialogs_.push_back(new FormIndex(lv, this));
        dialogs_.push_back(new FormPreferences(lv, this));
@@ -29,6 +38,8 @@ Dialogs::Dialogs(LyXView * lv)
        dialogs_.push_back(new FormToc(lv, this));
        dialogs_.push_back(new FormUrl(lv, this));
 
+       showCredits.connect(slot(ShowCredits));
+
        // reduce the number of connections needed in
        // dialogs by a simple connection here.
        hideAll.connect(hideBufferDependent.slot());
index 16d5709f978181a454b6dfea78f16bb8ef83793c..39098b6a14983c7ac01fa7f104b2fd70b85a758b 100644 (file)
@@ -6,11 +6,14 @@ INCLUDES = ${FRONTEND_INCLUDES} -I${top_srcdir}/src/ \
        -I${top_srcdir}/src/frontends/ -I${top_srcdir}/src/frontends/xforms \
        ${SIGC_CFLAGS}
 libgnome_la_OBJADD = \
+        ../xforms/FormBase.lo \
        ../xforms/FormCitation.lo \
        ../xforms/form_citation.lo \
        ../xforms/FormCommand.lo \
        ../xforms/FormDocument.lo \
        ../xforms/form_document.lo \
+        ../xforms/FormError.lo \
+        ../xforms/form_error.lo \
        ../xforms/FormGraphics.lo \
        ../xforms/form_graphics.lo \
        ../xforms/FormIndex.lo \
index e388e3f1b6528806ff6a21164ccacb8c1cbc985a..a6674e5b74674fd79fd8e39d61a364421effe1bd 100644 (file)
@@ -5,6 +5,7 @@
 #include "FormCitation.h"
 #include "FormCopyright.h"
 #include "FormDocument.h"
+#include "FormError.h"
 #include "FormGraphics.h"
 #include "FormIndex.h"
 #include "FormPreferences.h"
 #pragma implementation
 #endif
 
+// temporary till ported
+extern void ShowCredits();
+
 
 Dialogs::Dialogs(LyXView * lv)
 {
        dialogs_.push_back(new FormCitation(lv, this));
        dialogs_.push_back(new FormCopyright(lv, this));
        dialogs_.push_back(new FormDocument(lv, this));
+       dialogs_.push_back(new FormError(lv, this));
        dialogs_.push_back(new FormGraphics(lv, this));
        dialogs_.push_back(new FormIndex(lv, this));
        dialogs_.push_back(new FormPreferences(lv, this));
@@ -33,6 +38,8 @@ Dialogs::Dialogs(LyXView * lv)
        dialogs_.push_back(new FormToc(lv, this));
        dialogs_.push_back(new FormUrl(lv, this));
 
+       showCredits.connect(slot(ShowCredits));
+
        // reduce the number of connections needed in
        // dialogs by a simple connection here.
        hideAll.connect(hideBufferDependent.slot());
index 69468ec15fb2387102321d8e303429e5db420750..06d5e13f64bab9315a1c7b289448f75b71339dcf 100644 (file)
@@ -16,9 +16,12 @@ BUILTSOURCES =       formcopyrightdialog_moc.C \
 DISTCLEANFILES = $(BUILTSOURCES) *.orig *.rej *~ *.bak core
 
 libkde_la_OBJADD = \
+        ../xforms/FormBase.lo \
         ../xforms/FormCommand.lo \
         ../xforms/FormDocument.lo \
         ../xforms/form_document.lo \
+        ../xforms/FormError.lo \
+        ../xforms/form_error.lo \
         ../xforms/FormGraphics.lo \
         ../xforms/form_graphics.lo \
         ../xforms/FormPreferences.lo \
index ea8d7fc0ea84cca874e586e02141175ce22f8aa3..a6674e5b74674fd79fd8e39d61a364421effe1bd 100644 (file)
@@ -5,6 +5,7 @@
 #include "FormCitation.h"
 #include "FormCopyright.h"
 #include "FormDocument.h"
+#include "FormError.h"
 #include "FormGraphics.h"
 #include "FormIndex.h"
 #include "FormPreferences.h"
@@ -27,6 +28,7 @@ Dialogs::Dialogs(LyXView * lv)
        dialogs_.push_back(new FormCitation(lv, this));
        dialogs_.push_back(new FormCopyright(lv, this));
        dialogs_.push_back(new FormDocument(lv, this));
+       dialogs_.push_back(new FormError(lv, this));
        dialogs_.push_back(new FormGraphics(lv, this));
        dialogs_.push_back(new FormIndex(lv, this));
        dialogs_.push_back(new FormPreferences(lv, this));
diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C
new file mode 100644 (file)
index 0000000..3f9ed73
--- /dev/null
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+
+#include <config.h>
+
+#include FORMS_H_LOCATION
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "Dialogs.h"
+#include "FormBase.h"
+#include "xform_macros.h"
+
+C_RETURNCB(FormBase, WMHideCB)
+C_GENERICCB(FormBase, ApplyCB)
+C_GENERICCB(FormBase, CancelCB)
+C_GENERICCB(FormBase, InputCB)
+C_GENERICCB(FormBase, OKCB)
+
+FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t)
+       : lv_(lv), d_(d), u_(0), h_(0), title(t), dialogIsOpen(false)
+{}
+
+
+void FormBase::show()
+{
+       if (!form()) {
+               build();
+               fl_set_form_atclose(form(),
+                                   C_FormBaseWMHideCB, 0);
+       }
+
+       fl_freeze_form( form() );
+       update();  // make sure its up-to-date
+       fl_unfreeze_form( form() );
+
+       dialogIsOpen = true;
+       if (form()->visible) {
+               fl_raise_form(form());
+       } else {
+               fl_show_form(form(),
+                            FL_PLACE_MOUSE | FL_FREE_SIZE,
+                            FL_TRANSIENT,
+                            title.c_str());
+               u_ = d_->updateBufferDependent.
+                        connect(slot(this, &FormBase::update));
+               h_ = d_->hideBufferDependent.
+                        connect(slot(this, &FormBase::hide));
+       }
+}
+
+
+void FormBase::hide()
+{
+       if (form() && form()->visible) {
+               fl_hide_form(form());
+               u_.disconnect();
+               h_.disconnect();
+       }
+
+       // free up the dialog for another inset
+       dialogIsOpen = false;
+       clearStore();
+}
+
+
+int FormBase::WMHideCB(FL_FORM * form, void *)
+{
+       // Ensure that the signals (u and h) are disconnected even if the
+       // window manager is used to close the dialog.
+       FormBase * pre = static_cast<FormBase*>(form->u_vdata);
+       pre->hide();
+       return FL_CANCEL;
+}
+
+
+void FormBase::ApplyCB(FL_OBJECT * ob, long)
+{
+       FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
+       pre->apply();
+}
+
+
+void FormBase::CancelCB(FL_OBJECT * ob, long)
+{
+       FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
+       pre->hide();
+}
+
+
+void FormBase::InputCB(FL_OBJECT * ob, long data )
+{
+       FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
+       pre->input( data );
+}
+
+
+void FormBase::OKCB(FL_OBJECT * ob, long)
+{
+       FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
+       pre->apply();
+       pre->hide();
+}
diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h
new file mode 100644 (file)
index 0000000..00774e4
--- /dev/null
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+
+#ifndef FORMBASE_H
+#define FORMBASE_H
+
+#include "DialogBase.h"
+#include "LString.h"
+#include "support/utility.hpp"
+#include FORMS_H_LOCATION
+
+class Dialogs;
+class LyXView;
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+/** This class is an XForms GUI base class
+ */
+class FormBase : public DialogBase, public noncopyable {
+public:
+       /// Constructor
+       FormBase(LyXView *, Dialogs *, string const &);
+
+       /// Callback functions
+       static  int WMHideCB(FL_FORM *, void *);
+       ///
+       static void ApplyCB(FL_OBJECT *, long);
+       ///
+       static void CancelCB(FL_OBJECT *, long);
+       ///
+       static void InputCB(FL_OBJECT *, long);
+       ///
+       static void OKCB(FL_OBJECT *, long);
+
+protected:
+       /// Create the dialog if necessary, update it and display it.
+       void show();
+       /// Hide the dialog.
+       void hide();
+
+       /// Build the dialog
+       virtual void build() = 0;
+       /// Filter the inputs on callback from xforms
+       virtual void input( long ) {}
+       /// Update dialog before showing it
+       virtual void update() {}
+       /// Apply from dialog (modify or create inset)
+       virtual void apply() {}
+       /// delete derived class variables when hide()ing
+       virtual void clearStore() {}
+       /// Pointer to the actual instantiation of xform's form
+       virtual FL_FORM * const form() const = 0;
+
+       /** Which LyXFunc do we use?
+           We could modify Dialogs to have a visible LyXFunc* instead and
+           save a couple of bytes per dialog.
+       */
+       LyXView * lv_;
+       /** Which Dialogs do we belong to?
+           Used so we can get at the signals we have to connect to.
+       */
+       Dialogs * d_;
+private:
+       /// Update connection.
+       Connection u_;
+       /// Hide connection.
+       Connection h_;
+       /// dialog title, displayed by WM.
+       string title;
+
+protected:
+       /// block opening of form twice at the same time
+       bool dialogIsOpen;
+};
+
+#endif
index 587dcbf40ecd739068f5afcc2bad7d9fbd0f7e8a..eb623e93114a6ac6cedd48a0fbdf23d07032face 100644 (file)
@@ -26,7 +26,6 @@
 #endif
 
 class Dialogs;
-// same arguement as in Dialogs.h s/LyX/UI/
 class LyXView;
 struct FD_form_copyright;
 
diff --git a/src/frontends/xforms/FormError.C b/src/frontends/xforms/FormError.C
new file mode 100644 (file)
index 0000000..094d718
--- /dev/null
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "Dialogs.h"
+#include "FormError.h"
+#include "form_error.h"
+
+static int minh, minw;
+
+FormError::FormError(LyXView * lv, Dialogs * d)
+       : FormBase(lv, d, _("LaTeX Error")),
+         dialog_(0), ih_(0), message_("")
+{
+       // let the dialog be shown
+       // This is a permanent connection so we won't bother
+       // storing a copy because we won't be disconnecting.
+       d->showError.connect(slot(this, &FormError::showInset));
+}
+
+
+FormError::~FormError()
+{
+       delete dialog_;
+}
+
+
+void FormError::showInset( InsetError * const inset )
+{
+       if( dialogIsOpen || inset == 0 ) return;
+
+       ih_ = inset->hide.connect(slot(this, &FormError::hide));
+
+       message_ = inset->getContents();
+       show();
+}
+
+
+void FormError::update()
+{
+       fl_set_form_minsize(form(), minw, minh);
+       fl_set_object_label(dialog_->message, message_.c_str());
+}
+
+
+void FormError::build()
+{
+       dialog_ = build_error();
+
+       // XFORMS bug workaround
+       // Define the min/max dimensions. Actually applied in update()
+       minw = form()->w; minh = form()->h;
+}
+
+
+void FormError::clearStore()
+{
+       ih_.disconnect();
+       message_.empty();
+}
+
+
+FL_FORM * const FormError::form() const
+{
+       if( dialog_ ) // no need to test for dialog_->form
+               return dialog_->form;
+       else
+               return 0;
+}
diff --git a/src/frontends/xforms/FormError.h b/src/frontends/xforms/FormError.h
new file mode 100644 (file)
index 0000000..6def455
--- /dev/null
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+
+#ifndef FORMERROR_H
+#define FORMERROR_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "FormBase.h"
+#include "insets/inseterror.h"
+
+struct FD_form_error;
+
+/** This class provides an XForms implementation of the FormError Dialog.
+ */
+class FormError : public FormBase, public noncopyable {
+public:
+       /// Constructor
+       FormError(LyXView *, Dialogs *);
+       ///
+       ~FormError();
+private:
+       /// Slot launching dialog to an existing inset
+       void showInset( InsetError * const );
+       /// Update dialog before showing it
+       void update();
+       /// Build the dialog
+       void build();
+       /// Reset data when hide() is called
+       void clearStore();
+       /// Pointer to the actual instantiation of the xform's form
+       FL_FORM * const form() const;
+       /// Fdesign generated method
+       FD_form_error * build_error();
+
+       /// Real GUI implementation.
+       FD_form_error * dialog_;
+       /// inset::hide connection.
+       Connection ih_;
+       /// the error message
+       string message_;
+};
+
+#endif
index 4f4b415ec1380a7800ed3f17742df3fbb22d6cb4..31a8a2999a537ff92dd0a278d97e7b1bef093710 100644 (file)
@@ -14,6 +14,8 @@ libxforms_la_SOURCES = \
        ButtonController.h \
        Dialogs.C \
        GUIRunTime.C \
+       FormBase.C \
+       FormBase.h \
        FormCitation.C \
        FormCitation.h \
        form_citation.C \
@@ -28,6 +30,10 @@ libxforms_la_SOURCES = \
        FormDocument.h \
        form_document.C \
        form_document.h \
+       FormError.C \
+       FormError.h \
+       form_error.C \
+       form_error.h \
        FormGraphics.C \
        FormGraphics.h \
        form_graphics.C \
diff --git a/src/frontends/xforms/form_error.C b/src/frontends/xforms/form_error.C
new file mode 100644 (file)
index 0000000..7bd23ef
--- /dev/null
@@ -0,0 +1,41 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+#include <config.h>
+#include "lyx_gui_misc.h"
+#include "gettext.h"
+
+/* Form definition file generated with fdesign. */
+
+#include FORMS_H_LOCATION
+#include <stdlib.h>
+#include "form_error.h"
+#include "FormError.h"
+
+FD_form_error::~FD_form_error()
+{
+  if( form->visible ) fl_hide_form( form );
+  fl_free_form( form );
+}
+
+
+FD_form_error * FormError::build_error()
+{
+  FL_OBJECT *obj;
+  FD_form_error *fdui = new FD_form_error;
+
+  fdui->form = fl_bgn_form(FL_NO_BOX, 400, 240);
+  fdui->form->u_vdata = this;
+  obj = fl_add_box(FL_UP_BOX, 0, 0, 400, 240, "");
+  fdui->message = obj = fl_add_box(FL_FRAME_BOX, 10, 10, 380, 180, "");
+    fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
+  obj = fl_add_button(FL_RETURN_BUTTON, 135, 200, 130, 30, _("Close"));
+    fl_set_object_gravity(obj, FL_South, FL_South);
+    fl_set_object_resize(obj, FL_RESIZE_NONE);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
+  fl_end_form();
+
+  fdui->form->fdui = fdui;
+
+  return fdui;
+}
+/*---------------------------------------*/
+
diff --git a/src/frontends/xforms/form_error.h b/src/frontends/xforms/form_error.h
new file mode 100644 (file)
index 0000000..7df3f4e
--- /dev/null
@@ -0,0 +1,19 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+/** Header file generated with fdesign **/
+
+#ifndef FD_form_error_h_
+#define FD_form_error_h_
+
+/** Callbacks, globals and object handlers **/
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+
+
+/**** Forms and Objects ****/
+struct FD_form_error {
+       ~FD_form_error();
+
+       FL_FORM *form;
+       FL_OBJECT *message;
+};
+
+#endif /* FD_form_error_h_ */
diff --git a/src/frontends/xforms/forms/form_error.fd b/src/frontends/xforms/forms/form_error.fd
new file mode 100644 (file)
index 0000000..f452762
--- /dev/null
@@ -0,0 +1,70 @@
+Magic: 13000
+
+Internal Form Definition File
+    (do not change)
+
+Number of forms: 1
+Unit of measure: FL_COORD_PIXEL
+
+=============== FORM ===============
+Name: form_error
+Width: 400
+Height: 240
+Number of Objects: 3
+
+--------------------
+class: FL_BOX
+type: UP_BOX
+box: 0 0 400 240
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: 
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: 
+callback: 
+argument: 
+
+--------------------
+class: FL_BOX
+type: FRAME_BOX
+box: 10 10 380 180
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: 
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NorthWest FL_SouthEast
+name: message
+callback: 
+argument: 
+
+--------------------
+class: FL_BUTTON
+type: RETURN_BUTTON
+box: 135 200 130 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Close
+shortcut: ^M
+resize: FL_RESIZE_NONE
+gravity: FL_South FL_South
+name: 
+callback: C_FormBaseCancelCB
+argument: 0
+
+==============================
+create_the_forms
index 147c049e1dd5b23e280d705aa703798a7f9e768b..0f565036512cf037a65cc9699edf2ae0a799b488 100644 (file)
@@ -22,6 +22,7 @@ FDESIGN = fdesign
 SRCS := form_citation.fd \
        form_copyright.fd \
        form_document.fd \
+       form_error.fd \
        form_graphics.fd \
        form_index.fd \
        form_preferences.fd \
index 8a4fdcfcaabac74233fa4270a86e5519b83643d6..469b65bc53b4716a47b058bfa161823bbbe28d97 100644 (file)
@@ -84,7 +84,7 @@ public:
        explicit
        InsetCommand(InsetCommandParams const &);
        ///
-       virtual ~InsetCommand() { hide(); };
+       virtual ~InsetCommand() { hide(); }
        ///
        void Write(Buffer const *, std::ostream & os) const
                { p_.Write( os ); }
index efabf8bf2a4ef572ddb25f99eacb56fcdbf9d7ca..767548ffc40c8d23e44e91cd027a9d5dc2fc9c5d 100644 (file)
 #pragma implementation
 #endif
 
-#include "inseterror.h"
-#include "gettext.h"
-#include "lyx_gui_misc.h" // CancelCloseBoxCB
-#include "Painter.h"
 #include "BufferView.h"
 #include "font.h"
+#include "gettext.h"
+#include "inseterror.h"
+#include "LyXView.h"
+#include "Painter.h"
+#include "frontends/Dialogs.h"
 
 using std::ostream;
 
 /* Error, used for the LaTeX-Error Messages */
 
-#if 0
-InsetError::InsetError()
-{
-       form = 0;
-}
-#endif
-
-
 InsetError::InsetError(string const & str)
-       : contents(str), form(0)
+       : contents(str)
 {}
 
 
-InsetError::~InsetError()
-{
-       if (form) {
-               fl_hide_form(form);
-               fl_free_form(form);
-               form = 0;
-       }
-}
-
-
 int InsetError::ascent(BufferView *, LyXFont const & font) const
 {
        LyXFont efont;
@@ -96,109 +79,13 @@ void InsetError::draw(BufferView * bv, LyXFont const & font,
 }
 
 
-void InsetError::Write(Buffer const *, ostream &) const
-{
-}
-
-
-void InsetError::Read(Buffer const *, LyXLex &)
-{
-}
-
-
-int InsetError::Latex(Buffer const *, ostream &,
-                     bool /*fragile*/, bool /*fs*/) const
-{
-       return 0;
-}
-
-
-int InsetError::Ascii(Buffer const *, ostream &) const
-{
-       return 0;
-}
-
-
-int InsetError::Linuxdoc(Buffer const *, ostream &) const
-{
-       return 0;
-}
-
-
-int InsetError::DocBook(Buffer const *, ostream &) const
-{
-       return 0;
-}
-
-
-bool InsetError::AutoDelete() const
-{
-       return true;
-}
-
-
-Inset::EDITABLE InsetError::Editable() const
-{
-       return IS_EDITABLE;
-}
-
-
-void InsetError::CloseErrorCB(FL_OBJECT * ob, long)
-{
-       InsetError * inset = static_cast<InsetError*>(ob->u_vdata);
-       if (inset->form) {
-               fl_hide_form(inset->form);
-               fl_free_form(inset->form);
-               inset->form = 0;
-       }
-}
-
-
-// A C wrapper
-extern "C"
-void C_InsetError_CloseErrorCB(FL_OBJECT * ob, long data)
-{
-        InsetError::CloseErrorCB(ob , data);
-}
-
-
 string const InsetError::EditMessage() const 
 {
        return _("Opened error");
 }
 
 
-void InsetError::Edit(BufferView *, int, int, unsigned int)
-{
-       static int ow = 400, oh = 240;
-
-       if (!form) {
-               FL_OBJECT * obj;
-               form = fl_bgn_form(FL_UP_BOX, ow, oh);
-               strobj = fl_add_box(FL_FRAME_BOX, 10, 10, 380, 180, "");
-               fl_set_object_color(strobj, FL_MCOL, FL_MCOL);
-               fl_set_object_gravity(strobj, FL_NorthWest, FL_SouthEast);
-               obj = fl_add_button(FL_RETURN_BUTTON, 140, 200, 120, 30,
-                                   _("Close"));
-               fl_set_object_callback(obj, C_InsetError_CloseErrorCB, 0);
-               obj->u_vdata = this;
-               fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-               fl_set_object_resize(obj, FL_RESIZE_NONE);
-               fl_end_form();
-               fl_set_form_atclose(form, CancelCloseBoxCB, 0);
-       }
-       fl_set_object_label(strobj, contents.c_str());
-       if (form->visible) {
-               fl_raise_form(form);
-       } else {
-               fl_show_form(form, FL_PLACE_MOUSE | FL_FREE_SIZE,
-                            FL_FULLBORDER, _("LaTeX Error"));
-               fl_set_form_minsize(form, ow, oh);
-       }
-}
-
-
-Inset * InsetError::Clone() const
+void InsetError::Edit(BufferView * bv, int, int, unsigned int)
 {
-       return new InsetError(contents);
+       bv->owner()->getDialogs()->showError( this );
 }
index 6f2770bf50a2b38be3457d7f639c5c72191cd22b..47a67a9bc250b2edb7755a6f911684b319dc3f7c 100644 (file)
 #pragma interface
 #endif
 
-#include FORMS_H_LOCATION
 #include "lyxinset.h"
 #include "LString.h"
-#include "gettext.h"
+#include <sigc++/signal_system.h>
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Signal0;
+#endif
 
 /** Used for error messages from LaTeX runs.
   
@@ -30,56 +33,49 @@ class InsetError : public Inset {
 public:
        ///
        explicit
-       InsetError(string const & string);
-#if 0
-       ///
-       InsetError();
-#endif
+       InsetError(string const &);
        ///
-       ~InsetError();
+       ~InsetError() { hide(); }
        ///
-       int ascent(BufferView *, LyXFont const & font) const;
+       int ascent(BufferView *, LyXFont const &) const;
        ///
-       int descent(BufferView *, LyXFont const & font) const;
+       int descent(BufferView *, LyXFont const &) const;
        ///
-       int width(BufferView *, LyXFont const & font) const;
+       int width(BufferView *, LyXFont const &) const;
        ///
        void draw(BufferView *, LyXFont const &, int, float &, bool) const;
        ///
-       void Write(Buffer const *, std::ostream &) const;
+       void Write(Buffer const *, std::ostream &) const {}
        ///
-       void Read(Buffer const *, LyXLex & lex);
+       void Read(Buffer const *, LyXLex &) {}
        ///
-       int Latex(Buffer const *, std::ostream &,
-                 bool fragile, bool free_spc) const;
+       int Latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
        ///
-       int Ascii(Buffer const *, std::ostream &) const;
+       int Ascii(Buffer const *, std::ostream &) const { return 0; }
        ///
-       int Linuxdoc(Buffer const *, std::ostream &) const;
+       int Linuxdoc(Buffer const *, std::ostream &) const { return 0; }
        ///
-       int DocBook(Buffer const *, std::ostream &) const;
+       int DocBook(Buffer const *, std::ostream &) const { return 0; }
        ///
-       bool AutoDelete() const;
+       bool AutoDelete() const { return true; }
        /// what appears in the minibuffer when opening
        string const EditMessage() const;
        ///
-       void Edit(BufferView *, int x, int y, unsigned int button);
+       void Edit(BufferView *, int, int, unsigned int);
        ///
-       EDITABLE Editable() const;
+       EDITABLE Editable() const { return IS_EDITABLE; }
        ///
-       Inset * Clone() const;
+       Inset * Clone() const { return new InsetError(contents); }
        ///
        Inset::Code LyxCode() const { return Inset::NO_CODE; }
        /// We don't want "begin" and "end inset" in lyx-file
        bool DirectWrite() const { return true; };
        ///
-       static void CloseErrorCB(FL_OBJECT *, long data);
+       string const & getContents() const { return contents; }
+       ///
+       Signal0<void> hide;
 private:
        ///
        string contents;
-       ///
-       FL_FORM * form;
-       ///
-       FL_OBJECT * strobj;
 };
 #endif
index a6f4e8a05f15891e8b120277104c471c26146823..bd23912ec3a73d1f6bc449d50658e21dbf0069b8 100644 (file)
@@ -20,7 +20,7 @@
 
 Languages languages;
 Language const * default_language;
-Language ignore_lang("ignore", "Ignore", false, 0);
+Language ignore_lang("ignore", "Ignore", false, 0, "ignore");
 Language const * ignore_language = &ignore_lang;
 
 ///
@@ -44,6 +44,7 @@ struct lang_item {
        char const * display;
        bool rtl;
        Encoding const * encoding;
+       char const * code;
 };
 
 
@@ -53,59 +54,60 @@ void LangInit::initL()
        // Same method is used in LyXAction.C (Lgb)
 
        lang_item items[] = {
-       { "afrikaans", N_("Afrikaans"), false, &iso8859_1 },
-       { "american", N_("American"), false, &iso8859_1 },
-       { "arabic", N_("Arabic"), true, &iso8859_6 },
-       { "austrian", N_("Austrian"), false, &iso8859_1 },
-       { "bahasa", N_("Bahasa"), false, &iso8859_1 },
-       { "brazil", N_("Brazil"), false, &iso8859_1 },
-       { "breton", N_("Breton"), false, &iso8859_1 },
-       { "catalan", N_("Catalan"), false, &iso8859_1 },
-       { "croatian", N_("Croatian"), false, &iso8859_2 },
-       { "czech", N_("Czech"), false, &iso8859_2 },
-       { "danish", N_("Danish"), false, &iso8859_1 },
-       { "default", N_("Document wide language"), false, &iso8859_1 },
-       { "dutch", N_("Dutch"), false, &iso8859_1 },
-       { "english", N_("English"), false, &iso8859_1 },
-       { "esperanto", N_("Esperanto"), false, &iso8859_3 },
-       { "estonian", N_("Estonian"), false, &iso8859_4 },
-       { "finnish", N_("Finnish"), false, &iso8859_1 },
-       { "frenchb", N_("French"), false, &iso8859_1 },
-       { "french", N_("French (GUTenberg)"), false, &iso8859_1 },
-       { "galician", N_("Galician"), false, &iso8859_1 },
-       { "german", N_("German"), false, &iso8859_1 },
-       { "greek", N_("Greek"), false, &iso8859_7 },
-       { "hebrew", N_("Hebrew"), true, &cp1255 },
+       { "afrikaans", N_("Afrikaans"), false, &iso8859_1, "" },
+       { "american", N_("American"), false, &iso8859_1, "en_US" },
+       { "arabic", N_("Arabic"), true, &iso8859_6, "" },
+       { "austrian", N_("Austrian"), false, &iso8859_1, "de_AU" },
+       { "bahasa", N_("Bahasa"), false, &iso8859_1, "" },
+       { "brazil", N_("Brazil"), false, &iso8859_1, "" },
+       { "breton", N_("Breton"), false, &iso8859_1, "" },
+       { "catalan", N_("Catalan"), false, &iso8859_1, "" },
+       { "croatian", N_("Croatian"), false, &iso8859_2, "" },
+       { "czech", N_("Czech"), false, &iso8859_2, "" },
+       { "danish", N_("Danish"), false, &iso8859_1, "" },
+       { "default", N_("Document wide language"), false, &iso8859_1, "" },
+       { "dutch", N_("Dutch"), false, &iso8859_1, "" },
+       { "english", N_("English"), false, &iso8859_1, "en_EN" },
+       { "esperanto", N_("Esperanto"), false, &iso8859_3, "" },
+       { "estonian", N_("Estonian"), false, &iso8859_4, "" },
+       { "finnish", N_("Finnish"), false, &iso8859_1, "" },
+       { "frenchb", N_("French"), false, &iso8859_1, "fr_FR" },
+       { "french", N_("French (GUTenberg)"), false, &iso8859_1, "fr_FR" },
+       { "galician", N_("Galician"), false, &iso8859_1, "" },
+       { "german", N_("German"), false, &iso8859_1, "de_DE" },
+       { "greek", N_("Greek"), false, &iso8859_7, "" },
+       { "hebrew", N_("Hebrew"), true, &cp1255, "" },
        /* According to Zrubecz Laszlo <zrubi@k2.jozsef.kando.hu>,
           "magyar" is better. I kept it here in case we want
           to  provide aliasing of languages. (JMarc) 
        */
-       //{ "hungarian", N_("Hungarian"), false, &iso8859_2 },
-       { "irish", N_("Irish"), false, &iso8859_1 },
-       { "italian", N_("Italian"), false, &iso8859_1 },
-       { "lsorbian", N_("Lsorbian"), false, &iso8859_2 },
-       { "magyar", N_("Magyar"), false, &iso8859_2 },
-       { "norsk", N_("Norsk"), false, &iso8859_1 },
-       { "polish", N_("Polish"), false, &iso8859_2 },
-       { "portuges", N_("Portuges"), false, &iso8859_1 },
-       { "romanian", N_("Romanian"), false, &iso8859_2 },
-       { "russian", N_("Russian"), false, &koi8 },
-       { "scottish", N_("Scottish"), false, &iso8859_1 },
-       { "spanish", N_("Spanish"), false, &iso8859_1 },
-       { "slovak", N_("Slovak"), false, &iso8859_2 },
-       { "slovene", N_("Slovene"), false, &iso8859_2 },
-       { "swedish", N_("Swedish"), false, &iso8859_1 },
-       { "turkish", N_("Turkish"), false, &iso8859_9 },
-       { "usorbian", N_("Usorbian"), false, &iso8859_2 },
-       { "welsh", N_("Welsh"), false, &iso8859_1 },
-       { 0, 0, false, 0 }
+       //{ "hungarian", N_("Hungarian"), false, &iso8859_2, "" },
+       { "irish", N_("Irish"), false, &iso8859_1, "" },
+       { "italian", N_("Italian"), false, &iso8859_1, "it_IT" },
+       { "lsorbian", N_("Lsorbian"), false, &iso8859_2, "" },
+       { "magyar", N_("Magyar"), false, &iso8859_2, "" },
+       { "norsk", N_("Norsk"), false, &iso8859_1, "" },
+       { "polish", N_("Polish"), false, &iso8859_2, "" },
+       { "portuges", N_("Portuges"), false, &iso8859_1, "pt_PT" },
+       { "romanian", N_("Romanian"), false, &iso8859_2, "" },
+       { "russian", N_("Russian"), false, &koi8, "" },
+       { "scottish", N_("Scottish"), false, &iso8859_1, "" },
+       { "spanish", N_("Spanish"), false, &iso8859_1, "es_ES" },
+       { "slovak", N_("Slovak"), false, &iso8859_2, "" },
+       { "slovene", N_("Slovene"), false, &iso8859_2, "" },
+       { "swedish", N_("Swedish"), false, &iso8859_1, "" },
+       { "turkish", N_("Turkish"), false, &iso8859_9, "" },
+       { "usorbian", N_("Usorbian"), false, &iso8859_2, "" },
+       { "welsh", N_("Welsh"), false, &iso8859_1, "" },
+       { 0, 0, false, 0, 0 }
        };
 
        int i = 0;
        while (items[i].lang) {
                languages[items[i].lang] =
                        Language(items[i].lang, items[i].display, 
-                                items[i].rtl, items[i].encoding);
+                                items[i].rtl, items[i].encoding,
+                                items[i].code);
                ++i;
        }
        
index 0fe01ff608e47c46b6ad2ef0d8550378ebdd6230..135fac5921607a0d254444154c551a0a66d1e116 100644 (file)
@@ -28,8 +28,10 @@ public:
        Language() : RightToLeft_(false) {}
        ///
        Language(string const & l, string const & d,
-                bool rtl, Encoding const * e)
-               : lang_(l), display_(d), RightToLeft_(rtl) , encoding_(e) {}
+                bool rtl, Encoding const * e, string const & c)
+               : lang_(l), display_(d), RightToLeft_(rtl) , encoding_(e),
+                 code_(c)
+               {}
        ///
        string const & lang() const {
                return lang_;
@@ -46,6 +48,10 @@ public:
        Encoding const * encoding() const {
                return encoding_;
        }
+       ///
+       string const & code() const {
+               return code_;
+       }
 private:
        ///
        string lang_;
@@ -55,6 +61,8 @@ private:
        bool RightToLeft_;
        ///
        Encoding const * encoding_;
+       ///
+       string code_;
 };
 
 #if 0
index 7d635f20a0d7a1b2d7967add9953949a906e7c76..b9068ca739488cd5744b9e51e9f28976713d09d9 100644 (file)
@@ -746,9 +746,7 @@ bool MathedCursor::pullArg()
 void MathedCursor::MacroModeOpen()
 {
    if (!macro_mode)  {
-      macroln = 0;
-      macrobf[0] = '\0';
-      imacro = new MathFuncInset(&macrobf[0]);
+      imacro = new MathFuncInset("");
       Insert (imacro);
       macro_mode = true;
    } else
@@ -760,25 +758,26 @@ void MathedCursor::MacroModeClose()
 {
    if (macro_mode)  {
       macro_mode = false;
-      latexkeys * l = in_word_set(macrobf, macroln);
-      if (macroln > 0 && (!l || (l && IsMacro(l->token, l->id))) && 
-         !MathMacroTable::mathMTable.getMacro(macrobf)) {
+      latexkeys * l = in_word_set(imacro->GetName());
+      if (!imacro->GetName().empty()
+         && (!l || (l && IsMacro(l->token, l->id))) && 
+         !MathMacroTable::mathMTable.getMacro(imacro->GetName())) {
          if (!l) {
-           imacro->SetName(macrobf);
+           //imacro->SetName(macrobf);
              // This guarantees that the string will be removed by destructor
            imacro->SetType(LM_OT_UNDEF);
          } else 
            imacro->SetName(l->name);
       } else {
          Left();
-        imacro->SetName("");
         if (cursor->GetInset()->GetType() == LM_OT_ACCENT) {
             setAccent(static_cast<MathAccentInset*>(cursor->GetInset())->getAccentCode());
         }
         cursor->Delete();
-        if (l || MathMacroTable::mathMTable.getMacro(macrobf)) {
-           Interpret(macrobf);
+        if (l || MathMacroTable::mathMTable.getMacro(imacro->GetName())) {
+           Interpret(imacro->GetName());
         }
+        imacro->SetName("");
       }
       imacro = 0;
    }  
@@ -788,8 +787,8 @@ void MathedCursor::MacroModeClose()
 void MathedCursor::MacroModeBack()
 {
    if (macro_mode) {
-     if (macroln>0) {
-       macrobf[--macroln] = '\0';
+     if (!imacro->GetName().empty()) {
+       imacro->SetName(imacro->GetName().substr(0, imacro->GetName().length() - 1));
        imacro->Metrics();
      } else 
        MacroModeClose();
@@ -801,8 +800,7 @@ void MathedCursor::MacroModeBack()
 void MathedCursor::MacroModeInsert(char c)
 {
    if (macro_mode) {
-      macrobf[macroln + 1] = macrobf[macroln];
-      macrobf[macroln++] = c;
+      imacro->SetName(imacro->GetName() + c);
       imacro->Metrics();
    } else
           lyxerr << "Mathed Warning: we are not in macro mode" << endl;
index b187a72fca21f173fd82345d53efec538153ce5e..96f1de14b6ca75248530959146a73ae64a67b924 100644 (file)
@@ -164,11 +164,7 @@ class MathedCursor {
     MathedTextCodes lastcode;
 
  private:
-       ///
-    char macrobf[80];
-       ///
-    int macroln;
-       ///
+    ///
     MathFuncInset * imacro;
 };
 
index b381cda727acf06b2f361c5619ac40c9183cc91c..59b20baeb2afb67003d0ce07ebeed62bf3692d0f 100644 (file)
@@ -58,7 +58,9 @@
 #include "lyx_gui_misc.h"
 #include "debug.h"
 #include "support/lstrings.h"
+#include "language.h"
 #include "encoding.h"
+#include "support/lstrings.h"
 
 //#define USE_PSPELL 1
 
@@ -593,9 +595,12 @@ void sc_store_replacement(string const & mis, string const & cor) {
 PspellCanHaveError * spell_error_object;
 
 static
-void init_spell_checker(BufferParams const &, string const & /* lang */)
+void init_spell_checker(BufferParams const &, string const & lang)
 {
        PspellConfig * config = new_pspell_config();
+       string code;
+       (void)split(lang, code, '_');
+       config->replace("language-tag", code.c_str());
        spell_error_object = new_pspell_manager(config);
        if (pspell_error_number(spell_error_object) != 0) {
                spell_error = pspell_error_message(spell_error_object);
@@ -787,7 +792,7 @@ void ShowSpellChecker(BufferView * bv)
 }
 
 
-// Perform an ispell session
+// Perform a spell session
 static
 bool RunSpellChecker(BufferView * bv)
 {
@@ -795,8 +800,22 @@ bool RunSpellChecker(BufferView * bv)
        int newvalue;
        FL_OBJECT * obj;
 
-       string tmp = (lyxrc.isp_use_alt_lang) ? lyxrc.isp_alt_lang : bv->buffer()->GetLanguage();
-       bool rtl = tmp == "hebrew" || tmp == "arabic";
+#ifdef USE_PSPELL
+       string tmp = (lyxrc.isp_use_alt_lang) ?
+           lyxrc.isp_alt_lang : bv->buffer()->params.language_info->code();
+#else
+       string tmp = (lyxrc.isp_use_alt_lang) ?
+           lyxrc.isp_alt_lang : bv->buffer()->GetLanguage();
+#endif
+#warning This is not good we should find a way to identify a rtl-language in a more general way. Please have a look Dekel! (Jug)
+// For now I'll change this to a bit more general solution but
+// Please comment on this if you don't like it. We probaly need
+// anoter flag something like lyxrc.isp_use_alt_lang_rtl (true/false)!
+       bool rtl;
+       if (lyxrc.isp_use_alt_lang)
+           rtl = (tmp == "hebrew" || tmp == "arabic");
+       else
+           rtl = bv->buffer()->params.language_info->RightToLeft();
 
        int oldval = 0;  /* used for updating slider only when needed */
        float newval = 0.0;
index 7707ba27b8745044ff6d1b906d212b279772b82f..9628b5a103d19544a05639e7d64865277f66758c 100644 (file)
@@ -2006,7 +2006,6 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 int LyXTabular::Latex(Buffer const * buf,
                      ostream & os, bool fragile, bool fp) const
 {
-#warning Jürgen, this func should be split into more funcs (Lgb)
     int ret = 0;
     int i,j;
     int cell = 0;