'hspace*{\n\\backslash\nfill}\n\\end_layout\n\n\\end_inset\n\n')
+def revert_leftarrowfill(document):
+ ' Revert \\begin_inset Space \\leftarrowfill{} to ERT '
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_inset Space \\leftarrowfill{}', i)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i)
+ if j == -1:
+ document.warning("Malformed LyX document: Could not find end of space inset.")
+ continue
+ del document.body[j]
+ document.body[i] = document.body[i].replace('\\begin_inset Space \\leftarrowfill{}', \
+ '\\begin_inset ERT\nstatus collapsed\n\n' \
+ '\\begin_layout Standard\n\n\n\\backslash\n' \
+ 'leftarrowfill{}\n\\end_layout\n\n\\end_inset\n\n')
+
+
+def revert_rightarrowfill(document):
+ ' Revert \\begin_inset Space \\rightarrowfill{} to ERT '
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_inset Space \\rightarrowfill{}', i)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i)
+ if j == -1:
+ document.warning("Malformed LyX document: Could not find end of space inset.")
+ continue
+ del document.body[j]
+ document.body[i] = document.body[i].replace('\\begin_inset Space \\rightarrowfill{}', \
+ '\\begin_inset ERT\nstatus collapsed\n\n' \
+ '\\begin_layout Standard\n\n\n\\backslash\n' \
+ 'rightarrowfill{}\n\\end_layout\n\n\\end_inset\n\n')
+
+
+def revert_upbracefill(document):
+ ' Revert \\begin_inset Space \\upbracefill{} to ERT '
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_inset Space \\upbracefill{}', i)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i)
+ if j == -1:
+ document.warning("Malformed LyX document: Could not find end of space inset.")
+ continue
+ del document.body[j]
+ document.body[i] = document.body[i].replace('\\begin_inset Space \\upbracefill{}', \
+ '\\begin_inset ERT\nstatus collapsed\n\n' \
+ '\\begin_layout Standard\n\n\n\\backslash\n' \
+ 'upbracefill{}\n\\end_layout\n\n\\end_inset\n\n')
+
+
+def revert_downbracefill(document):
+ ' Revert \\begin_inset Space \\downbracefill{} to ERT '
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_inset Space \\downbracefill{}', i)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i)
+ if j == -1:
+ document.warning("Malformed LyX document: Could not find end of space inset.")
+ continue
+ del document.body[j]
+ document.body[i] = document.body[i].replace('\\begin_inset Space \\downbracefill{}', \
+ '\\begin_inset ERT\nstatus collapsed\n\n' \
+ '\\begin_layout Standard\n\n\n\\backslash\n' \
+ 'downbracefill{}\n\\end_layout\n\n\\end_inset\n\n')
+
+
def revert_local_layout(document):
' Revert local layout headers.'
i = 0
[327, []],
[328, [remove_embedding, remove_extra_embedded_files, remove_inzip_options]],
[329, []],
+ [330, []],
]
-revert = [[328, [revert_master]],
+revert = [[329, [revert_leftarrowfill, revert_rightarrowfill, revert_upbracefill, revert_downbracefill]],
+ [328, [revert_master]],
[327, []],
[326, [revert_mexican]],
[325, [revert_pdfpages]],
case InsetSpaceParams::HRULEFILL:
message = _("Horizontal Fill (Rule)");
break;
+ case InsetSpaceParams::LEFTARROWFILL:
+ message = _("Horizontal Fill (Left Arrow)");
+ break;
+ case InsetSpaceParams::RIGHTARROWFILL:
+ message = _("Horizontal Fill (Right Arrow)");
+ break;
+ case InsetSpaceParams::UPBRACEFILL:
+ message = _("Horizontal Fill (Up Brace)");
+ break;
+ case InsetSpaceParams::DOWNBRACEFILL:
+ message = _("Horizontal Fill (Down Brace)");
+ break;
case InsetSpaceParams::CUSTOM:
message = support::bformat(_("Horizontal Space (%1$s)"),
params_.length.asDocstring());
case InsetSpaceParams::HFILL_PROTECTED:
case InsetSpaceParams::DOTFILL:
case InsetSpaceParams::HRULEFILL:
+ case InsetSpaceParams::LEFTARROWFILL:
+ case InsetSpaceParams::RIGHTARROWFILL:
+ case InsetSpaceParams::UPBRACEFILL:
+ case InsetSpaceParams::DOWNBRACEFILL:
// shut up compiler
break;
}
int const y0 = y + desc;
int const y1 = y - asc;
int const y2 = y - asc / 2;
+ int const xoffset = (y0 - y1) / 2;
+ int const x2 = x0 + xoffset;
+ int const x3 = x1 - xoffset;
if (params_.kind == InsetSpaceParams::HFILL) {
pi.pain.line(x0, y1, x0, y0, Color_added_space);
pi.pain.line(x0, y, x1, y, Color_special,
frontend::Painter::line_onoffdash);
pi.pain.line(x1, y1, x1, y0, Color_special);
- } if (params_.kind == InsetSpaceParams::HRULEFILL) {
+ } else if (params_.kind == InsetSpaceParams::HRULEFILL) {
pi.pain.line(x0, y1, x0, y0, Color_special);
pi.pain.line(x0, y, x1, y, Color_special);
pi.pain.line(x1, y1, x1, y0, Color_special);
+ } else if (params_.kind == InsetSpaceParams::LEFTARROWFILL) {
+ pi.pain.line(x2, y1 , x0, y2, Color_special);
+ pi.pain.line(x0, y2 , x2, y0, Color_special);
+ pi.pain.line(x0, y2 , x1, y2, Color_special);
+ } else if (params_.kind == InsetSpaceParams::RIGHTARROWFILL) {
+ pi.pain.line(x3, y1 , x1, y2, Color_special);
+ pi.pain.line(x1, y2 , x3, y0, Color_special);
+ pi.pain.line(x0, y2 , x1, y2, Color_special);
+ } else if (params_.kind == InsetSpaceParams::UPBRACEFILL) {
+ pi.pain.line(x0, y1 , x2, y2, Color_special);
+ pi.pain.line(x3, y2 , x1, y1, Color_special);
+ pi.pain.line(x2, y2 , x3, y2, Color_special);
+ } else if (params_.kind == InsetSpaceParams::DOWNBRACEFILL) {
+ pi.pain.line(x0, y0 , x2, y2, Color_special);
+ pi.pain.line(x3, y2 , x1, y0, Color_special);
+ pi.pain.line(x2, y2 , x3, y2, Color_special);
}
return;
}
case InsetSpaceParams::HRULEFILL:
os << "\\hrulefill{}";
break;
+ case InsetSpaceParams::LEFTARROWFILL:
+ os << "\\leftarrowfill{}";
+ break;
+ case InsetSpaceParams::RIGHTARROWFILL:
+ os << "\\rightarrowfill{}";
+ break;
+ case InsetSpaceParams::UPBRACEFILL:
+ os << "\\upbracefill{}";
+ break;
+ case InsetSpaceParams::DOWNBRACEFILL:
+ os << "\\downbracefill{}";
+ break;
case InsetSpaceParams::CUSTOM:
os << "\\hspace{}";
break;
kind = InsetSpaceParams::HRULEFILL;
else if (command == "\\hspace{}")
kind = InsetSpaceParams::CUSTOM;
+ else if (command == "\\leftarrowfill{}")
+ kind = InsetSpaceParams::LEFTARROWFILL;
+ else if (command == "\\rightarrowfill{}")
+ kind = InsetSpaceParams::RIGHTARROWFILL;
+ else if (command == "\\upbracefill{}")
+ kind = InsetSpaceParams::UPBRACEFILL;
+ else if (command == "\\downbracefill{}")
+ kind = InsetSpaceParams::DOWNBRACEFILL;
else if (command == "\\hspace*{}")
kind = InsetSpaceParams::CUSTOM_PROTECTED;
else
case InsetSpaceParams::HRULEFILL:
os << (runparams.free_spacing ? " " : "\\hrulefill{}");
break;
+ case InsetSpaceParams::LEFTARROWFILL:
+ os << (runparams.free_spacing ? " " : "\\leftarrowfill{}");
+ break;
+ case InsetSpaceParams::RIGHTARROWFILL:
+ os << (runparams.free_spacing ? " " : "\\rightarrowfill{}");
+ break;
+ case InsetSpaceParams::UPBRACEFILL:
+ os << (runparams.free_spacing ? " " : "\\upbracefill{}");
+ break;
+ case InsetSpaceParams::DOWNBRACEFILL:
+ os << (runparams.free_spacing ? " " : "\\downbracefill{}");
+ break;
case InsetSpaceParams::CUSTOM:
if (runparams.free_spacing)
os << " ";
case InsetSpaceParams::HRULEFILL:
os << "_____";
return 5;
+ case InsetSpaceParams::LEFTARROWFILL:
+ os << "<----";
+ return 5;
+ case InsetSpaceParams::RIGHTARROWFILL:
+ os << "---->";
+ return 5;
+ case InsetSpaceParams::UPBRACEFILL:
+ os << "\\-v-/";
+ return 5;
+ case InsetSpaceParams::DOWNBRACEFILL:
+ os << "/-^-\\";
+ return 5;
default:
os << ' ';
return 1;
case InsetSpaceParams::HRULEFILL:
// FIXME
os << '\n';
+ case InsetSpaceParams::LEFTARROWFILL:
+ case InsetSpaceParams::RIGHTARROWFILL:
+ case InsetSpaceParams::UPBRACEFILL:
+ case InsetSpaceParams::DOWNBRACEFILL:
case InsetSpaceParams::CUSTOM:
case InsetSpaceParams::CUSTOM_PROTECTED:
// FIXME
return params_.kind == InsetSpaceParams::HFILL
|| params_.kind == InsetSpaceParams::HFILL_PROTECTED
|| params_.kind == InsetSpaceParams::DOTFILL
- || params_.kind == InsetSpaceParams::HRULEFILL;
+ || params_.kind == InsetSpaceParams::HRULEFILL
+ || params_.kind == InsetSpaceParams::LEFTARROWFILL
+ || params_.kind == InsetSpaceParams::RIGHTARROWFILL
+ || params_.kind == InsetSpaceParams::UPBRACEFILL
+ || params_.kind == InsetSpaceParams::DOWNBRACEFILL;
}