Show
Ignore:
Timestamp:
27.10.2010 11:54:52 (9 years ago)
Author:
kjdon
Message:

added a few more file types that it can process, and made it hidden in GLI. Needs a bit more work before we advertise it.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/open-office-src/trunk/perllib/plugins/OpenOfficePlugin.pm

    r22610 r23220  
    3939} 
    4040 
    41 my $word_pe = "doc|dot|docx|odt"; 
    42 my $ppt_pe = "ppt"; 
     41my $word_pe = "doc|dot|docx|odt|wpd"; 
     42my $rtf_pe = "rtf"; 
     43my $ppt_pe = "ppt|pptx|odp"; 
     44my $xls_pe = "xls|xlsx|ods"; 
    4345 
    4446my $arguments = 
     
    5052      ]; 
    5153 
     54# This is not quite fully functional, eg doesn't do proper PowerPoint processing. So I have made it hidden in gli for now. 
    5255my $options = { 'name'     => "OpenOfficePlugin", 
    5356        'desc'     => "{OpenOfficePlugin.desc}", 
    5457        'abstract' => "no", 
    5558        'inherits' => "yes", 
     59        'hiddengli' => "yes", 
    5660        'args'     => $arguments }; 
    5761 
     
    8488 
    8589    $self = bless $self, $class; 
    86     print STDERR "launch cmd = $self->{'openoffice_launch_cmd'}\n"; 
    8790 
    8891    # set convert_to_plugin and convert_to_ext 
     
    109112    $self->SUPER::init(@_); 
    110113    $self->OpenOfficeConverter::init(); 
    111     $self->{'cover_image'} = 0; # makes no sense for images 
    112114} 
    113115 
     
    124126    my $self = shift (@_); 
    125127 
    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)\$"; 
    128129} 
    129130 
     
    158159} 
    159160 
     161# first return value is used in _iconxx_ to give a srcicon,  
     162# second return value is used for FileFormat metadata 
    160163sub get_file_type_from_extension { 
    161164    my $self = shift (@_); 
     
    164167    #check against the various bit of process_exp 
    165168    if ($file =~ /$word_pe/) { 
    166     print STDERR "matched\n"; 
    167169    return ("doc", "Word"); 
    168170    } 
    169171    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     
    172181    return ("unknown", "Unknown"); 
    173182}