Changeset 23220
- Timestamp:
- 2010-10-27T11:54:52+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/open-office-src/trunk/perllib/plugins/OpenOfficePlugin.pm
r22610 r23220 39 39 } 40 40 41 my $word_pe = "doc|dot|docx|odt"; 42 my $ppt_pe = "ppt"; 41 my $word_pe = "doc|dot|docx|odt|wpd"; 42 my $rtf_pe = "rtf"; 43 my $ppt_pe = "ppt|pptx|odp"; 44 my $xls_pe = "xls|xlsx|ods"; 43 45 44 46 my $arguments = … … 50 52 ]; 51 53 54 # This is not quite fully functional, eg doesn't do proper PowerPoint processing. So I have made it hidden in gli for now. 52 55 my $options = { 'name' => "OpenOfficePlugin", 53 56 'desc' => "{OpenOfficePlugin.desc}", 54 57 'abstract' => "no", 55 58 'inherits' => "yes", 59 'hiddengli' => "yes", 56 60 'args' => $arguments }; 57 61 … … 84 88 85 89 $self = bless $self, $class; 86 print STDERR "launch cmd = $self->{'openoffice_launch_cmd'}\n";87 90 88 91 # set convert_to_plugin and convert_to_ext … … 109 112 $self->SUPER::init(@_); 110 113 $self->OpenOfficeConverter::init(); 111 $self->{'cover_image'} = 0; # makes no sense for images112 114 } 113 115 … … 124 126 my $self = shift (@_); 125 127 126 #return q^(?i)\.(doc|dot|docx|odt)$^; 127 return "(?i)\.($word_pe|$ppt_pe)\$"; 128 return "(?i)\.($word_pe|$ppt_pe|$rtf_pe|$xls_pe)\$"; 128 129 } 129 130 … … 158 159 } 159 160 161 # first return value is used in _iconxx_ to give a srcicon, 162 # second return value is used for FileFormat metadata 160 163 sub get_file_type_from_extension { 161 164 my $self = shift (@_); … … 164 167 #check against the various bit of process_exp 165 168 if ($file =~ /$word_pe/) { 166 print STDERR "matched\n";167 169 return ("doc", "Word"); 168 170 } 169 171 if ($file =~ /$ppt_pe/) { 170 return ("ppt", "PowerPoint"); 171 } 172 return ("ppt", "PPT"); 173 } 174 if ($file =~ /$xls_pe/) { 175 return ("xls", "Excel"); 176 } 177 if ($file =~ /$rtf_pe/) { 178 return ("rtf", "RTF"); 179 } 180 172 181 return ("unknown", "Unknown"); 173 182 }
Note:
See TracChangeset
for help on using the changeset viewer.