Various work on w2l 1.2

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@18 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2009-04-28 18:39:33 +00:00
parent c410adda52
commit 8a41806d02
11 changed files with 516 additions and 410 deletions

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2009-04-23)
* Version 1.2 (2009-04-25)
*
*/
@ -137,16 +137,16 @@ public abstract class ExportFilterBase implements
int nLen = origString.length();
for (int i=0; i<nLen; i++) {
char c = origString.charAt(i);
if (c=='&'){
buf.append("&amp;");
}
if (c=='\"'){
if (c=='&'){
buf.append("&amp;");
}
else if (c=='\"'){
buf.append("&quot;");
}
if (c=='<'){
else if (c=='<'){
buf.append("&lt;");
}
if (c=='>'){
else if (c=='>'){
buf.append("&gt;");
}
else if (c=='\u0009' || c=='\n' || c=='\r' || (c>='\u0020' && c<='\uD7FF') || (c>='\uE000' && c<'\uFFFD')) {

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2009-04-23)
* Version 1.2 (2009-04-25)
*
*/
@ -259,24 +259,8 @@ public final class ConfigurationDialog
// Configure the applications automatically (OS dependent)
private boolean autoConfigure(XWindow xWindow) {
String sOsName = System.getProperty("os.name");
if ("Linux".equals(sOsName)) {
configureApp(ExternalApps.LATEX, "latex", "--interaction=batchmode %s");
configureApp(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s");
configureApp(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s");
configureApp(ExternalApps.DVIPS, "dvips", "%s");
configureApp(ExternalApps.BIBTEX, "bibtex", "%s");
configureApp(ExternalApps.MAKEINDEX, "makeindex", "%s");
configureApp(ExternalApps.OOLATEX, "oolatex", "%s");
// We have several possible viewers
String[] sDviViewers = {"evince", "okular", "xdvi"};
configureApp(ExternalApps.DVIVIEWER, sDviViewers, "%s");
String[] sPdfViewers = {"evince", "okular", "xpdf"};
configureApp(ExternalApps.PDFVIEWER, sPdfViewers, "%s");
String[] sPsViewers = {"evince", "okular", "ghostview"};
configureApp(ExternalApps.POSTSCRIPTVIEWER, sPsViewers, "%s");
}
else if ("Windows".equals(sOsName)) {
// TODO: Get information from the windows registry
if (sOsName.startsWith("Windows")) {
// TODO: Get information from the windows registry using unowinreg.dll from the SDK
// Assume MikTeX
externalApps.setApplication(ExternalApps.LATEX, "latex", "--interaction=batchmode %s");
externalApps.setApplication(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s");
@ -291,8 +275,21 @@ public final class ConfigurationDialog
externalApps.setApplication(ExternalApps.PDFVIEWER, "gsview32.exe", "-e \"%s\"");
externalApps.setApplication(ExternalApps.POSTSCRIPTVIEWER, "gsview32.exe", "-e \"%s\"");
}
else {
// Unsupported OS
else { // Assume a unix-like system supporting the "which" command
configureApp(ExternalApps.LATEX, "latex", "--interaction=batchmode %s");
configureApp(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s");
configureApp(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s");
configureApp(ExternalApps.DVIPS, "dvips", "%s");
configureApp(ExternalApps.BIBTEX, "bibtex", "%s");
configureApp(ExternalApps.MAKEINDEX, "makeindex", "%s");
configureApp(ExternalApps.OOLATEX, "oolatex", "%s");
// We have several possible viewers
String[] sDviViewers = {"evince", "okular", "xdvi"};
configureApp(ExternalApps.DVIVIEWER, sDviViewers, "%s");
String[] sPdfViewers = {"evince", "okular", "xpdf"};
configureApp(ExternalApps.PDFVIEWER, sPdfViewers, "%s");
String[] sPsViewers = {"evince", "okular", "ghostview"};
configureApp(ExternalApps.POSTSCRIPTVIEWER, sPsViewers, "%s");
}
changeApplication(xWindow);
return true;

View file

@ -158,10 +158,6 @@ public final class Writer4LaTeX extends WeakBase
if (updateMediaProperties()) {
process();
}
else {
MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
msgBox.showMessage("Writer4LaTeX Error","Please install Writer2LaTeX version 1.0 or later");
}
}
else {
warnNotSaved();
@ -173,10 +169,6 @@ public final class Writer4LaTeX extends WeakBase
if (mediaProps!=null || updateMediaProperties()) {
process();
}
else {
MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
msgBox.showMessage("Writer4LaTeX Error","Please install Writer2LaTeX version 1.0 or later");
}
}
else {
warnNotSaved();
@ -318,6 +310,8 @@ public final class Writer4LaTeX extends WeakBase
// If Writer2LaTeX is not installed, this will return null
if (dialog==null) {
mediaProps = null;
MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
msgBox.showMessage("Writer4LaTeX Error","Please install Writer2LaTeX version 1.0 or later");
return false;
}