3 --- filter/msword.pl.orig Fri Jul 13 10:14:26 2001
14 my $wordconvpath = undef;
15 my $utfconvpath = undef;
16 my $wvversionpath = undef;
17 +my $wordconvname = undef;
20 return ('application/msword');
25 - if (util::checkcmd('wvHtml')) {
26 + if (not defined $wordconvname) {
27 + $wordconvname = basename($wordconvpath);
29 + if ($wordconvname =~ /wvhtml/i) {
30 $err = filter_wv($orig_cfile, $cont, $weighted_str, $headings, $fields);
32 $err = filter_doccat($orig_cfile, $cont, $weighted_str, $headings, $fields);
35 my $tmpfile = util::tmpnam('NMZ.word');
36 my $tmpfile2 = util::tmpnam('NMZ.word2');
38 + my ($ofile, $tpath, $options, $version);
40 if (util::islang("ja")) {
46 + $version = `$wordconvpath --version 2>/dev/null`;
48 + if ($version ne "" and $version !~ /usage/i and $version ge "0.7") {
49 + ($ofile, $tpath) = fileparse($tmpfile2);
50 + $options = "--targetdir=$tpath";
55 if (!util::islang("ja")) {
56 - system("$wordconvpath $tmpfile $tmpfile2");
57 + system("$wordconvpath $options $tmpfile $ofile");
59 my $version = "unknown";
60 my $supported = undef;
64 return _("Unsupported format: ") . $version unless $supported;
65 - system("$wordconvpath $tmpfile $tmpfile2");
66 + system("$wordconvpath $options $tmpfile $ofile");
67 system("$utfconvpath -Iu8 -Oej $tmpfile2 > $tmpfile");
69 rename($tmpfile, $tmpfile2);