fix bug 2687

* src/lyxfunc.C
	(quoteArg): new, quotes arguments for the "log" dialog
	(LyXFunc::dispatch): quote log filename

	* src/frontends/controllers/ControlLog.C
	(ControlLog::initialiseParams): parse \" as " and \\ as \ in filename


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14481 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-07-17 20:06:58 +00:00
parent 2ae2c0db71
commit 766709e999
2 changed files with 16 additions and 3 deletions

View File

@ -39,7 +39,11 @@ bool ControlLog::initialiseParams(string const & data)
lex.setStream(is);
string logtype, logfile;
lex >> logtype >> logfile;
lex >> logtype;
if (lex.isOK()) {
lex.next(true);
logfile = lex.getString();
}
if (!lex)
// Parsing of the data failed.
return false;

View File

@ -199,6 +199,15 @@ Change::Type lookupChangeType(DocIterator const & dit, bool outer = false)
return Change::UNCHANGED;
}
/// quotes a string for use as an argument of the "log" dialog
string const quoteArg(string const & arg)
{
ostringstream os;
os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
return os.str();
}
}
LyXFunc::LyXFunc(LyXView * lv)
@ -1175,11 +1184,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
data = "literate ";
break;
}
data += logfile.second;
data += quoteArg(logfile.second);
owner->getDialogs().show("log", data);
} else if (name == "vclog") {
string const data = "vc " +
owner->buffer()->lyxvc().getLogFile();
quoteArg(owner->buffer()->lyxvc().getLogFile());
owner->getDialogs().show("log", data);
} else
owner->getDialogs().show(name, data);