Add a bunch of c_str() for string stream uses; remove lyxfunc symbol-insert.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1200 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-11-06 15:47:22 +00:00
parent 29f7055e95
commit acc7e9789e
12 changed files with 38 additions and 18 deletions

View File

@ -1,5 +1,24 @@
2000-11-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/support/lyxstring.C: add a couple "using" directives.
* src/frontends/xforms/FormPreferences.C (ColoursLoadBrowser): add
a .c_str() here too for good measure.
* src/Spacing.C (set): ditto.
* src/lyxfunc.C (Dispatch): ditto.
* src/insets/insettabular.C (copySelection): change .str() to
.str().c_str() to fix problems with lyxstring.
* src/support/filetools.C (GetFileContents): ditto.
* src/buffer.C (asciiParagraph): ditto.
* src/paragraph.C (String): ditto.
* lib/bind/fi_menus.bind: change symbol-insert to math-insert.
* lib/bind/sciword.bind: ditto.
* src/LyXAction.C (init): remove "symbol-insert" function, which
shared LFUN_INSERT_MATH with "math-insert".
* lib/configure.m4: == is not a valid operator for command test.
* src/lyxrc.C: add using directive.

View File

@ -149,12 +149,12 @@
# Math menu
#
\bind "M-e m" "symbol-insert frac"
\bind "M-e n" "symbol-insert sqrt"
\bind "M-e e" "symbol-insert ^"
\bind "M-e a" "symbol-insert _"
\bind "M-e s" "symbol-insert sum"
\bind "M-e i" "symbol-insert int"
\bind "M-e m" "math-insert frac"
\bind "M-e n" "math-insert sqrt"
\bind "M-e e" "math-insert ^"
\bind "M-e a" "math-insert _"
\bind "M-e s" "math-insert sum"
\bind "M-e i" "math-insert int"
\bind "M-e t" "math-mode"
\bind "M-e k" "math-display"
#bind "M-e p" "display-math-panel-or-something" # What function to use?

View File

@ -147,7 +147,7 @@
\bind "C-s e" "math-insert sum"
\bind "C-s p" "math-insert prod"
\bind "C-s i" "math-insert infty"
\bind "C-s x" "symbol-insert times"
\bind "C-s x" "math-insert times"
# My own embellishments for symbols I use often.

View File

@ -381,7 +381,6 @@ void LyXAction::init()
{ LFUN_SETXY, "server-set-xy", "", ReadOnly },
{ LFUN_SET_COLOR, "set-color", "", Noop },
{ LFUN_SPELLCHECK, "spellchecker", "", Noop },
{ LFUN_INSERT_MATH, "symbol-insert", "", Noop },
{ LFUN_SHIFT_TAB, "tab-backward", "", Noop },
{ LFUN_TAB, "tab-forward", "", Noop },
{ LFUN_TABINSERT, "tab-insert", "", Noop },

View File

@ -56,7 +56,7 @@ void Spacing::set(Spacing::Space sp, float val)
void Spacing::set(Spacing::Space sp, string const & val)
{
float fval;
istringstream istr(val);
istringstream istr(val.c_str());
istr >> fval;
set(sp, fval);
}

View File

@ -1647,7 +1647,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
if ((inset = par->GetInset(i))) {
if (!inset->Ascii(this, buffer)) {
string dummy;
string s = rsplit(buffer.str(),
string s = rsplit(buffer.str().c_str(),
dummy, '\n');
currlinelen += s.length();
} else {
@ -1698,7 +1698,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
break;
}
}
return buffer.str();
return buffer.str().c_str();
}

View File

@ -438,7 +438,7 @@ bool FormPreferences::ColoursLoadBrowser(string const & filename)
RGB col;
string name;
istringstream iss(line);
istringstream iss(line.c_str());
iss >> col.r >> col.g >> col.b;
while (iss.good()) {
string next;

View File

@ -1950,7 +1950,7 @@ bool InsetTabular::copySelection(BufferView * bv)
ostringstream sstr;
paste_tabular->Ascii(bv->buffer(), sstr);
bv->stuffClipboard(sstr.str());
bv->stuffClipboard(sstr.str().c_str());
return true;
}

View File

@ -2051,7 +2051,7 @@ string const LyXFunc::Dispatch(int ac,
cur_value = par->spacing.getValue();
}
istringstream istr(argument);
istringstream istr(argument.c_str());
string tmp;
istr >> tmp;
@ -2350,7 +2350,7 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_GOTO_PARAGRAPH:
{
istringstream istr(argument);
istringstream istr(argument.c_str());
int id;
istr >> id;

View File

@ -3935,7 +3935,7 @@ string const LyXParagraph::String(Buffer const * buffer, bool label)
GetInset(i)->LyxCode() == Inset::MATH_CODE) {
std::ostringstream ost;
GetInset(i)->Ascii(buffer, ost);
s += subst(ost.str(),'\n',' ');
s += subst(ost.str().c_str(),'\n',' ');
}
}
@ -3975,7 +3975,7 @@ string const LyXParagraph::String(Buffer const * buffer,
else if (c == META_INSET) {
std::ostringstream ost;
GetInset(i)->Ascii(buffer, ost);
s += ost.str();
s += ost.str().c_str();
}
}

View File

@ -746,7 +746,7 @@ string const GetFileContents(string const & fname)
if (ifs && ofs) {
ofs << ifs.rdbuf();
ifs.close();
return ofs.str();
return ofs.str().c_str();
}
}
lyxerr << "LyX was not able to read file '" << fname << "'" << endl;

View File

@ -24,6 +24,8 @@
#include "LAssert.h"
using std::min;
using std::istream;
using std::ostream;
// This class is supposed to be functionaly equivalent to a
// standard conformant string. This mean among others that we