using std::stack;
using std::list;
+using lyx::pos_type;
+
// all these externs should eventually be removed.
extern BufferList bufferlist;
+ textclasslist.NameOfLayout(params.textclass, par->layout);
InsetError * new_inset = new InsetError(s);
par->insertInset(0, new_inset);
+ par->setFont(0, LyXFont(LyXFont::ALL_INHERIT,
+ params.language));
}
// Test whether the layout is obsolete.
LyXLayout const & layout =
par->getLayout());
// Insets don't make sense in a free-spacing context! ---Kayvan
- if (layout.free_spacing) {
+ if (layout.free_spacing || par->isFreeSpacing()) {
if (lex.isOK()) {
lex.next();
string next_token = lex.getString();
textclasslist.Style(params.textclass,
par->getLayout());
- if (layout.free_spacing) {
+ if (layout.free_spacing || par->isFreeSpacing()) {
par->insertChar(pos, ' ', font);
} else {
Inset * inset = new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
InsetError * new_inset = new InsetError(s);
par->insertInset(pos, new_inset);
+ par->setFont(pos, LyXFont(LyXFont::ALL_INHERIT,
+ params.language));
#ifndef NO_COMPABILITY
}
}
// needed to insert the selection
-void Buffer::insertStringAsLines(Paragraph *& par, Paragraph::pos_type & pos,
+void Buffer::insertStringAsLines(Paragraph *& par, pos_type & pos,
LyXFont const & fn,string const & str) const
{
LyXLayout const & layout = textclasslist.Style(params.textclass,
}
// do not insert consecutive spaces if !free_spacing
} else if ((*cit == ' ' || *cit == '\t') &&
- space_inserted && !layout.free_spacing)
+ space_inserted && !layout.free_spacing &&
+ !par->isFreeSpacing())
{
continue;
} else if (*cit == '\t') {
- if (!layout.free_spacing) {
+ if (!layout.free_spacing && !par->isFreeSpacing()) {
// tabs are like spaces here
par->insertChar(pos, ' ', font);
++pos;
space_inserted = true;
} else {
- const Paragraph::pos_type nb = 8 - pos % 8;
- for (Paragraph::pos_type a = 0;
- a < nb ; ++a) {
+ const pos_type nb = 8 - pos % 8;
+ for (pos_type a = 0; a < nb ; ++a) {
par->insertChar(pos, ' ', font);
++pos;
}
lyxerr << "Should this ever happen?" << endl;
}
- for (Paragraph::pos_type i = 0; i < par->size(); ++i) {
+ for (pos_type i = 0; i < par->size(); ++i) {
if (!i && !noparbreak) {
if (linelen > 0)
buffer << "\n\n";
stack<PAR_TAG> tag_state;
// parsing main loop
- for (Paragraph::pos_type i = 0; i < par->size(); ++i) {
+ for (pos_type i = 0; i < par->size(); ++i) {
PAR_TAG tag_close = NONE;
list < PAR_TAG > tag_open;
} else {
string sgml_string;
if (par->sgmlConvertChar(c, sgml_string)
- && !style.free_spacing) {
+ && !style.free_spacing && !par->isFreeSpacing())
+ {
// in freespacing mode, spaces are
// non-breaking characters
if (desc_on) {// if char is ' ' then...
// insert an error marker in text
InsetError * new_inset = new InsetError(message);
par->insertInset(pos, new_inset);
+ par->setFont(pos, LyXFont(LyXFont::ALL_INHERIT, params.language));
}
// os << string(depth,' ');
// parsing main loop
- for (Paragraph::pos_type i = 0;
- i < par->size(); ++i) {
+ for (pos_type i = 0; i < par->size(); ++i) {
LyXFont font = par->getFont(params, i);
// handle <emphasis> tag
if (style.pass_thru) {
os << c;
- } else if(style.free_spacing || c != ' ') {
+ } else if(style.free_spacing || par->isFreeSpacing() || c != ' ') {
os << sgml_string;
} else if (desc_on ==1) {
++char_line_count;
}
-Buffer::inset_iterator::inset_iterator(Paragraph * paragraph,
- Paragraph::pos_type pos)
+Buffer::inset_iterator::inset_iterator(Paragraph * paragraph, pos_type pos)
: par(paragraph)
{
it = par->InsetIterator(pos);