if (parent_.editing(mi.base.bv) && label_.length() > 0) {
// grey
FontInfo font = sane_font;
- font.setSize(FONT_SIZE_TINY);
+ font.setSize(TINY_SIZE);
font.setColor(Color_mathmacrolabel);
// make space for label and box
if (parent_.editing(pi.base.bv) && label_.length() > 0) {
// grey
FontInfo font = sane_font;
- font.setSize(FONT_SIZE_TINY);
+ font.setSize(TINY_SIZE);
font.setColor(Color_mathmacrolabel);
// make space for label and box
{
InsetLabelBox::metrics(mi, dim);
if (!parent_.editing(mi.base.bv)
- && parent_.cell(parent_.displayIdx()).empty()) {
- dim.wid = 0;
- dim.asc = 0;
- dim.des = 0;
- }
+ && parent_.cell(parent_.displayIdx()).empty())
+ dim.clear();
}
void InsetDisplayLabelBox::draw(PainterInfo & pi, int x, int y) const
{
if (parent_.editing(pi.base.bv)
- || !parent_.cell(parent_.displayIdx()).empty()) {
- InsetLabelBox::draw(pi, x, y);
- } else {
- bool enabled = pi.pain.isDrawingEnabled();
- pi.pain.setDrawingEnabled(false);
- InsetLabelBox::draw(pi, x, y);
- pi.pain.setDrawingEnabled(enabled);
- }
+ || !parent_.cell(parent_.displayIdx()).empty()
+ || pi.pain.isNull())
+ InsetLabelBox::draw(pi, x, y);
}
void InsetMathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const
{
Changer dummy1 = mi.base.changeFontSet("mathnormal");
- Changer dummy2 = mi.base.font.changeStyle(LM_ST_TEXT);
+ Changer dummy2 = mi.base.font.changeStyle(TEXT_STYLE);
// valid macro?
MacroData const * macro = 0;
// FIXME: Calling Changer on the same object repeatedly is inefficient.
Changer dummy0 = pi.base.font.changeColor(Color_math);
Changer dummy1 = pi.base.changeFontSet("mathnormal");
- Changer dummy2 = pi.base.font.changeStyle(LM_ST_TEXT);
+ Changer dummy2 = pi.base.font.changeStyle(TEXT_STYLE);
Dimension const dim = dimension(*pi.base.bv);
// \global\def\long\foo#1#2{#1,#2}
// We use the \long prefix as this is the equivalent to \newcommand.
// We cannot use \newcommand directly because \global does not work with it.
- os << "\\global\\long\\def\\" << name();
+ os << "\n\\global\\long\\def\\" << name();
docstring param = from_ascii("#0");
for (int i = 1; i <= numargs_; ++i) {
param[1] = '0' + i;
if (os.latex()) {
// writing .tex. done.
- os << "\n";
+ os << "%\n";
++num_lines;
} else {
// writing .lyx, write special .tex export only if necessary
return false;*/
// valid characters?
- for (size_t i = 0; i < n.size(); ++i) {
- if (!(n[i] >= 'a' && n[i] <= 'z')
- && !(n[i] >= 'A' && n[i] <= 'Z')
- && n[i] != '*')
- return false;
+ if (n.size() > 1) {
+ for (size_t i = 0; i < n.size(); ++i) {
+ if (!(n[i] >= 'a' && n[i] <= 'z')
+ && !(n[i] >= 'A' && n[i] <= 'Z')
+ && n[i] != '*')
+ return false;
+ }
}
return true;