while (par && par_depth && !tmpfont.resolved()) {
par = par->outerHook();
if (par) {
+#ifndef INHERIT_LANGUAGE
+ tmpfont.realize(textclasslist.
+ Style(buf->params.textclass,
+ par->getLayout()).font);
+#else
tmpfont.realize(textclasslist.
Style(buf->params.textclass,
par->getLayout()).font,
- buf->params.language);
+ buf->params.language);
+#endif
par_depth = par->getDepth();
}
}
+#ifndef INHERIT_LANGUAGE
+ tmpfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont());
+#else
tmpfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont(),
buf->params.language);
+#endif
return tmpfont;
}
// 1% goes here
LyXFont f = par->getFontSettings(buf->params,
pos);
+#ifndef INHERIT_LANGUAGE
+ return f.realize(layout.reslabelfont);
+#else
return f.realize(layout.reslabelfont, buf->params.language);
+#endif
} else {
LyXFont f = par->getFontSettings(buf->params, pos);
+#ifndef INHERIT_LANGUAGE
+ return f.realize(layout.resfont);
+#else
return f.realize(layout.resfont, buf->params.language);
+#endif
}
}
}
LyXFont tmpfont = par->getFontSettings(buf->params, pos);
+#ifndef INHERIT_LANGUAGE
+ tmpfont.realize(layoutfont);
+#else
tmpfont.realize(layoutfont, buf->params.language);
+#endif
return realizeFont(tmpfont, buf, par);
}
{
Buffer const * buf = bv->buffer();
LyXFont font = getFont(buf, par, pos);
- font.update(fnt, toggleall);
+ font.update(fnt, buf->params.language, toggleall);
// Let the insets convert their font
if (par->getChar(pos) == Paragraph::META_INSET) {
Inset * inset = par->getInset(pos);
while (!layoutfont.resolved() && tp && tp->getDepth()) {
tp = tp->outerHook();
if (tp)
+#ifndef INHERIT_LANGUAGE
+ layoutfont.realize(textclasslist.
+ Style(buf->params.textclass,
+ tp->getLayout()).font);
+#else
layoutfont.realize(textclasslist.
Style(buf->params.textclass,
tp->getLayout()).font,
buf->params.language);
+#endif
}
}
+#ifndef INHERIT_LANGUAGE
+ layoutfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont());
+#else
layoutfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont(),
buf->params.language);
+#endif
// Now, reduce font against full layout font
font.reduce(layoutfont);
while (!layoutfont.resolved() && tp && tp->getDepth()) {
tp = tp->outerHook();
if (tp)
+#ifndef INHERIT_LANGUAGE
+ layoutfont.realize(textclasslist.
+ Style(buf->params.textclass,
+ tp->getLayout()).font);
+#else
layoutfont.realize(textclasslist.
Style(buf->params.textclass,
tp->getLayout()).font,
buf->params.language);
+#endif
}
}
+#ifndef INHERIT_LANGUAGE
+ layoutfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont());
+#else
layoutfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont(),
buf->params.language);
+#endif
// Now, reduce font against full layout font
font.reduce(layoutfont);
cursor.par());
}
// Update current font
- real_current_font.update(font, toggleall);
+ real_current_font.update(font,
+ bview->buffer()->params.language,
+ toggleall);
// Reduce to implicit settings
current_font = real_current_font;
current_font.reduce(layoutfont);
// And resolve it completely
+#ifndef INHERIT_LANGUAGE
+ real_current_font.realize(layoutfont);
+#else
real_current_font.realize(layoutfont,
bview->buffer()->params.language);
+#endif
return;
}
}
-void LyXText::cutSelection(BufferView * bview, bool doclear)
+void LyXText::cutSelection(BufferView * bview, bool doclear, bool realcut)
{
// Stuff what we got on the clipboard. Even if there is no selection.
endpar = selection.end.par();
int pos = selection.end.pos();
CutAndPaste::cutSelection(selection.start.par(), &endpar,
- selection.start.pos(), pos,
- bview->buffer()->params.textclass, doclear);
+ selection.start.pos(), pos,
+ bview->buffer()->params.textclass, doclear,
+ realcut);
selection.end.pos(pos);
} else {
endpar = selection.end.par();
int pos = selection.end.pos();
CutAndPaste::cutSelection(selection.start.par(), &endpar,
- selection.start.pos(), pos,
- bview->buffer()->params.textclass, doclear);
+ selection.start.pos(), pos,
+ bview->buffer()->params.textclass, doclear,
+ realcut);
cursor.par(endpar);
selection.end.par(endpar);
selection.end.pos(pos);
}
// Cut the selection
- cutSelection(bview);
+ cutSelection(bview, true, false);
unFreezeUndo();
}
void LyXText::setCursor(BufferView * bview, Paragraph * par,
- Paragraph::size_type pos,
- bool setfont, bool boundary) const
+ Paragraph::size_type pos,
+ bool setfont, bool boundary) const
{
LyXCursor old_cursor = cursor;
setCursorIntern(bview, par, pos, setfont, boundary);
bool setfont, bool boundary) const
{
InsetText * it = static_cast<InsetText *>(par->inInset());
- if (it && (it != inset_owner)) {
- it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
- boundary);
- } else {
- setCursor(bview, cursor, par, pos, boundary);
- if (setfont)
- setCurrentFont(bview);
+ if (it) {
+ if (it != inset_owner) {
+ lyxerr << "InsetText is " << it << endl;
+ lyxerr << "inset_owner is " << inset_owner << endl;
+#warning I belive this code is wrong. (Lgb)
+#warning Jürgen, have a look at this. (Lgb)
+#warning Hmmm, I guess you are right but we
+#warning should verify when this is needed
+ // Jürgen, would you like to have a look?
+ // I guess we need to move the outer cursor
+ // and open and lock the inset (bla bla bla)
+ // stuff I don't know... so can you have a look?
+ // (Lgb)
+ // I moved the lyxerr stuff in here so we can see if this
+ // is actually really needed and where!
+ // (Jug)
+ it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
+ boundary);
+ return;
+ }
}
+
+ setCursor(bview, cursor, par, pos, boundary);
+ if (setfont)
+ setCurrentFont(bview);
}
void LyXText::status(BufferView * bview, LyXText::text_status st) const
{
-#if 0
- if ((status_ != NEED_MORE_REFRESH)
- || (status_ == NEED_MORE_REFRESH)
- && (st != NEED_VERY_LITTLE_REFRESH)) {
- status_ = st;
- if (inset_owner && st != UNCHANGED) {
- bview->text->status(bview, NEED_VERY_LITTLE_REFRESH);
- }
- }
-#else
-#warning Please tell what the intention is here. (Lgb)
- // The above does not make any sense, I changed it to what is here,
- // but it still does not make much sense. (Lgb)
-#warning Sure have a look now! (Jug)
// well as much as I know && binds more then || so the above and the
// below are identical (this for your known use of parentesis!)
// Now some explanation:
}
}
}
-#endif
}