#include "frontends/Painter.h"
#include "support/debug.h"
+#include "support/gettext.h"
#include "support/lassert.h"
#include "support/textutils.h"
&& editing_[mi.base.bv]) {
// Macro will be edited in a old-style list mode here:
- LASSERT(macro_ != 0, /**/);
+ LBUFERR(macro_);
Dimension fontDim;
FontInfo labelFont = sane_font;
math_font_max_dim(labelFont, fontDim.asc, fontDim.des);
dim.wid += 2;
metricsMarkers2(dim);
} else {
- LASSERT(macro_ != 0, /**/);
+ LBUFERR(macro_);
// calculate metrics, hoping that all cells are seen
macro_->lock();
void MathMacro::removeArgument(Inset::pos_type pos) {
if (displayMode_ == DISPLAY_NORMAL) {
- LASSERT(size_t(pos) < cells_.size(), /**/);
+ LASSERT(size_t(pos) < cells_.size(), return);
cells_.erase(cells_.begin() + pos);
if (size_t(pos) < attachedArgsNum_)
--attachedArgsNum_;
void MathMacro::insertArgument(Inset::pos_type pos) {
if (displayMode_ == DISPLAY_NORMAL) {
- LASSERT(size_t(pos) <= cells_.size(), /**/);
+ LASSERT(size_t(pos) <= cells_.size(), return);
cells_.insert(cells_.begin() + pos, MathData());
if (size_t(pos) < attachedArgsNum_)
++attachedArgsNum_;
void MathMacro::detachArguments(vector<MathData> & args, bool strip)
{
- LASSERT(displayMode_ == DISPLAY_NORMAL, /**/);
+ LASSERT(displayMode_ == DISPLAY_NORMAL, return);
args = cells_;
// strip off empty cells, but not more than arity-attachedArgsNum_
void MathMacro::attachArguments(vector<MathData> const & args, size_t arity, int optionals)
{
- LASSERT(displayMode_ == DISPLAY_NORMAL, /**/);
+ LASSERT(displayMode_ == DISPLAY_NORMAL, return);
cells_ = args;
attachedArgsNum_ = args.size();
cells_.resize(arity);
// The macro name was changed
Cursor inset_cursor = old;
int macroSlice = inset_cursor.find(this);
- LASSERT(macroSlice != -1, /**/);
+ // returning true means the cursor is "now" invalid,
+ // which it was.
+ LASSERT(macroSlice != -1, return true);
inset_cursor.cutOff(macroSlice);
inset_cursor.recordUndoInset();
inset_cursor.pop();
}
// normal mode
- LASSERT(macro_, /**/);
+ // we should be ok to continue even if this fails.
+ LATTEST(macro_);
// optional arguments make macros fragile
if (optionals_ > 0 && os.fragile())
for (; i < cells_.size(); ++i) {
if (cell(i).size() == 1
&& cell(i)[0].nucleus()->asCharInset()
- && cell(i)[0].nucleus()->asCharInset()->getChar() < 0x80) {
+ && isASCII(cell(i)[0].nucleus()->asCharInset()->getChar())) {
if (first)
os << " ";
os << cell(i);