namespace lyx {
namespace {
+
/// Inset identifier (above 0x10ffff, for ucs-4)
char_type const META_INSET = 0x200001;
+
}
class SpellCheckerState {
public:
- SpellCheckerState() {
+ SpellCheckerState()
+ {
needs_refresh_ = true;
current_change_number_ = 0;
}
return empty_;
}
- bool needsRefresh() const {
+ bool needsRefresh() const
+ {
return needs_refresh_;
}
- SpellChecker::ChangeNumber currentChangeNumber() const {
+ SpellChecker::ChangeNumber currentChangeNumber() const
+ {
return current_change_number_;
}
- void refreshRange(pos_type & first, pos_type & last) const {
+ void refreshRange(pos_type & first, pos_type & last) const
+ {
first = refresh_.first;
last = refresh_.last;
}
- void needsRefresh(pos_type pos) {
+ void needsRefresh(pos_type pos)
+ {
if (needs_refresh_ && pos != -1) {
if (pos < refresh_.first)
refresh_.first = pos;
needs_refresh_ = pos != -1;
}
- void needsCompleteRefresh(SpellChecker::ChangeNumber change_number) {
+ void needsCompleteRefresh(SpellChecker::ChangeNumber change_number)
+ {
needs_refresh_ = true;
refresh_.first = 0;
refresh_.last = -1;
current_change_number_ = change_number;
}
-
private:
typedef vector<SpellResultRange> Ranges;
typedef Ranges::const_iterator RangesIterator;
Language * getSpellLanguage(pos_type const from) const;
Language * locateSpellRange(pos_type & from, pos_type & to,
- SkipPositions & skips) const;
+ SkipPositions & skips) const;
- bool hasSpellerChange() const {
+ bool hasSpellerChange() const
+ {
SpellChecker::ChangeNumber speller_change_number = 0;
if (theSpellChecker())
speller_change_number = theSpellChecker()->changeNumber();
speller_state_.setRange(fp, state);
}
- void requestSpellCheck(pos_type pos) {
+ void requestSpellCheck(pos_type pos)
+ {
if (pos == -1)
speller_state_.needsCompleteRefresh(speller_state_.currentChangeNumber());
else
speller_state_.needsRefresh(pos);
}
- void readySpellCheck() {
+ void readySpellCheck()
+ {
speller_state_.needsRefresh(-1);
}
// we have to provide all the optional arguments here, even though
// the last one is the only one we care about.
// Separate handling of optional argument inset.
- if (layout_->optargs != 0 || layout_->reqargs != 0)
- latexArgInsets(*owner_, os, features.runparams(),
- layout_->reqargs, layout_->optargs);
- else
- os << from_ascii(layout_->latexparam());
+ if (!layout_->latexargs().empty()) {
+ OutputParams rp = features.runparams();
+ rp.local_font = &owner_->getFirstFontSettings(bp);
+ latexArgInsets(*owner_, os, rp, layout_->latexargs());
+ }
+ os << from_ascii(layout_->latexparam());
}
docstring::size_type const length = ods.str().length();
// this will output "{" at the beginning, but not at the end
owner_->latex(bp, f, os, features.runparams(), 0, -1, true);
if (ods.str().length() > length) {
- if (is_command)
+ if (is_command) {
ods << '}';
+ if (!layout_->postcommandargs().empty()) {
+ OutputParams rp = features.runparams();
+ rp.local_font = &owner_->getFirstFontSettings(bp);
+ latexArgInsets(*owner_, os, rp, layout_->postcommandargs(), "post:");
+ }
+ }
string const snippet = to_utf8(ods.str());
features.addPreambleSnippet(snippet);
}
bool Paragraph::isPassThru() const
{
- return inInset().getLayout().isPassThru() || d->layout_->pass_thru;
+ return inInset().isPassThru() || d->layout_->pass_thru;
}
namespace {
os << '{';
++column;
}
+ if (!style.leftdelim().empty()) {
+ os << style.leftdelim();
+ column += style.leftdelim().size();
+ }
if (allowcust)
column += d->startTeXParParams(bparams, os, runparams);
}
++column;
}
+ if (!style.leftdelim().empty()) {
+ os << style.leftdelim();
+ column += style.leftdelim().size();
+ }
+
if (allowcust)
column += d->startTeXParParams(bparams, os,
runparams);
os << "}]~";
}
+ if (!style.rightdelim().empty()) {
+ os << style.rightdelim();
+ column += style.rightdelim().size();
+ }
+
if (allowcust && d->endTeXParParams(bparams, os, runparams)
&& runparams.encoding != prev_encoding) {
runparams.encoding = prev_encoding;
} else {
char_type c = getUChar(buf.params(), i);
- if (style.pass_thru)
+ if (style.pass_thru || runparams.pass_thru)
xs << c;
else if (c == '-') {
docstring str;