+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,
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"
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
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())
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) {
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));
_("Refs|R");
_("Layout|L");
_("Insert|I");
-_("Math|M");
+_("Math|a");
_("Options|O");
_("Documents|D");
_("Help|H");
otherkeymap = 0;
}
+Intl::~Intl()
+{
+ delete trans;
+}
+
int Intl::SetPrimary(string const & lang)
{
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());
}
if (keymapon)
Keymap(23); // turn primary on
- trans->setCharset(lyxrc.font_norm.c_str());
+ trans->setCharset(lyxrc.font_norm);
}
public:
///
Intl();
+ ///
+ ~Intl();
/// show key mapping dialog
void MenuKeymap();
#include "lyxlex.h"
#include "lyxlex_pimpl.h"
#include "support/filetools.h"
+#include "support/lstrings.h"
using std::ostream;
using std::istream;
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;
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;
+ }
}
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;
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';