// XeTeX with TeX fonts is only safe with ASCII encoding,
// See #9740 and FIXME in BufferParams::encoding()
+ // FIXME: when only the current paragraph is shown, this seems to be ignored:
+ // characters encodable in the current encoding are not converted to ASCII-representation.
if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX))
runparams.encoding = encodings.fromLyXName("ascii");
enable = (d->preview_file_).exists() && !(d->preview_file_).isFileEmpty();
break;
+ case LFUN_CHANGES_TRACK:
+ flag.setEnabled(true);
+ flag.setOnOff(params().track_changes);
+ break;
+
+ case LFUN_CHANGES_OUTPUT:
+ flag.setEnabled(true);
+ flag.setOnOff(params().output_changes);
+ break;
+
+ case LFUN_BUFFER_TOGGLE_COMPRESSION: {
+ flag.setOnOff(params().compressed);
+ break;
+ }
+
+ case LFUN_BUFFER_TOGGLE_OUTPUT_SYNC: {
+ flag.setOnOff(params().output_sync);
+ break;
+ }
+
default:
return false;
}
dr.setMessage(_("Error viewing the output file."));
break;
+ case LFUN_CHANGES_TRACK:
+ undo().recordUndoBufferParams(CursorData());
+ params().track_changes = !params().track_changes;
+ break;
+
+ case LFUN_CHANGES_OUTPUT:
+ undo().recordUndoBufferParams(CursorData());
+ params().output_changes = !params().output_changes;
+ if (params().output_changes) {
+ bool dvipost = LaTeXFeatures::isAvailable("dvipost");
+ bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
+ LaTeXFeatures::isAvailable("xcolor");
+
+ if (!dvipost && !xcolorulem) {
+ Alert::warning(_("Changes not shown in LaTeX output"),
+ _("Changes will not be highlighted in LaTeX output, "
+ "because neither dvipost nor xcolor/ulem are installed.\n"
+ "Please install these packages or redefine "
+ "\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
+ } else if (!xcolorulem) {
+ Alert::warning(_("Changes not shown in LaTeX output"),
+ _("Changes will not be highlighted in LaTeX output "
+ "when using pdflatex, because xcolor and ulem are not installed.\n"
+ "Please install both packages or redefine "
+ "\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
+ }
+ }
+ break;
+
+ case LFUN_BUFFER_TOGGLE_COMPRESSION:
+ // turn compression on/off
+ undo().recordUndoBufferParams(CursorData());
+ params().compressed = !params().compressed;
+ break;
+
+ case LFUN_BUFFER_TOGGLE_OUTPUT_SYNC:
+ undo().recordUndoBufferParams(CursorData());
+ params().output_sync = !params().output_sync;
+ break;
+
default:
dispatched = false;
break;