Tag: cws_src680_rpt23fix02 User: oj Date: 2007-07-31 19:41:26+0000 Modified: dba/dbaccess/source/ui/app/AppController.cxx
Log: #i78940# reverse issue File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.42.12.3&r2=1.42.12.4 Delta lines: +36 -11 --------------------- --- AppController.cxx 2007-07-24 12:54:19+0000 1.42.12.3 +++ AppController.cxx 2007-07-31 19:41:23+0000 1.42.12.4 @@ -667,8 +667,18 @@ break; case SID_APP_NEW_REPORT: aReturn.bEnabled = !isDataSourceReadOnly() - && (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SWRITER) - || SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SCALC)); + && SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SWRITER); + if ( aReturn.bEnabled ) + { + Reference< XContentEnumerationAccess > xEnumAccess(m_xServiceFactory, UNO_QUERY); + aReturn.bEnabled = xEnumAccess.is(); + if ( aReturn.bEnabled ) + { + static ::rtl::OUString s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory")); + Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(s_sReportDesign); + aReturn.bEnabled = xEnumDrivers.is() && xEnumDrivers->hasMoreElements(); + } + } break; case SID_DB_APP_VIEW_TABLES: aReturn.bEnabled = sal_True; @@ -1672,6 +1682,30 @@ switch ( _eType ) { case E_REPORT: + { + Reference< XContentEnumerationAccess > xEnumAccess(m_xServiceFactory, UNO_QUERY); + static ::rtl::OUString s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory")); + Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(s_sReportDesign); + if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() ) + { +// OExtensionNotPresentDialog aDlg(getView(), getORB()); + // aDlg.Execute(); + // // is there no report designer available? + static const ::rtl::OUString sStatus = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")); + String sMsg = String( ModuleRes( RID_STR_ERROR_NO_REPORT_INSTALLED ) ); + // // sMsg.SearchAndReplace('#',e.Message); + SQLExceptionInfo aInfo; + // + SQLException aSQLException; + aSQLException.Message = sMsg; + // // aSQLException.Context = e.Context; + aInfo = SQLExceptionInfo(aSQLException); + // + showError(aInfo); + + break; + } + }// run through case E_FORM: { ::std::auto_ptr<OLinkedDocumentsAccess> aHelper = getDocumentsAccess(_eType); @@ -1820,15 +1854,6 @@ break; case E_REPORT: { - Reference< XContentEnumerationAccess > xEnumAccess(m_xServiceFactory, UNO_QUERY); - static ::rtl::OUString s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory")); - Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(s_sReportDesign); - if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() ) - { - OExtensionNotPresentDialog aDlg(getView(), getORB()); - aDlg.Execute(); - break; - } ::std::auto_ptr<OLinkedDocumentsAccess> aHelper = getDocumentsAccess(_eType); Reference< XComponent > xComponent,xDefinition; xComponent = aHelper->newForm(ID_REPORT_NEW_TEXT,xDefinition); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
