diff options
Diffstat (limited to 'wizards/com/sun/star/wizards/report/ReportFinalizer.java')
-rw-r--r-- | wizards/com/sun/star/wizards/report/ReportFinalizer.java | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java index 8c0df7c36c5c..9ffb89b768f5 100644 --- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java +++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java @@ -244,8 +244,9 @@ public class ReportFinalizer public void changeReportTitle() { - String TitleName = xTitleTextBox.getText(); + final String TitleName = xTitleTextBox.getText(); CurReportDocument.liveupdate_updateReportTitle(TitleName); + CurUnoDialog.enableFinishButton(!"".equals(TitleName)); } public int getReportOpenMode() @@ -272,18 +273,25 @@ public class ReportFinalizer public boolean finish() { StoreName = getStoreName(); - if (CurReportDocument.getRecordParser().getReportDocuments().hasByHierarchicalName(StoreName)) + if (!CurReportDocument.getRecordParser().getReportDocuments().hasByHierarchicalName(StoreName)) { - String sMsgReportDocumentNameDuplicate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_REPORT + 76); - String sShowMsgReportNameisDuplicate = JavaTools.replaceSubString(sMsgReportDocumentNameDuplicate, StoreName, "%REPORTNAME"); - /* int iMsg = */ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sShowMsgReportNameisDuplicate); - return false; - } - else - { - CurReportDocument.store(StoreName, getReportOpenMode()); - ReportWizard.bCloseDocument = false; - return true; + try + { + CurReportDocument.store(StoreName, getReportOpenMode()); + ReportWizard.bCloseDocument = false; + return true; + } + catch(Exception e) + { + CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK,e.getLocalizedMessage() ); + CurUnoDialog.enableFinishButton(false); + return false; + } } + String sMsgReportDocumentNameDuplicate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_REPORT + 76); + String sShowMsgReportNameisDuplicate = JavaTools.replaceSubString(sMsgReportDocumentNameDuplicate, StoreName, "%REPORTNAME"); + /* int iMsg = */ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sShowMsgReportNameisDuplicate); + CurUnoDialog.enableFinishButton(false); + return false; } } |