diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2005-05-13 08:43:07 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2005-05-13 08:43:07 +0000 |
commit | c6de0bc8214c026ae335ac20ee664a457ec65afb (patch) | |
tree | fb61f75829b05c6a03c0758a1e38b6199aed44e8 /wizards/com/sun/star/wizards/letter | |
parent | bed91b5785e55a93037fadc3233adbf7712d8d00 (diff) |
INTEGRATION: CWS nativefixer7 (1.7.10); FILE MERGED
2005/05/09 13:21:14 tv 1.7.10.3: removed split() because it is not jdk 1.3 compatible
Issue number:
Submitted by:
Reviewed by:
2005/05/09 10:43:53 tv 1.7.10.2: RESYNC: (1.7-1.8); FILE MERGED
2005/05/09 09:56:58 tv 1.7.10.1: #i47885# letter wizard templates are being installed as one big base block plus language packs
Issue number:
Submitted by:
Reviewed by:
Diffstat (limited to 'wizards/com/sun/star/wizards/letter')
-rw-r--r-- | wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java | 76 |
1 files changed, 70 insertions, 6 deletions
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java index 81bbbedfa3ad..efd4bde03ab6 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java @@ -18,6 +18,7 @@ import com.sun.star.container.NoSuchElementException; import com.sun.star.document.MacroExecMode; import com.sun.star.document.XDocumentInfo; import com.sun.star.document.XDocumentInfoSupplier; +import com.sun.star.ucb.CommandAbortedException; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Exception; import com.sun.star.uno.RuntimeException; @@ -33,7 +34,7 @@ import com.sun.star.wizards.document.*; import com.sun.star.wizards.ui.*; import com.sun.star.wizards.ui.event.*; import com.sun.star.wizards.common.Helper; - +import com.sun.star.wizards.common.Resource; public class LetterWizardDialogImpl extends LetterWizardDialog { @@ -59,6 +60,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { String sUserTemplatePath; String sBitmapPath; String sLetterPath; + String sLetterLangPackPath; String sWorkPath; String sCurrentNorm; String sPath; @@ -117,10 +119,11 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { buildStep5(); buildStep6(); + initializePaths(); initializeNorms(); initializeSalutation(); initializeGreeting(); - initializePaths(); + //special Control for setting the save Path: insertPathSelectionControl(); @@ -846,6 +849,65 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { } public void initializeNorms() { + + //The following commented code is to be used for support of + //language packs and on-the-fly new languages: + /* + LocaleCodes lc = new LocaleCodes(); + String [] allLocales = lc.getIDs(); + String[] nameList = {"",""}; + String sLetterSubPath = "/wizard/letter/"; + + try { + sLetterPath = FileAccess.getParentDir(sTemplatePath); + sLetterPath = FileAccess.deleteLastSlashfromUrl(sLetterPath); + sLetterPath = sLetterPath + sLetterSubPath; + sLetterLangPackPath = FileAccess.combinePaths(xMSF, sTemplatePath, sLetterSubPath); + + 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); + nameList = xSimpleFileAccess.getFolderContents(sLetterPath, true); + } catch (CommandAbortedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoValidPathException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + Norms = new String[nameList.length]; + + boolean found = false; + String cIsoCode; + for (int i=0; i < nameList.length; i++) { + found = false; + cIsoCode = FileAccess.getFilename(nameList[i]); + for (int t=0; t < allLocales.length; t++) { + String [] aLang = allLocales[t].split(";"); + if (cIsoCode.equalsIgnoreCase(aLang[1])) { + System.out.println(aLang[2]); + found = true; + t = allLocales.length; + } + } + if (!found) { + for (int t=0; t < allLocales.length; t++) { + String [] aLang = allLocales[t].split(";"); + if (cIsoCode.equalsIgnoreCase(aLang[1].substring(0,2))) { + System.out.println(aLang[2]); + found = true; + t = allLocales.length; + } + } + } + Norms[i] = cIsoCode; + } + + **/ + //To add new Languages please modify this method and LetterWizardDialogResources.java Norms = new String[16]; @@ -867,7 +929,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { Norms[15] = "hr"; setControlProperty("lstLetterNorm", "StringItemList", resources.LanguageLabels); - } private CGLetter getCurrentLetter() { @@ -882,8 +943,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { private void initializePaths() { try { sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share"); - sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user"); - sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap"); + //sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user"); + //sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap"); } catch (NoValidPathException e) { e.printStackTrace(); } @@ -892,8 +953,11 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { public boolean initializeTemplates(XMultiServiceFactory xMSF) { try { sCurrentNorm = Norms[getCurrentLetter().cp_Norm]; + //creation of the language independent path: + sLetterPath = FileAccess.getParentDir(sTemplatePath); + sLetterPath = FileAccess.deleteLastSlashfromUrl(sLetterPath); String sLetterSubPath = "/wizard/letter/" + sCurrentNorm; - sLetterPath = FileAccess.combinePaths(xMSF, sTemplatePath, sLetterSubPath); + sLetterPath = FileAccess.combinePaths(xMSF, sLetterPath, sLetterSubPath); sWorkPath = FileAccess.getOfficePath(xMSF, "Work", ""); BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus", sLetterPath); |