From 0e9bd2e87dbf1f2791cead146f114b555d2ca86d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 13 May 2003 16:24:49 +0000 Subject: [PATCH] STRCONV() all over the place git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6956 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 7 +++++++ src/ParagraphParameters.C | 5 +++-- src/ToolbarBackend.C | 1 + src/bufferparams.C | 3 ++- src/format.C | 1 - src/frontends/controllers/ControlParagraph.C | 4 ++-- src/frontends/controllers/biblio.C | 12 +++++++----- src/frontends/xforms/FormBase.C | 3 +-- src/frontends/xforms/FormDialogView.C | 3 +-- src/insets/ChangeLog | 13 +++++++++++++ src/insets/insetcommand.C | 8 +++----- src/insets/insetexternal.C | 5 ++--- src/insets/insetfloat.C | 10 +++++----- src/insets/insetfloat.h | 5 ++--- src/insets/insetgraphics.C | 13 ++++--------- src/insets/insetinclude.C | 14 ++++---------- src/insets/insetminipage.C | 5 ++--- src/insets/insetparent.C | 3 ++- src/insets/insettabular.C | 8 +++----- src/insets/insettext.C | 2 +- src/insets/insetwrap.C | 11 ++++++----- src/mathed/command_inset.C | 3 +-- src/mathed/math_gridinset.C | 4 ++-- src/mathed/math_parser.C | 1 - src/support/ChangeLog | 2 ++ src/support/lstrings.C | 5 +++-- src/support/lyxstring.h | 4 ++-- src/tex2lyx/math.C | 2 -- src/tex2lyx/preamble.C | 1 - src/tex2lyx/table.C | 8 +++----- src/tex2lyx/tex2lyx.C | 6 ++---- src/tex2lyx/texparser.C | 3 +-- src/tex2lyx/text.C | 6 ++---- src/text3.C | 5 +++-- 34 files changed, 92 insertions(+), 94 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c5ada9b6c3..3f4bdf4b62 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -12,6 +12,13 @@ * toc.C: * tabular_funcs.h: tostr() from its own header + * ParagraphParameters.C: + * ToolbarBackend.C: + * bufferparams.C: + * format.C: + * lyxlex_pimpl.C: + * text3.C: STRCONV() + 2003-05-12 André Pönitz * BufferView.C: diff --git a/src/ParagraphParameters.C b/src/ParagraphParameters.C index 6319f67005..347ef89f7e 100644 --- a/src/ParagraphParameters.C +++ b/src/ParagraphParameters.C @@ -7,6 +7,7 @@ #include "buffer.h" #include "BufferView.h" +#include "Lsstream.h" #include "gettext.h" #include "paragraph.h" #include "lyxtext.h" @@ -420,7 +421,7 @@ void ParagraphParameters::write(ostream & os) const void setParagraphParams(BufferView & bv, string const & data) { - istringstream is(data); + istringstream is(STRCONV(data)); LyXLex lex(0,0); lex.setStream(is); @@ -471,5 +472,5 @@ void params2string(Paragraph const & par, string & data) /// is paragraph in inset os << "\\ininset " << par.inInset() << '\n'; - data = os.str(); + data = STRCONV(os.str()); } diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index 1d379e0ab6..0d15ccc091 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -26,6 +26,7 @@ using std::endl; using std::vector; +using std::make_pair; ToolbarBackend toolbarbackend; diff --git a/src/bufferparams.C b/src/bufferparams.C index dded2ce1c8..4e5d89f43b 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -43,6 +43,7 @@ using std::pair; #endif bool use_babel; + BufferParams::BufferParams() // Initialize textclass to point to article. if `first' is // true in the returned pair, then `second' is the textclass @@ -195,7 +196,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token) tracking_changes = lex.getInteger(); } else if (token == "\\author") { lex.nextToken(); - istringstream ss(lex.getString()); + istringstream ss(STRCONV(lex.getString())); Author a; ss >> a; author_map.push_back(authorlist.record(a)); diff --git a/src/format.C b/src/format.C index a7051ac443..4f85ce34e9 100644 --- a/src/format.C +++ b/src/format.C @@ -24,7 +24,6 @@ #include "support/lyxfunctional.h" - namespace { string const token_from("$$i"); diff --git a/src/frontends/controllers/ControlParagraph.C b/src/frontends/controllers/ControlParagraph.C index 5d817d31e1..3caf7a1946 100644 --- a/src/frontends/controllers/ControlParagraph.C +++ b/src/frontends/controllers/ControlParagraph.C @@ -28,7 +28,7 @@ ControlParagraph::ControlParagraph(Dialog & parent) bool ControlParagraph::initialiseParams(string const & data) { - istringstream is(data); + istringstream is(STRCONV(data)); LyXLex lex(0,0); lex.setStream(is); @@ -118,7 +118,7 @@ void ControlParagraph::dispatchParams() { ostringstream data; params().write(data); - FuncRequest const fr(LFUN_PARAGRAPH_APPLY, data.str()); + FuncRequest const fr(LFUN_PARAGRAPH_APPLY, STRCONV(data.str())); kernel().dispatch(fr); } diff --git a/src/frontends/controllers/biblio.C b/src/frontends/controllers/biblio.C index 56255fdfdd..60ca6d2d8b 100644 --- a/src/frontends/controllers/biblio.C +++ b/src/frontends/controllers/biblio.C @@ -12,6 +12,8 @@ #include #include "biblio.h" + +#include "Lsstream.h" #include "gettext.h" // for _() #include "helper_funcs.h" #include "Lsstream.h" @@ -26,6 +28,7 @@ using std::vector; + namespace biblio { string const familyName(string const & name) @@ -78,6 +81,7 @@ string const getAbbreviatedAuthor(InfoMap const & map, string const & key) } string author = parseBibTeX(data, "author"); + if (author.empty()) author = parseBibTeX(data, "editor"); @@ -252,9 +256,7 @@ string const escape_special_chars(string const & expr) // The '$' must be prefixed with the escape character '\' for // boost to treat it as a literal. // Thus, to prefix a matched expression with '\', we use: - string const fmt("\\\\$&"); - - return reg.Merge(expr, fmt); + return STRCONV(reg.Merge(STRCONV(expr), "\\\\$&")); } @@ -265,7 +267,7 @@ struct RegexMatch // re and icase are used to construct an instance of boost::RegEx. // if icase is true, then matching is insensitive to case RegexMatch(InfoMap const & m, string const & re, bool icase) - : map_(m), regex_(re, icase) {} + : map_(m), regex_(STRCONV(re), icase) {} bool operator()(string const & key) { if (!validRE()) @@ -280,7 +282,7 @@ struct RegexMatch // Attempts to find a match for the current RE // somewhere in data. - return regex_.Search(data); + return regex_.Search(STRCONV(data)); } bool validRE() const { return regex_.error_code() == 0; } diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index feb0d3dc7c..2a32d598df 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -10,7 +10,6 @@ #include - #include "FormBase.h" #include "ControlButtons.h" @@ -321,7 +320,7 @@ void FormBase::postMessage(string const & message) boost::format(_("WARNING! %1$s")) : boost::format("%1$s"); - string const str = formatted(boost::io::str(fmter % message), + string const str = formatted(STRCONV(boost::io::str(fmter % message)), width, FL_NORMAL_SIZE); #else string const tmp = warning_posted_ ? diff --git a/src/frontends/xforms/FormDialogView.C b/src/frontends/xforms/FormDialogView.C index f6c9b1a72a..c71b2a963c 100644 --- a/src/frontends/xforms/FormDialogView.C +++ b/src/frontends/xforms/FormDialogView.C @@ -10,7 +10,6 @@ #include - #include "FormDialogView.h" #include "Dialog.h" @@ -323,7 +322,7 @@ void FormDialogView::postMessage(string const & message) boost::format(_("WARNING! %1$s")) : boost::format("%1$s"); - string const str = formatted(boost::io::str(fmter % message), + string const str = formatted(STRCONV(boost::io::str(fmter % message)), width, FL_NORMAL_SIZE); #else string const tmp = warning_posted_ ? diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 5b1dce1abc..c7b59c7ab2 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -8,6 +8,19 @@ * insetinclude.C: * insetwrap.C: tostr from own header + * insetcommand.C: + * insetexternal.C: + * insetfloat.C: + * insetfloat.h: + * insetgraphics.C: + * insetinclude.C: + * insetminipage.C: + * insetparent.C: + * insettabular.C: + * insettext.C: + * insetwrap.C: STRCONV + + 2003-05-12 André Pönitz * insetcaption.C: diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index debea3f0a4..86203f397b 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -124,7 +124,7 @@ void InsetCommandMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -147,14 +147,12 @@ void InsetCommandMailer::string2params(string const & in, } -string const -InsetCommandMailer::params2string(string const & name, +string const InsetCommandMailer::params2string(string const & name, InsetCommandParams const & params) { ostringstream data; data << name << ' '; params.write(data); data << "\\end_inset\n"; - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index cfafab15e6..aae22af7f8 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -385,7 +385,7 @@ void InsetExternalMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -422,6 +422,5 @@ InsetExternalMailer::params2string(InsetExternal::Params const & params) data << name_ << ' '; inset.write(0, data); data << "\\end_inset\n"; - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 43518fbc07..54295b4d8d 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -23,6 +23,7 @@ #include "gettext.h" #include "iterators.h" #include "LaTeXFeatures.h" +#include "Lsstream.h" #include "lyxfont.h" #include "lyxlex.h" #include "lyxtext.h" @@ -38,6 +39,7 @@ using std::ostream; using std::endl; + // With this inset it will be possible to support the latex package // float.sty, and I am sure that with this and some additional support // classes we can support similar functionality in other formats @@ -400,7 +402,7 @@ void InsetFloatMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -426,12 +428,10 @@ void InsetFloatMailer::string2params(string const & in, } -string const -InsetFloatMailer::params2string(InsetFloatParams const & params) +string const InsetFloatMailer::params2string(InsetFloatParams const & params) { ostringstream data; data << name_ << ' '; params.write(data); - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 8658f5a6c9..568dfa1289 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -10,9 +10,8 @@ * Full author contact details are available in file CREDITS */ -#ifndef InsetFloat_H -#define InsetFloat_H - +#ifndef INSETFLOAT_H +#define INSETFLOAT_H #include "insetcollapsable.h" #include "toc.h" diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 88907ea3b8..29c8dd28dc 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -84,6 +84,7 @@ TODO #include "support/lyxalgo.h" // lyx::count #include "support/lyxlib.h" // float_equal #include "support/path.h" +#include "support/tostr.h" #include "support/systemcall.h" #include "support/os.h" @@ -120,12 +121,7 @@ string const RemoveExtension(string const & filename) string const uniqueID() { static unsigned int seed = 1000; - - ostringstream ost; - ost << "graph" << ++seed; - - // Needed if we use lyxstring. - return STRCONV(ost.str()); + return "graph" + tostr(++seed); } @@ -891,7 +887,7 @@ void InsetGraphicsMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -917,6 +913,5 @@ InsetGraphicsMailer::params2string(InsetGraphicsParams const & params) data << name_ << ' '; params.Write(data); data << "\\end_inset\n"; - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index acb43ab167..58c806bce1 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -18,6 +18,7 @@ #include "funcrequest.h" #include "gettext.h" #include "LaTeXFeatures.h" +#include "Lsstream.h" #include "lyxlex.h" #include "lyxrc.h" #include "Lsstream.h" @@ -39,7 +40,6 @@ #include - using std::ostream; using std::endl; using std::vector; @@ -82,12 +82,7 @@ namespace { string const uniqueID() { static unsigned int seed = 1000; - - ostringstream ost; - ost << "file" << ++seed; - - // Needed if we use lyxstring. - return STRCONV(ost.str()); + return "file" + tostr(++seed); } } // namespace anon @@ -646,7 +641,7 @@ void InsetIncludeMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -683,6 +678,5 @@ InsetIncludeMailer::params2string(InsetInclude::Params const & params) data << name_ << ' '; inset.write(0, data); data << "\\end_inset\n"; - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index 540ff456b8..8d31230ea2 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -378,7 +378,7 @@ void InsetMinipageMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -410,6 +410,5 @@ InsetMinipageMailer::params2string(InsetMinipage::Params const & params) ostringstream data; data << name_ << ' '; params.write(data); - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insetparent.C b/src/insets/insetparent.C index 8c676ebee6..556fdca8dc 100644 --- a/src/insets/insetparent.C +++ b/src/insets/insetparent.C @@ -40,7 +40,8 @@ InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool) string const InsetParent::getScreenLabel(Buffer const *) const { #if USE_BOOST_FORMAT - return boost::io::str(boost::format(_("Parent: %s")) % getContents()); + return STRCONV(boost::io::str(boost::format(_("Parent: %s")) + % STRCONV(getContents()))); #else return _("Parent: ") + getContents(); #endif diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index f78d4becc8..937841fb64 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -2868,7 +2868,7 @@ string const InsetTabularMailer::inset2string() const int InsetTabularMailer::string2params(string const & in, InsetTabular & inset) { - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -2916,8 +2916,7 @@ int InsetTabularMailer::string2params(string const & in, InsetTabular & inset) } -string const -InsetTabularMailer::params2string(InsetTabular const & inset) +string const InsetTabularMailer::params2string(InsetTabular const & inset) { BufferView * const bv = inset.view(); Buffer const * const buffer = bv ? bv->buffer() : 0; @@ -2928,6 +2927,5 @@ InsetTabularMailer::params2string(InsetTabular const & inset) data << name_ << " \\active_cell " << inset.getActCell() << '\n'; inset.write(buffer, data); data << "\\end_inset\n"; - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 5752747bfb..90a2b6f26d 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1405,7 +1405,7 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & ev) cur_value = pit->params().spacing().getValue(); } - istringstream istr(ev.argument.c_str()); + istringstream istr(STRCONV(ev.argument)); string tmp; istr >> tmp; Spacing::Space new_spacing = cur_spacing; diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index d7af96cc2c..62be16ee36 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -20,6 +20,7 @@ #include "FloatList.h" #include "gettext.h" #include "LaTeXFeatures.h" +#include "Lsstream.h" #include "lyxfont.h" #include "lyxlex.h" #include "lyxtext.h" @@ -34,11 +35,13 @@ using std::ostream; using std::endl; + namespace { // this should not be hardcoded, but be part of the definition // of the float (JMarc) string const caplayout("Caption"); + string floatname(string const & type, BufferParams const & bp) { FloatList const & floats = bp.getLyXTextClass().floats(); @@ -305,7 +308,7 @@ void InsetWrapMailer::string2params(string const & in, if (in.empty()) return; - istringstream data(in); + istringstream data(STRCONV(in)); LyXLex lex(0,0); lex.setStream(data); @@ -331,12 +334,10 @@ void InsetWrapMailer::string2params(string const & in, } -string const -InsetWrapMailer::params2string(InsetWrapParams const & params) +string const InsetWrapMailer::params2string(InsetWrapParams const & params) { ostringstream data; data << name_ << ' '; params.write(data); - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/mathed/command_inset.C b/src/mathed/command_inset.C index 34956bcdff..7c75d36887 100644 --- a/src/mathed/command_inset.C +++ b/src/mathed/command_inset.C @@ -51,8 +51,7 @@ string const CommandInset::createDialogStr(string const & name) const WriteStream wsdata(data); write(wsdata); wsdata << "\n\\end_inset\n\n"; - - return data.str(); + return STRCONV(data.str()); } diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 61729990cb..65894947cf 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -34,7 +34,7 @@ public: data << name() << " active_cell " << 0 << '\n'; WriteStream ws(data); inset_.write(ws); - return data.str(); + return STRCONV(data.str()); } protected: @@ -1075,7 +1075,7 @@ dispatch_result MathGridInset::dispatch case LFUN_TABULAR_FEATURE: { //lyxerr << "handling tabular-feature " << cmd.argument << "\n"; - istringstream is(cmd.argument); + istringstream is(STRCONV(cmd.argument)); string s; is >> s; if (s == "valign-top") diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 51fb4f9558..8d02368048 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -65,7 +65,6 @@ following hack as starting point to write some macros: #include "Lsstream.h" #include "debug.h" #include "support/LAssert.h" -#include "support/lstrings.h" #include #include diff --git a/src/support/ChangeLog b/src/support/ChangeLog index ff85dcc4da..374721b8a3 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -5,6 +5,8 @@ 2003-05-12 André Pönitz * lstrings.[Ch]: bformat() as wrapper around boost::format + + * lyxstring.h: enable templatized constructor 2003-05-06 Lars Gullik Bjønnes diff --git a/src/support/lstrings.C b/src/support/lstrings.C index 06853b21d4..979381cd8f 100644 --- a/src/support/lstrings.C +++ b/src/support/lstrings.C @@ -14,6 +14,7 @@ #include "LString.h" #include "lstrings.h" #include "LAssert.h" +#include "Lsstream.h" #include "debug.h" #include "BoostFormat.h" @@ -481,7 +482,7 @@ string const subst(string const & a, string const subst(string const & a, string const & oldstr, string const & newstr) { - string lstr(a); + string lstr = a; string::size_type i = 0; string::size_type const olen = oldstr.length(); while ((i = lstr.find(oldstr, i)) != string::npos) { @@ -581,7 +582,7 @@ string const rsplit(string const & a, string & piece, char delim) if (i != string::npos) { // delimiter was found piece = a.substr(0, i); tmp = a.substr(i + 1); - } else { // delimter was not found + } else { // delimiter was not found piece.erase(); } return tmp; diff --git a/src/support/lyxstring.h b/src/support/lyxstring.h index 8f7a49a0c9..508a066143 100644 --- a/src/support/lyxstring.h +++ b/src/support/lyxstring.h @@ -161,7 +161,7 @@ public: /// lyxstring(5, 'n') -> "nnnnn" lyxstring(size_type n, value_type c); -#if 1 +#if 0 /// lyxstring(const_iterator first, const_iterator last); #else @@ -169,7 +169,7 @@ public: template lyxstring::lyxstring(InputIterator begin, InputIterator end) { while (begin != end) { - push_back((*begin)); + push_back(*begin); ++begin; } } diff --git a/src/tex2lyx/math.C b/src/tex2lyx/math.C index dca219677d..b6ca810709 100644 --- a/src/tex2lyx/math.C +++ b/src/tex2lyx/math.C @@ -10,13 +10,11 @@ #include "tex2lyx.h" #include -#include #include using std::cerr; using std::endl; using std::ostream; -using std::string; using std::vector; diff --git a/src/tex2lyx/preamble.C b/src/tex2lyx/preamble.C index 4447fa83b8..bfe182edcd 100644 --- a/src/tex2lyx/preamble.C +++ b/src/tex2lyx/preamble.C @@ -21,7 +21,6 @@ using std::istream; using std::istringstream; using std::ostream; using std::ostringstream; -using std::string; using std::vector; diff --git a/src/tex2lyx/table.C b/src/tex2lyx/table.C index fc9c63dcf1..220724e2c8 100644 --- a/src/tex2lyx/table.C +++ b/src/tex2lyx/table.C @@ -12,7 +12,6 @@ #include #include #include -#include #include using std::cerr; @@ -20,7 +19,6 @@ using std::endl; using std::istringstream; using std::ostream; using std::ostringstream; -using std::string; using std::vector; #include "mathed/math_gridinfo.h" @@ -29,7 +27,7 @@ namespace { int string2int(string const & s, int deflt = 0) { - istringstream is(s); + istringstream is(STRCONV(s)); int i = deflt; is >> i; return i; @@ -53,7 +51,7 @@ string read_hlines(Parser & p) }; //cerr << "read_hlines(), read: '" << os.str() << "'\n"; //cerr << "read_hlines(), next token: " << p.next_token() << "\n"; - return os.str(); + return STRCONV(os.str()); } @@ -285,7 +283,7 @@ void handle_tabular(Parser & p, ostream & os) ostringstream ss; ss << read_hlines(p) << HLINE; // handle initial hlines parse_table(p, ss, FLAG_END); - split(ss.str(), lines, LINE); + split(STRCONV(ss.str()), lines, LINE); vector< vector > cellinfo(lines.size()); vector rowinfo(lines.size()); diff --git a/src/tex2lyx/tex2lyx.C b/src/tex2lyx/tex2lyx.C index 7b2e7b2a84..c07b44e29e 100644 --- a/src/tex2lyx/tex2lyx.C +++ b/src/tex2lyx/tex2lyx.C @@ -25,11 +25,9 @@ using std::istringstream; using std::ostream; using std::ostringstream; using std::stringstream; -using std::string; using std::vector; - void handle_comment(Parser & p) { string s; @@ -65,7 +63,7 @@ string const trim(string const & a, char const * p) void split(string const & s, vector & result, char delim) { //cerr << "split 1: '" << s << "'\n"; - istringstream is(s); + istringstream is(STRCONV(s)); string t; while (getline(is, t, delim)) result.push_back(t); @@ -81,7 +79,7 @@ string join(vector const & input, char const * delim) os << delim; os << input[i]; } - return os.str(); + return STRCONV(os.str()); } diff --git a/src/tex2lyx/texparser.C b/src/tex2lyx/texparser.C index 44007dba00..d626ebefb4 100644 --- a/src/tex2lyx/texparser.C +++ b/src/tex2lyx/texparser.C @@ -13,7 +13,6 @@ using std::ios; using std::istream; using std::istringstream; using std::ostream; -using std::string; using std::vector; @@ -127,7 +126,7 @@ Parser::Parser(istream & is) Parser::Parser(string const & s) : lineno_(0), pos_(0) { - istringstream is(s); + istringstream is(STRCONV(s)); tokenize(is); } diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index ec10d5cd97..9becc23b55 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -11,7 +11,6 @@ #include #include -#include #include using std::cerr; @@ -19,7 +18,6 @@ using std::endl; using std::map; using std::ostream; using std::ostringstream; -using std::string; using std::vector; @@ -599,7 +597,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer) ss << "\\fancyhead"; ss << p.getOpt(); ss << '{' << p.verbatim_item() << "}\n"; - handle_ert(os, ss.str()); + handle_ert(os, STRCONV(ss.str())); } else { @@ -631,7 +629,7 @@ string parse_text(Parser & p, unsigned flags, const bool outer) { ostringstream os; parse_text(p, os, flags, outer); - return os.str(); + return STRCONV(os.str()); } diff --git a/src/text3.C b/src/text3.C index b516764f3d..a3657a9067 100644 --- a/src/text3.C +++ b/src/text3.C @@ -16,6 +16,7 @@ #include "BufferView.h" #include "funcrequest.h" #include "lyxrc.h" +#include "Lsstream.h" #include "debug.h" #include "bufferparams.h" #include "buffer.h" @@ -877,7 +878,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd) if (cur_spacing == Spacing::Other) cur_value = pit->params().spacing().getValue(); - istringstream is(cmd.argument.c_str()); + istringstream is(STRCONV(cmd.argument)); string tmp; is >> tmp; Spacing::Space new_spacing = cur_spacing; @@ -1062,7 +1063,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd) case LFUN_SETXY: { int x = 0; int y = 0; - istringstream is(cmd.argument.c_str()); + istringstream is(STRCONV(cmd.argument)); is >> x >> y; if (!is) lyxerr << "SETXY: Could not parse coordinates in '" -- 2.39.5