Kaydet (Commit) 51ee7d2d authored tarafından Noel Power's avatar Noel Power

ScriptBinding.xba, enabled dynamic config changes

ExecCmd, put close of streams in final block
üst 60c8e64e
......@@ -588,7 +588,8 @@ Sub WriteXMLFromArray()
On Error Goto ErrorHandler
cfgFile = GetOfficePath() + "user/config/soffice.cfg/" + xmlFileName
updateCfgFile( cfgFile )
if ( false ) then' config stuff not in build yet
'if ( false ) then' config stuff not in build yet
if ( true ) then
updateConfig( xmlFileName )
else
msgbox ("Office must be restarted before your changes will take effect."+ chr$(10)+"Also close the Office QuickStarter (Windows and Linux)", 48, "Assign Script (Java) To Menu" )
......
......@@ -16,9 +16,10 @@ public class ExecCmd
new Thread(new Runnable() {
public void run()
{
BufferedReader br_in = null;
try
{
BufferedReader br_in = new BufferedReader(new InputStreamReader(p.getInputStream()));
br_in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String buff = null;
while ((buff = br_in.readLine()) != null)
{
......@@ -29,7 +30,6 @@ public class ExecCmd
}
catch(Exception e) {}*/
}
br_in.close();
System.out.println("finished reading out");
}
catch (IOException ioe)
......@@ -37,23 +37,45 @@ public class ExecCmd
System.out.println("Exception caught printing javac result");
ioe.printStackTrace();
}
finally
{
if ( br_in != null )
{
try
{
br_in.close();
}
catch( Exception e ) {} // nothing can be done
}
}
} } ).start();
new Thread(new Runnable() {
public void run() {
BufferedReader br_err = null;
try {
BufferedReader br_err = new BufferedReader(new InputStreamReader(p.getErrorStream()));
br_err = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String buff = null;
while ((buff = br_err.readLine()) != null) {
System.out.println("Process err :" + buff);
/*try {Thread.sleep(100); } catch(Exception e) {}*/
}
br_err.close();
System.out.println("finished reading err");
} catch (IOException ioe) {
System.out.println("Exception caught printing javac result");
ioe.printStackTrace();
}
finally
{
if ( br_err != null )
{
try
{
br_err.close();
}
catch( Exception e ) {} // nothing can be done
}
}
} }).start();
int exitcode = p.waitFor();
if ( exitcode != 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment