Index: /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm
===================================================================
--- /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm	(revision 22493)
+++ /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm	(revision 22494)
@@ -27,4 +27,5 @@
 package OpenOfficeConverter;
 
+use ConvertBinaryFile;
 use BaseMediaConverter;
 
@@ -35,5 +36,5 @@
 
 BEGIN {
-    @OpenOfficeConverter::ISA = ('BaseMediaConverter');
+    @OpenOfficeConverter::ISA = ('ConvertBinaryFile', 'BaseMediaConverter');
 }
 
@@ -46,5 +47,5 @@
       'reqd' => "no" },
     { 'name' => "openoffice_port",
-      'desc' => "{OpenOfficeConverter.openoffice_scripting}",
+      'desc' => "{OpenOfficeConverter.openoffice_port}",
       'type' => "int",
       'deft' => "8100",
@@ -86,7 +87,17 @@
 	else {
 	    # test to see if soffice in in path
-	    my $cmd = "soffice -headless -help 2>&1";
-
-	    if (system($cmd)!=0) {
+	    if ($ENV{'GSDLOS'} =~ m/^windows$/) {
+		my $ooffice_dir_guess =
+		    &util::filename_cat($ENV{'ProgramFiles'},"OpenOffice.org 3",
+					"program");
+		if (-d  $ooffice_dir_guess) {
+		    &util::envvar_append("PATH",$ooffice_dir_guess);
+		}
+	    }
+
+	    my $cmd = "soffice -headless";
+
+	    my $status = system($cmd);
+	    if ($status != 0) {
 		print STDERR "Failed to run: $cmd\n";
 		print STDERR "$!\n";
@@ -98,8 +109,5 @@
 
     if ($openoffice_conversion_available) {
-	push(@$arguments,$opt_arguments);
-
-	# have necessary components => launch OpenOffice in headless mode
-	# listing to localhost port
+	push(@$arguments,@$opt_arguments);
     }
 
@@ -107,18 +115,20 @@
     push(@{$hashArgOptLists->{"OptList"}},$options);
 
-    my $self 
-	= new BaseMediaConverter($pluginlist, $inputargs, $hashArgOptLists, 1);
+    my $bmc_self = new BaseMediaConverter($pluginlist, $inputargs, $hashArgOptLists,1);
+    my $cbf_self = new ConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists);
+
+    my $self = BasePlugin::merge_inheritance($bmc_self,$cbf_self);
 
     if ($openoffice_conversion_available) {
-
-	my $oo_port = $self->{'openoffice_port'};
-	my $launch_cmd = "soffice";
-	$launch_cmd .= " \"-accept=socket,host=localhost,port=$oo_port;urp;StarOffice.ServiceManager\"";
-	$launch_cmd .= " -headless";
-	
-	$self->{'openoffice_launch_cmd'} = $launch_cmd;	
+	if ($self->{'openoffice_scripting'}) {
+	    my $oo_port = $self->{'openoffice_port'};
+	    my $launch_cmd = "soffice";
+	    $launch_cmd .= " \"-accept=socket,host=localhost,port=$oo_port;urp;StarOffice.ServiceManager\"";
+	    $launch_cmd .= " -headless";
+	    
+	    $self->{'openoffice_launch_cmd'} = $launch_cmd;
+	}
     }
     else {       
-	$self->{'openoffice_conversion_available'} = $openoffice_conversion_available;
 	$self->{'no_openoffice_conversion_reason'} = $no_openoffice_conversion_reason;
 
@@ -126,4 +136,6 @@
 	&gsprintf($outhandle, "OpenOfficeConverter: {OpenOfficeConverter.noconversionavailable} ({OpenOfficeConverter.$no_openoffice_conversion_reason})\n");
     }  
+
+    $self->{'openoffice_conversion_available'} = $openoffice_conversion_available;
     
     return bless $self, $class;
@@ -133,5 +145,8 @@
 sub init {
     my $self = shift(@_);
-
+    my ($verbosity, $outhandle, $failhandle) = @_;
+
+    $self->ConvertBinaryFile::init($verbosity,$outhandle,$failhandle);
+ 
     $self->{'ootmp_file_paths'} = ();
 }
@@ -140,6 +155,10 @@
     my $self = shift(@_);
 
+    $self->ConvertBinaryFile::deinit(@_);
+ 
     $self->clean_up_temporary_files();
 }
+
+
 	
 
@@ -197,4 +216,18 @@
 
 
+sub tmp_area_convert_fileXX {
+    my $self = shift (@_);
+    my ($output_ext, $input_filename, $textref) = @_;
+    
+    my $outhandle = $self->{'outhandle'};
+    my $convert_to = $self->{'convert_to'};
+    my $failhandle = $self->{'failhandle'};
+    my $convert_to_ext = $self->{'convert_to_ext'};
+    
+    # derive tmp filename from input filename
+    my ($tailname, $dirname, $suffix)
+	= &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
+}
+
 
 sub clean_up_temporary_files {
