mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Ticket #3926: clarify hadling of MS Word and Excel documents view.
Don't show error message for each not-installed program when view documents in MS Word and Excel formats. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
6cdd3b7ad6
commit
1d19729690
@ -48,27 +48,32 @@ do_view_action() {
|
||||
fi
|
||||
;;
|
||||
msdoc)
|
||||
which wvHtml >/dev/null 2>&1 &&
|
||||
{
|
||||
if wvHtml >/dev/null 2>&1; then
|
||||
tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
|
||||
wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html
|
||||
elinks -dump "$tmp/page.html"
|
||||
rm -rf "$tmp"
|
||||
} || \
|
||||
antiword -t "${MC_EXT_FILENAME}" || \
|
||||
catdoc -w "${MC_EXT_FILENAME}" || \
|
||||
word2x -f text "${MC_EXT_FILENAME}" - || \
|
||||
elif antiword >/dev/null 2>&1; then
|
||||
antiword -t "${MC_EXT_FILENAME}"
|
||||
elif catdoc >/dev/null 2>&1; then
|
||||
catdoc -w "${MC_EXT_FILENAME}"
|
||||
elif word2x >/dev/null 2>&1; then
|
||||
word2x -f text "${MC_EXT_FILENAME}" -
|
||||
else
|
||||
strings "${MC_EXT_FILENAME}"
|
||||
fi
|
||||
;;
|
||||
msxls)
|
||||
which xlHtml >/dev/null 2>&1 && {
|
||||
if xlHtml >/dev/null 2>&1; then
|
||||
tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
|
||||
xlhtml -a "${MC_EXT_FILENAME}" > "$tmp/page.html"
|
||||
elinks -dump "$tmp/page.html"
|
||||
rm -rf "$tmp"
|
||||
} || \
|
||||
xls2csv "${MC_EXT_FILENAME}" || \
|
||||
elif xls2csv >/dev/null 2>&1; then
|
||||
xls2csv "${MC_EXT_FILENAME}"
|
||||
else
|
||||
strings "${MC_EXT_FILENAME}"
|
||||
fi
|
||||
;;
|
||||
dvi)
|
||||
which dvi2tty >/dev/null 2>&1 && \
|
||||
|
Loading…
Reference in New Issue
Block a user