summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/letter
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-10-04 19:09:46 +0000
committerKurt Zenker <kz@openoffice.org>2006-10-04 19:09:46 +0000
commit901c6485089cc1c413249275b04da0d5c6d8d8ae (patch)
tree6d2f0110ae4734f4327e81945e455b7fb97687fc /wizards/com/sun/star/wizards/letter
parent15bb8bb7899b560ca4fbc9338ae5bf4dbe0a2ccf (diff)
INTEGRATION: CWS qwizardspp4 (1.15.36); FILE MERGED
2006/09/25 14:26:15 tv 1.15.36.7: #64878# kill empty frames only when it's a business letter Issue number: Submitted by: Reviewed by: 2006/08/23 13:37:40 tv 1.15.36.6: #i57079# remove not needed frames when creating wizard 2006/07/25 14:16:54 tv 1.15.36.5: RESYNC: (1.15-1.16); FILE MERGED 2006/07/18 16:04:20 tv 1.15.36.4: #i57079# kill another empty frame when finishing 2006/07/18 14:45:23 tv 1.15.36.3: #i64878# fixed wrong behaviour when switching from Business to private official. Sender data could not be entered. 2006/07/17 15:52:23 tv 1.15.36.2: #i38801# #i42034# Writer Wizards can now be closed with ESC and closer 2006/07/17 12:19:52 tv 1.15.36.1: #i63477# fall back to English if language is not supported
Diffstat (limited to 'wizards/com/sun/star/wizards/letter')
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java48
1 files changed, 37 insertions, 11 deletions
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
index b854c68762ca..47068fa081b7 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
@@ -183,20 +183,22 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
//disable the document, so that the user cannot change anything:
myLetterDoc.xFrame.getComponentWindow().setEnable(false);
- //show the Wizard dialog:
- xWindow.setVisible(true);
+ executeDialog(myLetterDoc.xFrame);
+ removeTerminateListener();
+ closeDocument();
+ running = false;
} catch (Exception exception) {
removeTerminateListener();
exception.printStackTrace(System.out);
+ running=false;
+ return;
}
}
public void cancelWizard() {
- xWindow.setVisible(false);
- closeDocument();
- removeTerminateListener();
+ xDialog.endExecute();
running = false;
}
@@ -225,8 +227,22 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
myLetterDoc.setWizardTemplateDocInfo(resources.resLetterWizardDialog_title, resources.resTemplateDescription);
myLetterDoc.killEmptyUserFields();
myLetterDoc.keepLogoFrame = (chkUseLogo.getState() != 0);
+ if ((chkBusinessPaper.getState() != 0) && (chkPaperCompanyLogo.getState() !=0)) {
+ myLetterDoc.keepLogoFrame = false;
+ }
myLetterDoc.keepBendMarksFrame = (chkUseBendMarks.getState() != 0);
myLetterDoc.keepLetterSignsFrame = (chkUseSigns.getState() != 0);
+ myLetterDoc.keepSenderAddressRepeatedFrame = (chkUseAddressReceiver.getState() != 0);
+
+ if (optBusinessLetter.getState()) {
+ if ((chkBusinessPaper.getState() != 0) && (chkCompanyReceiver.getState() !=0)) {
+ myLetterDoc.keepSenderAddressRepeatedFrame = false;
+ }
+ if ((chkBusinessPaper.getState() != 0) && (chkPaperCompanyAddress.getState() !=0)) {
+ myLetterDoc.keepAddressFrame = false;
+ }
+ }
+
myLetterDoc.killEmptyFrames();
@@ -234,9 +250,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
if (bSaveSuccess) {
saveConfiguration();
- xWindow.setVisible(false);
- closeDocument();
- //myLetterDoc.xTextDocument.unlockControllers();
XInteractionHandler xIH = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler"));
PropertyValue loadValues[] = new PropertyValue[4];
loadValues[0] = new PropertyValue();
@@ -251,7 +264,6 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
loadValues[3].Name = "InteractionHandler";
loadValues[3].Value = xIH;
-
if (bEditTemplate) {
loadValues[0].Value = Boolean.FALSE;
} else {
@@ -269,7 +281,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
e.printStackTrace();
}
finally {
- removeTerminateListener();
+ xDialog.endExecute();
running = false;
}
@@ -277,7 +289,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
public void closeDocument() {
try {
- xComponent.dispose();
+ //xComponent.dispose();
XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, myLetterDoc.xFrame);
xCloseable.close(false);
} catch (CloseVetoException e) {
@@ -390,6 +402,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog {
xTextDocument = myLetterDoc.loadAsPreview(OfficialFiles[1][lstPrivOfficialStyle.getSelectedItemPos()] , false );
myLetterDoc.xTextDocument.lockControllers();
initializeElements();
+ setPossibleSenderData(true);
setElements(false);
myLetterDoc.xTextDocument.unlockControllers();
activate();
@@ -772,10 +785,23 @@ 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;