minibuffer_char = ' ';
// This reflects what GetInset() does (ARRae)
}
minibuffer_char = ' ';
// This reflects what GetInset() does (ARRae)
}
-
- // Erase(pos); now the caller is responsible for that.
}
bool Paragraph::insertFromMinibuffer(pos_type pos)
{
if (minibuffer_char == Paragraph::META_INSET) {
}
bool Paragraph::insertFromMinibuffer(pos_type pos)
{
if (minibuffer_char == Paragraph::META_INSET) {
- if (!insetAllowed(minibuffer_inset->lyxCode())) {
+ if (!insetAllowed(minibuffer_inset->lyxCode()))
insertInset(pos, minibuffer_inset, minibuffer_font);
} else {
LyXFont f = minibuffer_font;
insertInset(pos, minibuffer_inset, minibuffer_font);
} else {
LyXFont f = minibuffer_font;
- if (!checkInsertChar(f)) {
+ if (!checkInsertChar(f))
insertChar(pos, minibuffer_char, f);
}
return true;
insertChar(pos, minibuffer_char, f);
}
return true;
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c)
{
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c)
{
- LyXFont const f(LyXFont::ALL_INHERIT);
- insertChar(pos, c, f);
+ insertChar(pos, c, LyXFont(LyXFont::ALL_INHERIT));
void Paragraph::insertInset(pos_type pos, InsetOld * inset)
{
void Paragraph::insertInset(pos_type pos, InsetOld * inset)
{
- LyXFont const f(LyXFont::ALL_INHERIT);
- insertInset(pos, inset, f);
+ insertInset(pos, inset, LyXFont(LyXFont::ALL_INHERIT));
Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
- for (; cit != end; ++cit) {
+ for (; cit != end; ++cit)
if (cit->pos() >= pos)
break;
if (cit->pos() >= pos)
break;
- retfont = cit->font();
- else if (pos == size() && !empty())
- retfont = getFontSettings(bparams, pos - 1);
- else
- retfont = LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
+ if (pos == size() && !empty())
+ return getFontSettings(bparams, pos - 1);
+
+ return LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
lyx::pos_type
Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
{
lyx::pos_type
Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
{
Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
- for (; cit != end; ++cit) {
+ for (; cit != end; ++cit)
if (cit->pos() >= pos)
return cit->pos();
if (cit->pos() >= pos)
return cit->pos();
// This should not happen, but if so, we take no chances.
// This should not happen, but if so, we take no chances.
+ lyxerr << "Pararaph::getEndPosOfFontSpan: This should not happen!\n";
LyXFont const Paragraph::getLabelFont(BufferParams const & bparams,
LyXFont const & outerfont) const
{
LyXFont const Paragraph::getLabelFont(BufferParams const & bparams,
LyXFont const & outerfont) const
{
- LyXLayout_ptr const & lout = layout();
-
- LyXFont tmpfont = lout->labelfont;
+ LyXFont tmpfont = layout()->labelfont;
tmpfont.setLanguage(getParLanguage(bparams));
tmpfont.realize(outerfont);
tmpfont.realize(bparams.getLyXTextClass().defaultfont());
tmpfont.setLanguage(getParLanguage(bparams));
tmpfont.realize(outerfont);
tmpfont.realize(bparams.getLyXTextClass().defaultfont());
LyXFont const Paragraph::getLayoutFont(BufferParams const & bparams,
LyXFont const & outerfont) const
{
LyXFont const Paragraph::getLayoutFont(BufferParams const & bparams,
LyXFont const & outerfont) const
{
- LyXLayout_ptr const & lout = layout();
-
- LyXFont tmpfont = lout->font;
+ LyXFont tmpfont = layout()->font;
tmpfont.setLanguage(getParLanguage(bparams));
tmpfont.realize(outerfont);
tmpfont.realize(bparams.getLyXTextClass().defaultfont());
tmpfont.setLanguage(getParLanguage(bparams));
tmpfont.realize(outerfont);
tmpfont.realize(bparams.getLyXTextClass().defaultfont());