mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 01:08:45 +00:00
branch: Fix bug #4473: Incorrect LaTeX output for inter-word spaces.
This is a hack necessary because \\textcolor is a bit buggy. see r30773. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@30774 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
64a7513231
commit
ea16d18b54
@ -2092,9 +2092,14 @@ bool Paragraph::latex(BufferParams const & bparams,
|
||||
running_font = font;
|
||||
open_font = true;
|
||||
docstring fontchange = ods.str();
|
||||
docstring const last_modifier = rsplit(fontchange, '\\');
|
||||
// check whether the fontchange ends with a \\textcolor
|
||||
// modifier and the text starts with a space (bug 4473)
|
||||
if (prefixIs(last_modifier, from_ascii("textcolor")) && c == ' ')
|
||||
os << fontchange << from_ascii("{}");
|
||||
// check if the fontchange ends with a trailing blank
|
||||
// (like "\small " (see bug 3382)
|
||||
if (suffixIs(fontchange, ' ') && c == ' ')
|
||||
else if (suffixIs(fontchange, ' ') && c == ' ')
|
||||
os << fontchange.substr(0, fontchange.size() - 1)
|
||||
<< from_ascii("{}");
|
||||
else
|
||||
|
@ -899,6 +899,16 @@ string const rsplit(string const & a, string & piece, char delim)
|
||||
}
|
||||
|
||||
|
||||
docstring const rsplit(docstring const & a, char_type delim)
|
||||
{
|
||||
docstring tmp;
|
||||
size_t i = a.rfind(delim);
|
||||
if (i != string::npos)
|
||||
tmp = a.substr(i + 1);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
docstring const escape(docstring const & lab)
|
||||
{
|
||||
char_type hexdigit[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
|
||||
|
@ -221,6 +221,7 @@ std::string const split(std::string const & a, char delim);
|
||||
|
||||
/// Same as split but uses the last delim.
|
||||
std::string const rsplit(std::string const & a, std::string & piece, char delim);
|
||||
docstring const rsplit(docstring const & a, char_type delim);
|
||||
|
||||
/// Escapes non ASCII chars and other problematic characters that cause
|
||||
/// problems in latex labels.
|
||||
|
@ -125,6 +125,9 @@ What's new
|
||||
|
||||
* DOCUMENT INPUT/OUTPUT
|
||||
|
||||
- Fix the output of spaces that are at the beginning of a block with
|
||||
a new textcolor (bug 4473).
|
||||
|
||||
- Fix conversion documents from LyX 1.4 which have multicolumn cells in
|
||||
tabulars with expert border settings (bug 6018).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user