mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
add missing implementation of three-arg overload of bformat
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6977 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c9095d82d5
commit
fae0ce3073
@ -1,4 +1,8 @@
|
||||
|
||||
2003-05-19 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* lstrings.C: add missing implementation of three-arg bformat
|
||||
|
||||
2003-05-15 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* lstrings.[Ch]: use string const & instead of char const * for format
|
||||
|
@ -665,9 +665,10 @@ string const getStringFromVector(vector<string> const & vec,
|
||||
for (vector<string>::const_iterator it = vec.begin();
|
||||
it != vec.end(); ++it) {
|
||||
string item = trim(*it);
|
||||
if (item.empty()) continue;
|
||||
|
||||
if (i++ > 0) str += delim;
|
||||
if (item.empty())
|
||||
continue;
|
||||
if (i++ > 0)
|
||||
str += delim;
|
||||
str += item;
|
||||
}
|
||||
return str;
|
||||
@ -687,6 +688,15 @@ string bformat(string const & fmt, string const & arg1, string const & arg2)
|
||||
return STRCONV((boost::format(fmt) % STRCONV(arg1) % STRCONV(arg2)).str());
|
||||
}
|
||||
|
||||
|
||||
string bformat(string const & fmt, string const & arg1, string const & arg2,
|
||||
string const & arg3)
|
||||
{
|
||||
return STRCONV((boost::format(fmt) % STRCONV(arg1) % STRCONV(arg2)
|
||||
% STRCONV(arg3)).str());
|
||||
}
|
||||
|
||||
|
||||
string bformat(string const & fmt, string const & arg1, string const & arg2,
|
||||
string const & arg3, string const & arg4)
|
||||
{
|
||||
@ -714,6 +724,19 @@ string bformat(string const & fmt, string const & arg1, string const & arg2)
|
||||
}
|
||||
|
||||
|
||||
string bformat(char const * fmt, string const & arg1, string const & arg2,
|
||||
string const & arg3)
|
||||
{
|
||||
lyx::Assert(contains(fmt, "%1$s"));
|
||||
lyx::Assert(contains(fmt, "%2$s"));
|
||||
lyx::Assert(contains(fmt, "%3$s"));
|
||||
string str = subst(fmt, "%1$s", arg1);
|
||||
str = subst(str, "%2$s", arg2);
|
||||
str = subst(str, "%3$s", arg3);
|
||||
return subst(str, "%%", "%");
|
||||
}
|
||||
|
||||
|
||||
string bformat(char const * fmt, string const & arg1, string const & arg2,
|
||||
string const & arg3, string const & arg4)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user