summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-01-29 08:26:23 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-01-29 08:26:23 +0000
commit5c49542926f72e0b55b6fba5b6b8859a1ca87de9 (patch)
treea04a3e035f8910a2f31b782ac00618c19e5152ba
parentc88364223f834c672cf2749e7d3fd96f26958832 (diff)
INTEGRATION: CWS os109 (1.17.72); FILE MERGED
2007/12/17 08:56:54 os 1.17.72.1: #i73297# fallback to en-US template fixed
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java49
1 files changed, 31 insertions, 18 deletions
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
index 1eeac00b3..c4d1308c2 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
@@ -896,6 +896,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
String [] allLocales = lc.getIDs();
Object [] nameList = {"",""};
String [] nameList1 = {"",""};
+ String [] nameList1b = {"",""};
String [] nameList2 = {"",""};
Vector allPaths = new Vector();
String sLetterSubPath = "/wizard/letter/";
@@ -908,6 +909,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
for (int i=0; i<(PathParts.length -1); i++) {
nuString = nuString + PathParts[i] + "/";
}
+ String sLocLetterPath;
sMainPath = nuString;
sMainPath = FileAccess.deleteLastSlashfromUrl(sMainPath);
@@ -917,25 +919,36 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface);
nameList1 = xSimpleFileAccess.getFolderContents(sMainPath, true);
- nameList2 = xSimpleFileAccess.getFolderContents(sLetterPath, true);
- for (int i=0;i<nameList1.length;i++) {
- String theFileName = FileAccess.getFilename(nameList1[i]);
- if (!theFileName.equalsIgnoreCase("wizard")) {
- allPaths.add(nameList1[i]+ sLetterSubPath + theFileName);
- }
+ nameList2 = xSimpleFileAccess.getFolderContents(sLetterPath, true);
+ for (int i=0;i<nameList1.length;i++) {
+ String theFileName = FileAccess.getFilename(nameList1[i]);
+ if (!theFileName.equalsIgnoreCase("wizard")) {
+ sLocLetterPath = FileAccess.deleteLastSlashfromUrl(nameList1[i] + sLetterSubPath);
+ try{
+ nameList1b = xSimpleFileAccess.getFolderContents(sLocLetterPath, true);
+ for (int j=0;j<nameList1b.length;j++) {
+ String theFileNameb = FileAccess.getFilename(nameList1b[j]);
+ allPaths.add(nameList1[i]+ sLetterSubPath + theFileNameb);
}
- for (int i=0;i<nameList2.length;i++) {
- boolean found = false;
- for (int t=0;t<nameList1.length;t++) {
- if (FileAccess.getFilename(nameList2[i]).equalsIgnoreCase(FileAccess.getFilename(nameList1[t])) ) {
- found = true;
- }
- }
- if (!found) {
- allPaths.add(nameList2[i]);
- }
- }
- nameList = allPaths.toArray();
+ }
+ catch(Exception e)
+ {
+ //if the path is invalid an exception is thrown - try the fallback below then
+ }
+ }
+ }
+ for (int i=0;i<nameList2.length;i++) {
+ boolean found = false;
+ for (int t=0;t<nameList1.length;t++) {
+ if (FileAccess.getFilename(nameList2[i]).equalsIgnoreCase(FileAccess.getFilename(nameList1[t])) ) {
+ found = true;
+ }
+ }
+ if (!found) {
+ allPaths.add(nameList2[i]);
+ }
+ }
+ nameList = allPaths.toArray();
} catch (CommandAbortedException e) {