]> git.lyx.org Git - features.git/commitdiff
Various small fixes. Read Changelog
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 26 Sep 2000 13:10:34 +0000 (13:10 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 26 Sep 2000 13:10:34 +0000 (13:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1040 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
ChangeLog
lib/ui/default.ui
po/POTFILES.in
src/LyXView.C
src/buffer.C
src/converter.C
src/ext_l10n.h
src/intl.C
src/intl.h
src/lyxlex.C
src/support/lyxstring.C
src/vspace.C

index dafb744228b3ad144e7b91b228c9efacc9c47849..665d509373c76d24b3e124bb8d5d915120ea3385 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2000-09-26  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/buffer.C (readFile): make sure that the whole version number
+       is read after \lyxformat (even when it contains a comma)
+
+       * lib/ui/default.ui: change shortcut of math menu to M-a.
+
+2000-09-25  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/vspace.C (nextToken): use isStrDbl() to check for proper
+       double values.
+
+       * src/LyXView.C (updateWindowTitle): show the full files name in
+       window title, limited to 30 characters.
+
+       * src/support/lyxstring.C (lyxstring): fix it correctly this time.
+       When a number of characters has been given, we should not assume
+       that the string is 0-terminated.
+
+       * src/intl.C (InitKeyMapper): remove a bunch of string::c_str()
+       calls (fixes some memory leaks)
+       
+       * src/intl.[Ch]: add a destructor for Intl, in order to delete the
+       trans member on exit.
+
+2000-09-22  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/converter.C (GetReachable): fix typo.
+
+       * src/lyxlex.C (GetFloat): rewrite to use strToDbl() and
+       understand ',' instead of '.'.
+       (GetInteger): rewrite to use strToInt().
+
 2000-09-26  Juergen Vigna  <jug@sad.it>
 
        * src/frontends/xforms/FormParagraph.C: fixed de/activation of fields,
index bf9f6ce9321b440ab55b24cffae0730d391e59a2..3c655137b2d627c3867de74563738f1b5172b18f 100644 (file)
@@ -12,7 +12,7 @@ Menuset
        Submenu "Refs|R" "refs"
        Submenu "Layout|L" "layout"
        Submenu "Insert|I" "insert"
-       Submenu "Math|M" "math"
+       Submenu "Math|a" "math"
        Submenu "Options|O" "options"
        Submenu "Documents|D" "documents"
        Submenu "Help|H" "help"
index 325bf1569cf2a0357a2b448d34c59159d3a64060..97bca017d1e5a61eb423d92171eb5124ae2a8097 100644 (file)
@@ -57,6 +57,8 @@ src/frontends/xforms/FormGraphics.C
 src/frontends/xforms/form_graphics.C
 src/frontends/xforms/FormIndex.C
 src/frontends/xforms/form_index.C
+src/frontends/xforms/FormParagraph.C
+src/frontends/xforms/form_paragraph.C
 src/frontends/xforms/FormPreferences.C
 src/frontends/xforms/form_preferences.C
 src/frontends/xforms/FormPrint.C
index 4fc8f999b5c286424f389c29c078e101a7dcff82..ecba3b8bb84bb7539a9ee73ea1053b6c4de328b9 100644 (file)
@@ -453,7 +453,7 @@ void LyXView::updateWindowTitle()
        if (view()->available()) {
                string cur_title = buffer()->fileName();
                if (!cur_title.empty()){
-                       title += ": " + MakeDisplayPath(cur_title);
+                       title += ": " + MakeDisplayPath(cur_title, 30);
                        if (!buffer()->isLyxClean())
                                title += _(" (Changed)");
                        if (buffer()->isReadonly())
index 486030271e3b1ee1c393448500f880255d1561cc..37b16e5bda7bee2a1eb31300d985529237774b65 100644 (file)
@@ -1092,7 +1092,7 @@ bool Buffer::readFile(LyXLex & lex, LyXParagraph * par)
                lex.next();
                string token(lex.GetString());
                if (token == "\\lyxformat") { // the first token _must_ be...
-                       lex.next();
+                       lex.EatLine();
                        format = lex.GetFloat();
                        if (format > 1) {
                                if (LYX_FORMAT - format > 0.05) {
index c16f8a083bc2b0c62ac67eecc3bc2106aa94db75..c964d685c92ae88ef8f8f31b1c683bfe25070d8f 100644 (file)
@@ -246,7 +246,7 @@ Converter::GetReachable(string const & from, bool only_viewable)
                        name += ":" + (*it).from;
                        string tmp;
                        split((*it).command, tmp, ' ');
-                       prettyname  += _("(using ") + tmp + ")";        
+                       prettyname  += _(" (using ") + tmp + ")";       
                }
                if (!only_viewable || !format->viewer.empty())
                        result.push_back(pair<string,string>(name, prettyname));
index 9f82efc74294f8615cc11b09ea189114cbe85746..5b23fc4886bbe39b87fed0acb73cf8c286a22868 100644 (file)
@@ -4,7 +4,7 @@ _("Toc|T");
 _("Refs|R");
 _("Layout|L");
 _("Insert|I");
-_("Math|M");
+_("Math|a");
 _("Options|O");
 _("Documents|D");
 _("Help|H");
index a3b93fe55b06f7c1a5f613b87621fc2cd8e5b195..c6292d7ddcf6b324a5d58564ac4ba32967029caa 100644 (file)
@@ -48,6 +48,11 @@ Intl::Intl()
        otherkeymap = 0;
 }
 
+Intl::~Intl()
+{
+       delete trans;
+}
+
 
 int Intl::SetPrimary(string const & lang)
 {
@@ -274,22 +279,22 @@ void Intl::InitKeyMapper(bool on)
        Language2->addto("default");
        for (Languages::const_iterator cit = languages.begin();
             cit != languages.end(); ++cit) {
-               Language->addto((*cit).second.lang().c_str());
-               Language2->addto((*cit).second.lang().c_str());
+               Language->addto((*cit).second.lang());
+               Language2->addto((*cit).second.lang());
                ++n;
        }
 
        Language->addto(_("other..."));
        Language2->addto(_("other..."));
        otherkeymap = n + 1;
-       if (!Language->select_text(prim_lang.c_str())) {
+       if (!Language->select_text(prim_lang)) {
                Language->select(n+1);
                fl_set_input(fd_form_keymap->OtherKeymap, prim_lang.c_str());
        }
        else 
                trans->SetPrimary(prim_lang);
 
-       if (!Language2->select_text(sec_lang.c_str())) {
+       if (!Language2->select_text(sec_lang)) {
                Language2->select(n + 1);
                fl_set_input(fd_form_keymap->OtherKeymap2, sec_lang.c_str());
        }
@@ -300,7 +305,7 @@ void Intl::InitKeyMapper(bool on)
        if (keymapon)
                Keymap(23); // turn primary on
 
-       trans->setCharset(lyxrc.font_norm.c_str());
+       trans->setCharset(lyxrc.font_norm);
 }
 
 
index f6a7caa1db302c22771253620edbdbfe7495e840..b30d41de83ed68c069776a9a436567fa9c844930 100644 (file)
@@ -32,6 +32,8 @@ class Intl {
 public:
        ///
        Intl();
+       ///
+       ~Intl();
        
        /// show key mapping dialog
        void MenuKeymap(); 
index 7bb8ea59c2d6bd2b941dbde4374305a871c767c9..9c23930a7444bba5329b5af5cc59f477f515802b 100644 (file)
@@ -20,6 +20,7 @@
 #include "lyxlex.h"
 #include "lyxlex_pimpl.h"
 #include "support/filetools.h"
+#include "support/lstrings.h"
 
 using std::ostream;
 using std::istream;
@@ -111,8 +112,8 @@ int LyXLex::lex()
 
 int LyXLex::GetInteger() const
 {
-       if (pimpl_->buff[0] > ' ')   
-               return atoi(pimpl_->buff);
+       if (isStrInt(pimpl_->GetString()))
+               return strToInt(pimpl_->GetString());
        else {
                pimpl_->printError("Bad integer `$$Token'");
                return -1;
@@ -122,12 +123,16 @@ int LyXLex::GetInteger() const
 
 float LyXLex::GetFloat() const
 {
-   if (pimpl_->buff[0] > ' ')
-       return atof(pimpl_->buff);
-   else {
-       pimpl_->printError("Bad float `$$Token'");
-       return -1;
-   }
+       // replace comma with dot in case the file was written with
+       // the wrong locale (should be rare, but is easy enough to
+       // avoid). 
+       string str = subst(pimpl_->GetString(), ",", ".");
+       if (isStrDbl(str))
+               return strToDbl(str);
+       else {
+               pimpl_->printError("Bad float `$$Token'");
+               return -1;
+       }
 }
 
 
index a15cac0f374e9b19f651665b0bffd1c73add9c95..ce010fad4c3348509e07362ea63df04999a734eb 100644 (file)
@@ -415,11 +415,7 @@ lyxstring::lyxstring(value_type const * s, size_type n)
        Assert(s && n < npos); // STD!
        static Srep empty_rep(0, "");
        if (*s && n) { // s is not empty string and n > 0
-               size_type l = 0;
-               while (l < n && s[l])
-                       l++;
-               rep = new Srep(l, s);
-               // rep = new Srep(min(strlen(s),n), s);
+               rep = new Srep(n, s);
        } else {
                ++empty_rep.ref;
                rep = &empty_rep;
index 392b80c102c96e151a25a23afeab0b0902ae0446..38d2eda0263802beeaf1c73943517024d70e947e 100644 (file)
@@ -93,9 +93,8 @@ char nextToken(string & data)
                if ((i = data.find_last_of("0123456789.")) != string::npos) {
                        if (number_index > 3) return 'E';  // Error
                         string buffer = data.substr(0, i + 1);
-                       double x = strToDbl(buffer);
-                       if (x || (buffer[0] == '0')) {
-                               number[number_index] = x;
+                       if (isStrDbl(buffer)) {
+                               number[number_index] = strToDbl(buffer);
                                lyx_advance(data, i + 1);
                                ++number_index;
                                return 'n';