#include "gettext.h"
#include "Intl.h"
#include "Language.h"
+#include "Layout.h"
#include "LyXAction.h"
#include "LyXFunc.h"
#include "Lexer.h"
using support::isStrUnsignedInt;
using support::token;
-namespace frontend {
-extern docstring current_layout;
-}
-
// globals...
static Font freefont(Font::ALL_IGNORE);
static bool toggleall = false;
docstring layout = cmd.argument();
LYXERR(Debug::INFO) << "LFUN_LAYOUT: (arg) " << to_utf8(layout) << endl;
+ docstring const old_layout = cur.paragraph().layout()->name();
+
// Derive layout number from given argument (string)
// and current buffer's textclass (number)
TextClass const & tclass = bv->buffer().params().getTextClass();
break;
}
- bool change_layout = (frontend::current_layout != layout);
+ bool change_layout = (old_layout != layout);
if (!change_layout && cur.selection() &&
cur.selBegin().pit() != cur.selEnd().pit())
pit_type spit = cur.selBegin().pit();
pit_type epit = cur.selEnd().pit() + 1;
while (spit != epit) {
- if (pars_[spit].layout()->name() != frontend::current_layout) {
+ if (pars_[spit].layout()->name() != old_layout) {
change_layout = true;
break;
}
}
}
- if (change_layout) {
+ if (change_layout)
setLayout(cur, layout);
- // inform the GUI that the layout has changed.
- bv->layoutChanged(layout);
- }
+
break;
}