Change runningChange = Change(Change::UNCHANGED);
+ Encoding const * const prev_encoding = runparams.encoding;
+
texrow.start(id(), 0);
// if the paragraph is empty, the loop will not be entered at all
running_font = font;
open_font = true;
docstring fontchange = ods.str();
+ // check whether the fontchange ends with a \\textcolor
+ // modifier and the text starts with a space (bug 4473)
+ docstring const last_modifier = rsplit(fontchange, '\\');
+ 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
return_value = false;
}
- if (allowcust) {
- column += d->endTeXParParams(bparams, os, texrow,
- runparams);
- }
+ if (allowcust && d->endTeXParParams(bparams, os, texrow,runparams))
+ runparams.encoding = prev_encoding;
LYXERR(Debug::LATEX, "Paragraph::latex... done " << this);
return return_value;
if (isPrintable(c) || c == '\t'
|| (c == '\n' && options & AS_STR_NEWLINES))
os.put(c);
- else if (c == META_INSET && options & AS_STR_INSETS)
+ else if (c == META_INSET && options & AS_STR_INSETS) {
getInset(i)->tocString(os);
+ if (getInset(i)->asInsetMath())
+ os << " ";
+ }
}
return os.str();
bool Paragraph::spellCheck(pos_type & from, pos_type & to, WordLangTuple & wl,
- docstring_list & suggestions) const
+ docstring_list & suggestions, bool do_suggestion) const
{
SpellChecker * speller = theSpellChecker();
if (!speller)
if (lyxrc.spellcheck_continuously)
d->fontlist_.setMisspelled(from, to, misspelled);
- if (misspelled) {
- while (!(word = speller->nextMiss()).empty())
- suggestions.push_back(word);
- }
+ if (misspelled && do_suggestion)
+ speller->suggest(wl, suggestions);
+ else
+ suggestions.clear();
+
return misspelled;
}
pos_type to = pos;
WordLangTuple wl;
docstring_list suggestions;
- return spellCheck(from, to, wl, suggestions);
+ return spellCheck(from, to, wl, suggestions, false);
}