]> git.lyx.org Git - features.git/commitdiff
small changes and two patches from Dekel
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 3 Oct 2000 18:38:10 +0000 (18:38 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 3 Oct 2000 18:38:10 +0000 (18:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1077 a592a061-630c-0410-9148-cb99ea01b6c8

18 files changed:
ChangeLog
boost/Makefile.am
lib/configure
lib/configure.m4
po/POTFILES.in
src/BufferView.h
src/BufferView2.C
src/BufferView_pimpl.C
src/exporter.C
src/frontends/xforms/Menubar_pimpl.C
src/insets/insetbib.C
src/insets/insetbutton.C
src/insets/insetcite.C
src/insets/insettabular.C
src/lyx_gui_misc.C
src/lyx_gui_misc.h
src/paragraph.C
src/support/filetools.C

index 84d759b1ddfda60e945e33e3e45f600becdd7430..62460717ec6aae60165f13a1c238ba29d8786375 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2000-10-03  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+
+       * src/insets/insettabular.C (setPos): change for loop to not use
+       sequencing operator. Please check this Jürgen.
+
+       * src/frontends/xforms/Menubar_pimpl.C (makeMenubar): use "c"
+       instead of 'c'
+       * src/insets/insetcite.C (getScreenLabel): ditto
+       * src/support/filetools.C (QuoteName): ditto
+       (ChangeExtension): ditto
+
+       * src/BufferView_pimpl.C (scrollCB): make heigt int
+
+       * src/BufferView2.C (insertInset): comment out unused arg
+
+       * boost/Makefile.am (EXTRADIST): new variable
+
+2000-10-03  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * src/exporter.C (IsExportable): Fixed
+       
+       * lib/configure.m4: Small fix
+
+2000-10-03  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * src/insets/insetbutton.C (width): Changed to work with no GUI.
+       * src/insets/insetbib.C (bibitemWidest): ditto.
+       * src/lyx_gui_misc.C (AskQuestion,AskConfirmation,askForText): ditto.
+            
 2000-10-03  Juergen Vigna  <jug@sad.it>
 
        * src/BufferView2.C (theLockingInset): removed const because of
index 2663749eaeb542db0c5f0c39b03561348ff45f21..fc3cdb8c5cbac92a1b5090a5e37a5d5b66b004aa 100644 (file)
@@ -1,3 +1,5 @@
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
 ETAGS_ARGS = --lang=c++
+
+EXTRADIST = boost libs
index c31b804dc99f4e04374c0067666f82c9e6ff82c2..76c79ec5489c0cd51f243e63047c57eac1007a99 100755 (executable)
@@ -225,9 +225,9 @@ PATH=${save_PATH}
 
 # Search something to process a literate document
 echo $ac_n "checking for a Literate programming processor""... $ac_c"
-echo "$ac_t""("noweave -delay -index \$\$FName > \$\$OutName")"
+echo "$ac_t""(noweave)"
 LITERATE=
-for ac_prog in "noweave -delay -index \$\$FName > \$\$OutName"
+for ac_prog in noweave
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog ; ac_word=$2
@@ -258,7 +258,8 @@ if test -z "$LITERATE" ; then
   LITERATE=none
 fi
 
-if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT="nw"; fi
+test $LITERATE = "noweave" && LITERATE="noweave -delay -index \$\$FName > \$\$OutName"
+LITERATE_EXT="nw"
 
 # Search for a Postscript interpreter
 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
index ce3855ddc4d5419db51ceed506428bdcd4665575..d0eb420527417b91ea748695e6cc66f04c03c1a7 100644 (file)
@@ -186,8 +186,9 @@ SEARCH_PROG([for reLyX LaTeX-to-LyX translator],RELYX,reLyX)
 PATH=${save_PATH}
 
 # Search something to process a literate document
-SEARCH_PROG([for a Literate programming processor],LITERATE,"noweave -delay -index \$\$FName > \$\$OutName")
-if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT="nw"; fi
+SEARCH_PROG([for a Literate programming processor],LITERATE,noweave)
+test $LITERATE = "noweave" && LITERATE="noweave -delay -index \$\$FName > \$\$OutName"
+LITERATE_EXT="nw"
 
 # Search for a Postscript interpreter
 SEARCH_PROG([for a Postscript interpreter],GS, gs)
index 7471c53912704412e4a560c3f16dfc4861da4882..78103e617bae81341532fa99eb40ba5a4a61d30d 100644 (file)
@@ -64,19 +64,6 @@ src/frontends/xforms/FormPrint.C
 src/frontends/xforms/form_print.C
 src/frontends/xforms/FormRef.C
 src/frontends/xforms/form_ref.C
-src/frontends/xforms/forms/form_citation.C
-src/frontends/xforms/forms/form_copyright.C
-src/frontends/xforms/forms/form_document.C
-src/frontends/xforms/forms/form_error.C
-src/frontends/xforms/forms/form_graphics.C
-src/frontends/xforms/forms/form_index.C
-src/frontends/xforms/forms/form_paragraph.C
-src/frontends/xforms/forms/form_preferences.C
-src/frontends/xforms/forms/form_print.C
-src/frontends/xforms/forms/form_ref.C
-src/frontends/xforms/forms/form_tabular.C
-src/frontends/xforms/forms/form_toc.C
-src/frontends/xforms/forms/form_url.C
 src/frontends/xforms/FormTabular.C
 src/frontends/xforms/form_tabular.C
 src/frontends/xforms/FormToc.C
index 7f786fcd501bb83b861a46fc5a50b335284b99e2..822033ede2199a20f0b34f3e0d51cd5b7cb1bcb4 100644 (file)
@@ -103,6 +103,7 @@ public:
        int workWidth() const;
        ///
        UpdatableInset * theLockingInset() const;
+       ///
        void theLockingInset(UpdatableInset * inset); 
        ///
        void updateInset(Inset * inset, bool mark_dirty);
index 809365a1723f2199d5468c84b1b42ba697602f73..7f75d306c7fbab8e78ae0ade0f102caa9e450ff9 100644 (file)
@@ -197,8 +197,9 @@ void BufferView::setCursorFromRow(int row)
        text->SetCursor(this, texrowpar, tmppos);
 }
 
+
 bool BufferView::insertInset(Inset * inset, string const & lout,
-                        bool no_table)
+                            bool /*no_table*/)
 {
        // if we are in a locking inset we should try to insert the
        // inset there otherwise this is a illegal function now
index c50fbf5f1de87cefc738e0f448e6b5b2b3d66585..22780d0629fd3504a3c8c589b45737a7e9b5e890 100644 (file)
@@ -428,7 +428,7 @@ void BufferView::Pimpl::scrollCB(double value)
 
        if (cursor_follows_scrollbar) {
                LyXText * vbt = bv_->text;
-               unsigned int height = vbt->DefaultHeight();
+               int height = vbt->DefaultHeight();
                
                if (vbt->cursor.y() < (int)(bv_->text->first + height)) {
                        vbt->SetCursorFromCoordinates(bv_, 0,
@@ -884,7 +884,8 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y,
                LyXFont font = text->GetFont(bv_->buffer(),
                                                  cursor.par(), cursor.pos());
                bool is_rtl = font.isVisibleRightToLeft();
-               int start_x, end_x;
+               int start_x;
+               int end_x;
 
                if (is_rtl) {
                        start_x = cursor.x() - tmpinset->width(bv_, font) + tmpinset->scroll();
@@ -913,7 +914,8 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y,
                LyXFont font = text->GetFont(bv_->buffer(), cursor.par(),
                                                  cursor.pos()-1);
                bool is_rtl = font.isVisibleRightToLeft();
-               int start_x, end_x;
+               int start_x;
+               int end_x;
 
                if (!is_rtl) {
                        start_x = cursor.x() - tmpinset->width(bv_, font) +
index 94405ac999d58ccb28891c94595b3b523b68b6c1..a906389e2e18f3e9f63c95427429711ec910ebc1 100644 (file)
@@ -84,12 +84,15 @@ bool Exporter::Preview(Buffer * buffer, string const & format0)
 
 bool Exporter::IsExportable(Buffer const * buffer, string const & format)
 {
-       // This is not efficient
+#warning This is not efficient (Dekel)
        vector<pair<string, string> > const v = GetExportableFormats(buffer);
        for (vector<pair<string, string> >::const_iterator it = v.begin();
-            it != v.end(); ++it)
-               if ((*it).first == format)
+            it != v.end(); ++it) {
+               string format2;
+                split((*it).first, format2, ':');
+               if (format == format2)
                        return true;
+       }
        return false;
 }
 
index 4826f525c1eaa49db53691dbad2fa8796b9bfbfd..5136e7c20e382c5730618fc720c3fa8956c48ab0 100644 (file)
@@ -114,7 +114,7 @@ void Menubar::Pimpl::makeMenubar(Menu const &menu)
                        break;
                }
                string label = i->label();
-               string shortcut = '#' + i->shortcut();
+               string shortcut = "#" + i->shortcut();
                int width = string_width(label);
                obj = fl_add_button(FL_TOUCH_BUTTON,
                                    air + moffset, yloc,
index 14cd00d6a022982ad7e9e0b5328e6a43f817d390..7a586aabf26ef5c045043ae0aa2a9868970fe01f 100644 (file)
@@ -18,6 +18,7 @@
 #include "lyxtext.h"
 #include "support/filetools.h"
 #include "support/path.h"
+#include "lyxrc.h"
 
 using std::ostream;
 using std::ifstream;
@@ -378,11 +379,12 @@ int bibitemMaxWidth(BufferView * bv, LyXFont const & font)
 
 
 // ale070405
-string const bibitemWidest(BufferView * bv)
+string const bibitemWidest(Buffer const * buffer)
 {
        int w = 0;
        // Does look like a hack? It is! (but will change at 0.13)
-       LyXParagraph * par = bv->buffer()->paragraph;
+       LyXParagraph * par = buffer->paragraph;
+       BufferView * bv = buffer->getUser();
        InsetBibKey * bkey = 0;
        LyXFont font;
       
index f5c467eaa14916c10b552243c765d95dc980f483..a8a75095e9efcaf83978ae7abcfce2ea13a7c309 100644 (file)
@@ -70,6 +70,8 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const
        
        int width, ascent, descent;
         string s = getScreenLabel();
+       if (!bv)
+               return s.length();
        
         if (Editable()) {
                bv->painter().buttonText(0, 0, s, font,
index fa2777fa9761f689f677a56217f4f51b6e86a36a..a74989a400a74f54a38111e36e15d8e3e879e502 100644 (file)
@@ -53,7 +53,7 @@ string const InsetCitation::getScreenLabel() const
        if (!getOptions().empty())
                label += ", " + getOptions();
 
-       return '[' + label + ']';
+       return "[" + label + "]";
 }
 
 
index 7b44fc76a8feb500cac2d08080b6e2f5f2b3a06b..0d0bc9d93a26dba794b29e6384c6b1e4d197a682 100644 (file)
@@ -1060,9 +1060,19 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
     // now search the right column
     int lx = tabular->GetWidthOfColumn(actcell) -
        tabular->GetAdditionalWidth(actcell);
+#warning Jürgen, can you rewrite this to _not_ use the sequencing operator. (Lgb)
+#if 0
     for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
        ++actcell,lx += tabular->GetWidthOfColumn(actcell) +
            tabular->GetAdditionalWidth(actcell - 1));
+#else
+    // Jürgen, you should check that this is correct. (Lgb)
+    for (; !tabular->IsLastCellInRow(actcell) && lx < x; ++actcell) {
+           lx += tabular->GetWidthOfColumn(actcell + 1)
+                   + tabular->GetAdditionalWidth(actcell);
+    }
+    
+#endif
     cursor.pos(0);
     resetPos(bv);
     if ((lx - (tabular->GetWidthOfColumn(actcell) / 2)) < x) {
@@ -1082,7 +1092,7 @@ int InsetTabular::getCellXPos(int cell) const
     for(; !tabular->IsFirstCellInRow(c); --c)
        ;
     int lx = tabular->GetWidthOfColumn(cell);
-    for(; (c < cell); ++c) {
+    for(; c < cell; ++c) {
        lx += tabular->GetWidthOfColumn(c);
     }
     return (lx - tabular->GetWidthOfColumn(cell) + top_x);
index 678b03df87401d6e52e4d5f6210cce1bbb363851..8d05868f4c909265b50edaed2c096ab5f23144a9 100644 (file)
@@ -35,6 +35,7 @@
 #include "LyXView.h"
 #include "bufferview_funcs.h"
 #include "support/filetools.h"
+#include "lyxrc.h"
 
 using std::pair;
 using std::make_pair;
@@ -305,8 +306,23 @@ void WriteFSAlert(string const & s1, string const & s2)
 }
 
 
-bool AskQuestion(string const & s1, string const & s2, string const & s3)
+bool AskQuestion(string const & s1, string const & s2, string const & s3,
+                bool default_value)
 {
+       if (!lyxrc.use_gui) {
+               lyxerr << "----------------------------------------" << endl
+                      << s1 << endl;
+               if (!s2.empty())
+                       lyxerr << s2 << endl;
+               if (!s3.empty())
+                       lyxerr << s3 << endl;
+               lyxerr << "Assuming answer is "
+                      << (default_value ? "yes" : "no")
+                      << endl
+                      << "----------------------------------------" << endl;
+               return default_value;
+       }
+
        fl_set_resource("flQuestion.yes.label", idex(_("Yes|Yy#y")));
        fl_set_resource("flQuestion.no.label", idex(_("No|Nn#n")));
        return fl_show_question((s1 + "\n" + s2 + "\n" + s3).c_str(), 0);
@@ -314,8 +330,28 @@ bool AskQuestion(string const & s1, string const & s2, string const & s3)
 
 
 // Returns 1 for yes, 2 for no, 3 for cancel.
-int AskConfirmation(string const & s1, string const & s2, string const & s3)
+int AskConfirmation(string const & s1, string const & s2, string const & s3,
+                   int default_value)
 {
+       if (!lyxrc.use_gui) {
+               lyxerr << "----------------------------------------" << endl
+                      << s1 << endl;
+               if (!s2.empty())
+                       lyxerr << s2 << endl;
+               if (!s3.empty())
+                       lyxerr << s3 << endl;
+               lyxerr << "Assuming answer is ";
+               if (default_value == 1)
+                       lyxerr << "yes";
+               else if (default_value == 2)
+                       lyxerr << "no";
+               else
+                       lyxerr << "cancel";
+               lyxerr << endl
+                      << "----------------------------------------" << endl;
+               return default_value;
+       }
+
        fl_set_choices_shortcut(scex(_("Yes|Yy#y")),
                                scex(_("No|Nn#n")),
                                scex(_("Cancel|^[")));
@@ -330,6 +366,14 @@ int AskConfirmation(string const & s1, string const & s2, string const & s3)
 pair<bool, string> const
 askForText(string const & msg, string const & dflt)
 {
+       if (!lyxrc.use_gui) {
+               lyxerr << "----------------------------------------" << endl
+                      << msg << endl
+                      << "Assuming answer is " << dflt
+                      << "----------------------------------------" << endl;
+               return make_pair<bool, string>(true, dflt);
+       }
+
        fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
        fl_set_resource("flInput.ok.label", idex(_("OK|#O")));
        fl_set_resource("flInput.clear.label", idex(_("Clear|#e")));
index 70dc71854c2d81cde46e60b9c7c277c139149a52..89e4191b9ffea012dde3efa3d88ce03a9c528853 100644 (file)
@@ -59,11 +59,11 @@ void WriteFSAlert(string const & s1, string const & s2 = string());
 
 /// Asks "Yes" or "No". Returns true for yes, false for no
 bool AskQuestion(string const & s1, string const & s2 = string(),
-                string const & s3 = string());
+                string const & s3 = string(), bool default_value = true);
 
 /// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
 int AskConfirmation(string const & s1, string const & s2 = string(), 
-                   string const & s3 = string());
+                   string const & s3 = string(), int default_value = 1);
 
 /// returns a bool: false=cancelled, true=okay. string contains returned text
 std::pair<bool, string> const
index 419c7e914573fb4e0f811a80a86a67000ef9d315..ed9ed0703891aa18bbbedbae1c7e11cedaff8716 100644 (file)
@@ -51,7 +51,7 @@ int tex_code_break_column = 72;  // needs non-zero initialization. set later.
 // this is a bad idea, but how can LyXParagraph find its buffer to get
 // parameters? (JMarc)
 extern BufferView * current_view;
-extern string bibitemWidest(BufferView *);
+extern string bibitemWidest(Buffer const *);
 
 // this is a minibuffer
 static char minibuffer_char;
@@ -3227,7 +3227,7 @@ LyXParagraph * LyXParagraph::TeXEnvironment(Buffer const * buf,
                } else if (style.labeltype == LABEL_BIBLIO) {
                        // ale970405
                        os << "\\begin{" << style.latexname() << "}{"
-                          <<  bibitemWidest(current_view)
+                          <<  bibitemWidest(buf)
                           << "}\n";
                } else if (style.latextype == LATEX_ITEM_ENVIRONMENT) {
 #ifdef FANCY_FOOTNOTE_CODE
index 704de2db558d2992636e32b54e9b22afda7bdc2d..8f19df47a52d3bd8a31d1d5e21f675e9072ad941 100644 (file)
@@ -98,7 +98,7 @@ string const QuoteName(string const & name)
 {
        // CHECK Add proper emx support here!
 #ifndef __EMX__
-       return '\'' + name + '\'';
+       return "\'" + name + "\'";
 #else
        return name; 
 #endif
@@ -940,7 +940,7 @@ ChangeExtension(string const & oldname, string const & extension)
        string ext;
        // Make sure the extension starts with a dot
        if (!extension.empty() && extension[0] != '.')
-               ext= '.' + extension;
+               ext= "." + extension;
        else
                ext = extension;