diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2012-07-17 14:04:22 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-18 09:29:19 +0100 |
commit | d97caa2a77bcd42cb67eba659f7a79baf8ac0cfc (patch) | |
tree | 535bfdedfecc6ffefbdb2c6605531ece95a24b37 /wizards | |
parent | ff6c2e7828d4d8901eab80a4a784362286900766 (diff) |
fs34b: #i117454# don't ask for the value of the possibly
non-existent 'Sorting' HiddenControl
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/document/FormHandler.java | 27 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/report/ReportTextImplementation.java | 41 |
2 files changed, 21 insertions, 47 deletions
diff --git a/wizards/com/sun/star/wizards/document/FormHandler.java b/wizards/com/sun/star/wizards/document/FormHandler.java index 6aeec8b819f5..224a6c1a5ced 100644 --- a/wizards/com/sun/star/wizards/document/FormHandler.java +++ b/wizards/com/sun/star/wizards/document/FormHandler.java @@ -219,23 +219,21 @@ public class FormHandler return xFormsSupplier.getForms(); } - public String getValueofHiddenControl(XNameAccess xNamedForm, String ControlName, String sMsg) throws com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException + public String getValueofHiddenControl(XNameAccess xNamedForm, String ControlName) { + String value = ""; try { if (xNamedForm.hasByName(ControlName)) { - return AnyConverter.toString(com.sun.star.wizards.common.Helper.getUnoPropertyValue(xNamedForm.getByName(ControlName), "HiddenValue")); - } - else - { - throw new UnknownHiddenControlException(xNamedForm, ControlName, sMsg); + value = AnyConverter.toString(com.sun.star.wizards.common.Helper.getUnoPropertyValue(xNamedForm.getByName(ControlName), "HiddenValue")); } } - catch (Exception exception) + catch (Exception ex) { - throw new UnknownHiddenControlException(xNamedForm, ControlName, sMsg); + Logger.getLogger( FormHandler.class.getName() ).log( Level.SEVERE, null, ex ); } + return value; } public void insertHiddenControl(XNameAccess xNameAccess, XNameContainer xNamedForm, String ControlName, String ControlValue) @@ -260,19 +258,6 @@ public class FormHandler } } - public class UnknownHiddenControlException extends java.lang.Throwable - { - - public UnknownHiddenControlException(XNameAccess xNamedForm, String ControlName, String sMsgHiddenControlisMissing) - { - XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, xNamedForm); - String FormName = xNamed.getName(); - sMsgHiddenControlisMissing = JavaTools.replaceSubString(sMsgHiddenControlisMissing, FormName, "<REPORTFORM>"); - sMsgHiddenControlisMissing = JavaTools.replaceSubString(sMsgHiddenControlisMissing, ControlName, "<CONTROLNAME>"); - SystemDialog.showMessageBox(xMSFDoc, "ErrorBox", VclWindowPeerAttribute.OK, sMsgHiddenControlisMissing); - } - } - public boolean hasFormByName(String _FormName) { xNamedFormContainer = getDocumentForms(); diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java index 66113172b268..2385ed5e5ace 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java +++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java @@ -56,7 +56,6 @@ import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.SystemDialog; import com.sun.star.wizards.db.DBMetaData; import com.sun.star.wizards.document.OfficeDocument; -import com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException; import com.sun.star.wizards.ui.UIConsts; import java.util.ArrayList; import java.util.Vector; @@ -224,32 +223,27 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme XNameContainer xNamedForms = getDoc().oFormHandler.getDocumentForms(); Object oDBForm = Helper.getUnoObjectbyName(xNamedForms, ReportWizard.SOREPORTFORMNAME); boolean bgetConnection; - String sQueryName = PropertyNames.EMPTY_STRING; if (oDBForm != null) { String sMsg = sMsgHiddenControlMissing + (char) 13 + sMsgEndAutopilot; XNameAccess xNamedForm = UnoRuntime.queryInterface( XNameAccess.class, oDBForm ); - getRecordParser().Command = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND, sMsg); - String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND_TYPE, sMsg); - String sGroupFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames", sMsg); - String sFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "FieldNames", sMsg); - String sorting; - try - { - sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Sorting", sMsg); - } - catch (UnknownHiddenControlException exception) - { - sorting = ""; - } - String sRecordFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames", sMsg); - if (xNamedForm.hasByName("QueryName")) - { - sQueryName = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "QueryName", sMsg); - } + getRecordParser().Command = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND); + String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND_TYPE); + String sGroupFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames"); + String sFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "FieldNames"); + String sRecordFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames"); + + String sorting = PropertyNames.EMPTY_STRING; + if ( xNamedForm.hasByName( "Sorting" ) ) + sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Sorting"); + + String sQueryName = PropertyNames.EMPTY_STRING; + if ( xNamedForm.hasByName( "QueryName" ) ) + sQueryName = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "QueryName"); + String[] sFieldNameList = JavaTools.ArrayoutofString(sFieldNames, PropertyNames.SEMI_COLON); String[] sNewList = JavaTools.ArrayoutofString(sRecordFieldNames, PropertyNames.SEMI_COLON); - if ( !PropertyNames.EMPTY_STRING.equals(sorting)) + if ( sorting.length() > 0) { String[] sortList = JavaTools.ArrayoutofString(sorting, PropertyNames.SEMI_COLON); ArrayList<String[]> aSortFields = new ArrayList<String[]>(); @@ -331,11 +325,6 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); return false; } - catch (com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException ex) - { - Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); - return false; - } } private boolean m_bStopProcess; |