summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/letter
diff options
context:
space:
mode:
authorIstvan Turi <turipista@freemail.hu>2012-08-24 21:47:16 +0200
committerAndras Timar <atimar@suse.com>2012-08-24 21:53:39 +0200
commit1b7c88ab4d6aaa79c484bcb179e5b2f296654462 (patch)
tree351a3b9acb4237fdfe7a114f199b4d20c9863a62 /wizards/com/sun/star/wizards/letter
parenta581d31b227623e09d2970a91214fda398f98eda (diff)
translate fax/letter/agenda/report templates runtime
Instead of distributing bazillions of localized templates, that contain only a few translatable strings, we try to localize them runtime. This is the initial patch that does the heavy-lifting. It has some rough edges, but the feature will be polished by freezing of LibreOffice 3.7. Change-Id: I535b3bff1f5706afebd21d017c01e2b4745b7cfb
Diffstat (limited to 'wizards/com/sun/star/wizards/letter')
-rw-r--r--wizards/com/sun/star/wizards/letter/CGLetter.java1
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialog.java22
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogConst.java3
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java334
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java5
5 files changed, 129 insertions, 236 deletions
diff --git a/wizards/com/sun/star/wizards/letter/CGLetter.java b/wizards/com/sun/star/wizards/letter/CGLetter.java
index 6df55e230efd..b5c4eda783b9 100644
--- a/wizards/com/sun/star/wizards/letter/CGLetter.java
+++ b/wizards/com/sun/star/wizards/letter/CGLetter.java
@@ -29,7 +29,6 @@ public class CGLetter extends ConfigGroup
public boolean cp_PaperCompanyAddressReceiverField;
public boolean cp_PaperFooter;
public double cp_PaperFooterHeight;
- public int cp_Norm;
public boolean cp_PrintCompanyLogo;
public boolean cp_PrintCompanyAddressReceiverField;
public boolean cp_PrintLetterSigns;
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java
index b2afc8420491..ef27af49f547 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java
@@ -66,7 +66,6 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
XFixedText lblAddressX;
XFixedText lblAddressY;
XFixedText lblTitle2;
- XListBox lstLetterNorm;
XCheckBox chkUseLogo;
XCheckBox chkUseAddressReceiver;
XCheckBox chkUseSigns;
@@ -77,7 +76,6 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
XCheckBox chkUseGreeting;
XComboBox lstGreeting;
XCheckBox chkUseFooter;
- XFixedText lblLetterNorm;
XFixedText lblTitle3;
XRadioButton optSenderPlaceholder;
XRadioButton optSenderDefine;
@@ -262,7 +260,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
});
ImageControl3 = insertInfoImage(92, 145, 1);
-// ImageControl3 = insertImage("ImageControl3",
+// ImageControl3 = insertImage("ImageControl3",
// new String[] {PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
// new Object[] { new Short((short)0), INTEGERS[10],"private:resource/dbu/image/19205","ImageControl3",92,145,Boolean.FALSE,INTEGERS[1],new Short((short)81),INTEGERS[10]}
// );
@@ -499,15 +497,6 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
public void buildStep3()
{
- lstLetterNorm = insertListBox("lstLetterNorm", LSTLETTERNORM_ACTION_PERFORMED, LSTLETTERNORM_ITEM_CHANGED,
- new String[]
- {
- "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
- },
- new Object[]
- {
- Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 21), "lstLetterNorm", 210, 34, INTEGERS[3], new Short((short) 21), 74
- });
chkUseLogo = insertCheckBox("chkUseLogo", CHKUSELOGO_ITEM_CHANGED,
new String[]
{
@@ -598,15 +587,6 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
{
INTEGERS[8], HelpIds.getHelpIdString(HID + 31), resources.reschkUseFooter_value, "chkUseFooter", 97, 158, new Short((short) 0), INTEGERS[3], new Short((short) 31), 212
});
- lblLetterNorm = insertLabel("lblLetterNorm",
- new String[]
- {
- PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
- },
- new Object[]
- {
- INTEGER_16, resources.reslblLetterNorm_value, Boolean.TRUE, "lblLetterNorm", 97, 28, INTEGERS[3], new Short((short) 50), 109
- });
lblTitle3 = insertLabel("lblTitle3",
new String[]
{
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogConst.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogConst.java
index e9e61b0c3ade..0d345e94e538 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogConst.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogConst.java
@@ -44,7 +44,6 @@ public interface LetterWizardDialogConst
public static final String NUMADDRESSWIDTH_TEXT_CHANGED = "numAddressWidthTextChanged";
public static final String NUMADDRESSY_TEXT_CHANGED = "numAddressYTextChanged";
public static final String LSTLETTERNORM_ACTION_PERFORMED = null;
- public static final String LSTLETTERNORM_ITEM_CHANGED = "lstLetterNormItemChanged";
public static final String CHKUSELOGO_ITEM_CHANGED = "chkUseLogoItemChanged";
public static final String CHKUSEADDRESSRECEIVER_ITEM_CHANGED = "chkUseAddressReceiverItemChanged";
public static final String CHKUSESIGNS_ITEM_CHANGED = "chkUseSignsItemChanged";
@@ -80,4 +79,4 @@ public interface LetterWizardDialogConst
public static final String imageURLImageControl3 = null;
public static final int HID = 40768;
public static final int HIDMAIN = 40820;
-} \ No newline at end of file
+}
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
index 31af8c3b8859..582d71877bca 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
@@ -17,6 +17,7 @@
*/
package com.sun.star.wizards.letter;
+import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -30,7 +31,6 @@ import com.sun.star.container.NoSuchElementException;
import com.sun.star.document.MacroExecMode;
import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XDocumentPropertiesSupplier;
-import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.task.XInteractionHandler;
@@ -39,6 +39,7 @@ import com.sun.star.text.XTextFrame;
import com.sun.star.ucb.CommandAbortedException;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Exception;
+import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.util.CloseVetoException;
@@ -61,23 +62,17 @@ import com.sun.star.wizards.ui.event.DataAware;
import com.sun.star.wizards.ui.event.RadioDataAware;
import com.sun.star.wizards.ui.event.UnoDataAware;
+import com.sun.star.util.XSearchable;
+import com.sun.star.util.XSearchDescriptor;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.text.*;
+import com.sun.star.wizards.text.*;
+import com.sun.star.wizards.common.TextElement;
+import com.sun.star.wizards.common.PlaceholderTextElement;
+
public class LetterWizardDialogImpl extends LetterWizardDialog
{
- private class Strings
- {
- public String Norm;
- public String NormPath;
- public String LanguageLabel;
-
- public Strings(String norm, String normPath, String languageLabel)
- {
- Norm = norm;
- NormPath = normPath;
- LanguageLabel = languageLabel;
- }
- }
-
protected void enterStep(int OldStep, int NewStep)
{
}
@@ -97,16 +92,12 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
String[][] BusinessFiles;
String[][] OfficialFiles;
String[][] PrivateFiles;
- String[] Norms;
- String[] NormPaths;
- String[] NormNames;
String sTemplatePath;
String sUserTemplatePath;
String sBitmapPath;
String sLetterPath;
String sLetterLangPackPath;
String sWorkPath;
- String sCurrentNorm;
String sPath;
boolean bEditTemplate;
boolean bSaveSuccess = false;
@@ -122,6 +113,10 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
final static int RM_FOOTER = 5;
final static int RM_FINALSETTINGS = 6;
+ List<XTextRange> constRangeList = new ArrayList<XTextRange>();
+ XTextRange trSubjectconst;
+ TextElement teSubjectconst;
+
public LetterWizardDialogImpl(XMultiServiceFactory xmsf)
{
super(xmsf);
@@ -137,6 +132,10 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
xLocMSF = Desktop.connect(ConnectStr);
}
+ catch (RuntimeException e)
+ {
+ e.printStackTrace();
+ }
catch (Exception e)
{
e.printStackTrace();
@@ -172,7 +171,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
buildStep6();
initializePaths();
- initializeNorms();
initializeSalutation();
initializeGreeting();
@@ -183,11 +181,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
//load the last used settings from the registry and apply listeners to the controls:
initConfiguration();
- //set the language according to the Linguistic
- int oL = getOfficeLinguistic();
- myConfig.cp_BusinessLetter.cp_Norm = oL;
- myConfig.cp_PrivateOfficialLetter.cp_Norm = oL;
- myConfig.cp_PrivateLetter.cp_Norm = oL;
initializeTemplates(xMSF);
if (myConfig.cp_BusinessLetter.cp_Greeting.equals(PropertyNames.EMPTY_STRING))
@@ -239,6 +232,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
//disable funtionality that is not supported by the template:
initializeElements();
+ drawConstants();
+
//disable the document, so that the user cannot change anything:
myLetterDoc.xFrame.getComponentWindow().setEnable(false);
@@ -253,7 +248,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
removeTerminateListener();
exception.printStackTrace(System.err);
running = false;
- }
+ }
}
public void cancelWizard()
@@ -372,7 +367,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
try
{
- //xComponent.dispose();
+ //xComponent.dispose();
XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, myLetterDoc.xFrame);
xCloseable.close(false);
}
@@ -382,6 +377,80 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
}
}
+ public void drawConstants()
+ {
+ constRangeList = searchFillInItems(1);
+
+ XTextRange item = null;
+
+ for (int i = 0; i < constRangeList.size(); i++)
+ {
+ item = constRangeList.get(i);
+ String text = item.getString().trim().toLowerCase();
+ if (text.equals(resources.resSubjectconstPlaceHolder))
+ {
+ teSubjectconst = new PlaceholderTextElement(item, resources.resSubjectconstPlaceHolder_value, "hint", myLetterDoc.xMSF);
+ trSubjectconst = item;
+ constRangeList.remove(i--);
+ writeTitle(teSubjectconst,trSubjectconst,resources.resSubjectconstPlaceHolder_value);
+ }
+ }
+ }
+
+ public void clearConstants()
+ {
+ constRangeList.clear();
+ trSubjectconst = null;
+ teSubjectconst = null;
+ }
+
+ private void writeTitle(TextElement te, XTextRange tr, String text)
+ {
+ te.setText(text == null ? PropertyNames.EMPTY_STRING : text);
+ te.write(tr);
+ }
+
+ public List<XTextRange> searchFillInItems(int type)
+ {
+ try
+ {
+ XSearchable xSearchable = UnoRuntime.queryInterface(XSearchable.class, xTextDocument);
+ XSearchDescriptor sd = xSearchable.createSearchDescriptor();
+
+ if(type == 0)
+ {
+ sd.setSearchString("<[^>]+>");
+ }
+ else if(type == 1)
+ {
+ sd.setSearchString("#[^#]+#");
+ }
+ sd.setPropertyValue("SearchRegularExpression", Boolean.TRUE);
+ sd.setPropertyValue("SearchWords", Boolean.TRUE);
+
+ XIndexAccess ia = xSearchable.findAll(sd);
+
+ List<XTextRange> l = new ArrayList<XTextRange>(ia.getCount());
+ for (int i = 0; i < ia.getCount(); i++)
+ {
+ try
+ {
+ l.add(UnoRuntime.queryInterface(XTextRange.class, ia.getByIndex(i)));
+ }
+ catch (Exception ex)
+ {
+ System.err.println("Nonfatal Error in finding fillins.");
+ }
+ }
+ return l;
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ throw new IllegalArgumentException("Fatal Error: Loading template failed: searching fillins failed");
+ }
+ }
+
public void optBusinessLetterItemChanged()
{
DataAware.setDataObject(letterDA, myConfig.cp_BusinessLetter, true);
@@ -498,6 +567,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
initializeElements();
chkBusinessPaperItemChanged();
setElements(false);
+ clearConstants();
+ drawConstants();
myLetterDoc.xTextDocument.unlockControllers();
activate();
}
@@ -509,6 +580,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
initializeElements();
setPossibleSenderData(true);
setElements(false);
+ clearConstants();
+ drawConstants();
myLetterDoc.xTextDocument.unlockControllers();
activate();
}
@@ -519,6 +592,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
myLetterDoc.xTextDocument.lockControllers();
initializeElements();
setElements(true);
+ clearConstants();
+ drawConstants();
myLetterDoc.xTextDocument.unlockControllers();
activate();
}
@@ -763,7 +838,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
}
}
- //switch Elements on/off -------------------------------------------------------
+ //switch Elements on/off -------------------------------------------------------
public void chkUseLogoItemChanged()
{
try
@@ -774,9 +849,10 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
myLetterDoc.switchElement("Company Logo", logostatus);
}
}
- catch (IllegalArgumentException e)
+ catch (Exception ex)
{
- e.printStackTrace();
+ ex.printStackTrace();
+ throw new IllegalArgumentException("Fatal Error: Loading template failed: searching fillins failed");
}
}
@@ -790,9 +866,10 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
myLetterDoc.switchElement("Sender Address Repeated", rstatus);
}
}
- catch (IllegalArgumentException e)
+ catch (Exception ex)
{
- e.printStackTrace();
+ ex.printStackTrace();
+ throw new IllegalArgumentException("Fatal Error: Loading template failed: searching fillins failed");
}
}
@@ -837,7 +914,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
myLetterDoc.switchFooter("Standard", bFooterPossible, (chkFooterPageNumbers.getState() != 0), txtFooter.getText());
}
- //enable/disable roadmap item for footer page
+ //enable/disable roadmap item for footer page
XInterface BPaperItem = getRoadmapItemByID(RM_FOOTER);
Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bFooterPossible));
@@ -989,36 +1066,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
}
}
- private int getOfficeLinguistic()
- {
- int oL = 0;
- boolean found = false;
- String OfficeLinguistic = Configuration.getOfficeLinguistic(xMSF);
- for (int i = 0; i < Norms.length; i++)
- {
- if (Norms[i].equalsIgnoreCase(OfficeLinguistic))
- {
- oL = i;
- found = true;
- break;
- }
- }
- if (!found)
- {
- //fall back to English:
- for (int i = 0; i < Norms.length; i++)
- {
- if (Norms[i].equalsIgnoreCase("en-US"))
- {
- oL = i;
- found = true;
- break;
- }
- }
- }
- return oL;
- }
-
private void setPossibleSenderData(boolean bState)
{
setControlProperty("optSenderDefine", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState));
@@ -1090,25 +1137,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
}
- public void lstLetterNormItemChanged()
- {
- //when the norm changes, the correct template needs to be reloaded
- sCurrentNorm = Norms[getCurrentLetter().cp_Norm];
- initializeTemplates(xMSF);
- if (optBusinessLetter.getState())
- {
- lstBusinessStyleItemChanged();
- }
- if (optPrivOfficialLetter.getState())
- {
- lstPrivOfficialStyleItemChanged();
- }
- if (optPrivateLetter.getState())
- {
- lstPrivateStyleItemChanged();
- }
- }
-
public void initializeSalutation()
{
setControlProperty("lstSalutation", PropertyNames.STRING_ITEM_LIST, resources.SalutationLabels);
@@ -1119,124 +1147,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
setControlProperty("lstGreeting", PropertyNames.STRING_ITEM_LIST, resources.GreetingLabels);
}
- public void initializeNorms()
- {
-
- LocaleCodes lc = new LocaleCodes(xmsf);
- String[] allLocales = lc.getIDs();
- Object[] nameList =
- {
- PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING
- };
- String[] nameList2 =
- {
- PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING
- };
- ArrayList<String> allPaths = new ArrayList<String>();
- String sLetterSubPath = "/wizard/letter/";
-
- try
- {
- sTemplatePath = FileAccess.deleteLastSlashfromUrl(sTemplatePath);
- String[] PathParts = sTemplatePath.split("/");
- String nuString = PropertyNames.EMPTY_STRING;
- String sMainPath;
- for (int i = 0; i < (PathParts.length - 1); i++)
- {
- nuString = nuString + PathParts[i] + "/";
- }
- String sLocLetterPath;
- sMainPath = nuString;
- sMainPath = FileAccess.deleteLastSlashfromUrl(sMainPath);
-
- sLetterPath = sMainPath + sLetterSubPath;
-
- XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
- com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface);
- nameList2 = xSimpleFileAccess.getFolderContents(sLetterPath, true);
- for (int i = 0; i < nameList2.length; i++)
- {
- allPaths.add(nameList2[i]);
- }
- nameList = allPaths.toArray();
-
-
- }
- 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();
- }
-
- ArrayList<Strings> StringsVector = new ArrayList<Strings>();
-
- String[] LanguageLabels;
-
- boolean found = false;
- String cIsoCode = PropertyNames.EMPTY_STRING;
- String MSID = PropertyNames.EMPTY_STRING;
- int z = 0;
- for (int i = 0; i < nameList.length; i++)
- {
- found = false;
- cIsoCode = FileAccess.getFilename((String) nameList[i]);
- for (int t = 0; t < allLocales.length; t++)
- {
- String[] aLang = allLocales[t].split(PropertyNames.SEMI_COLON);
- if (cIsoCode.equalsIgnoreCase(aLang[1]))
- {
- MSID = aLang[2];
- found = true;
- t = allLocales.length;
- }
- }
- if (!found)
- {
- for (int t = 0; t < allLocales.length; t++)
- {
- String[] aLang = allLocales[t].split(PropertyNames.SEMI_COLON);
- if (cIsoCode.equalsIgnoreCase(aLang[1].substring(0, 2)))
- {
- MSID = aLang[2];
- found = true;
- t = allLocales.length;
- }
- }
- }
-
- if (found)
- {
- StringsVector.add(new Strings(cIsoCode, (String)nameList[i], lc.getLanguageString(MSID)));
- }
- }
-
- Collections.sort(StringsVector, new Comparator<Strings>() {
- public int compare(Strings a, Strings b) {
- return a.LanguageLabel.compareTo(b.LanguageLabel);
- }
- });
-
- Norms = new String[StringsVector.size()];
- NormPaths = new String[StringsVector.size()];
- LanguageLabels = new String[StringsVector.size()];
-
- for(int i = 0; i<StringsVector.size(); i++) {
- Norms[i] = StringsVector.get(i).Norm;
- NormPaths[i] = StringsVector.get(i).NormPath;
- LanguageLabels[i] = StringsVector.get(i).LanguageLabel;
- }
-
- setControlProperty("lstLetterNorm", PropertyNames.STRING_ITEM_LIST, LanguageLabels);
- }
-
private CGLetter getCurrentLetter()
{
switch (myConfig.cp_LetterType)
@@ -1259,6 +1169,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", PropertyNames.EMPTY_STRING);
sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap");
+ sTemplatePath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../common");
}
catch (NoValidPathException e)
{
@@ -1268,12 +1179,12 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public boolean initializeTemplates(XMultiServiceFactory xMSF)
{
- sCurrentNorm = Norms[getCurrentLetter().cp_Norm];
- //creation of the language independent path:
- String sLetterPath = NormPaths[getCurrentLetter().cp_Norm];
- // try
- // {
+ try
+ {
+ sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
+ String sLetterPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../common/wizard/letter");
+
BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus", sLetterPath);
OfficialFiles = FileAccess.getFolderTitles(xMSF, "off", sLetterPath);
PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri", sLetterPath);
@@ -1294,12 +1205,12 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
0
});
-// }
-// catch (com.sun.star.wizards.common.NoValidPathException e)
-// {
-// return false;
-// }
- return true;
+ }
+ catch (com.sun.star.wizards.common.NoValidPathException e)
+ {
+ return false;
+ }
+ return true;
}
public void initializeElements()
@@ -1442,7 +1353,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
businessDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PaperFooter", chkPaperFooter, null, true));
businessDA.add(UnoDataAware.attachNumericControl(cgl, "cp_PaperFooterHeight", numFooterHeight, null, true));
- letterDA.add(UnoDataAware.attachListBox(cgl, "cp_Norm", lstLetterNorm, null, true));
letterDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintCompanyLogo", chkUseLogo, null, true));
letterDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintCompanyAddressReceiverField", chkUseAddressReceiver, null, true));
letterDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintLetterSigns", chkUseSigns, null, true));
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java
index d2dbae1c6530..586872e26b3f 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java
@@ -96,6 +96,9 @@ public class LetterWizardDialogResources extends Resource
String reslblTitle5_value;
String reslblTitle6_value;
+ String resSubjectconstPlaceHolder = "#subjectconst#";
+ String resSubjectconstPlaceHolder_value;
+
public LetterWizardDialogResources(XMultiServiceFactory xmsf)
{
super(xmsf, UNIT_NAME, MODULE_NAME);
@@ -159,6 +162,8 @@ public class LetterWizardDialogResources extends Resource
reslblTitle5_value = getResText(RID_LETTERWIZARDDIALOG_START + 57);
reslblTitle6_value = getResText(RID_LETTERWIZARDDIALOG_START + 58);
+ resSubjectconstPlaceHolder_value = getResText(RID_LETTERWIZARDDIALOG_START + 59);
+
loadRoadmapResources();
loadSalutationResources();
loadGreetingResources();