Merge branch '3926_view_doc'

* 3926_view_doc:
  Ticket #3926: clarify hadling of MS Word and Excel documents view.
This commit is contained in:
Andrew Borodin 2018-07-26 16:51:03 +03:00
commit 0bb1db9030

View File

@ -48,27 +48,32 @@ do_view_action() {
fi fi
;; ;;
msdoc) msdoc)
which wvHtml >/dev/null 2>&1 && if wvHtml >/dev/null 2>&1; then
{
tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
elinks -dump "$tmp/page.html" elinks -dump "$tmp/page.html"
rm -rf "$tmp" rm -rf "$tmp"
} || \ elif antiword >/dev/null 2>&1; then
antiword -t "${MC_EXT_FILENAME}" || \ antiword -t "${MC_EXT_FILENAME}"
catdoc -w "${MC_EXT_FILENAME}" || \ elif catdoc >/dev/null 2>&1; then
word2x -f text "${MC_EXT_FILENAME}" - || \ catdoc -w "${MC_EXT_FILENAME}"
elif word2x >/dev/null 2>&1; then
word2x -f text "${MC_EXT_FILENAME}" -
else
strings "${MC_EXT_FILENAME}" strings "${MC_EXT_FILENAME}"
fi
;; ;;
msxls) msxls)
which xlHtml >/dev/null 2>&1 && { if xlHtml >/dev/null 2>&1; then
tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
xlhtml -a "${MC_EXT_FILENAME}" > "$tmp/page.html" xlhtml -a "${MC_EXT_FILENAME}" > "$tmp/page.html"
elinks -dump "$tmp/page.html" elinks -dump "$tmp/page.html"
rm -rf "$tmp" rm -rf "$tmp"
} || \ elif xls2csv >/dev/null 2>&1; then
xls2csv "${MC_EXT_FILENAME}" || \ xls2csv "${MC_EXT_FILENAME}"
else
strings "${MC_EXT_FILENAME}" strings "${MC_EXT_FILENAME}"
fi
;; ;;
dvi) dvi)
which dvi2tty >/dev/null 2>&1 && \ which dvi2tty >/dev/null 2>&1 && \