Tag: cws_src680_rpt23fix01
User: oj      
Date: 2007-07-31 19:01:42+0000
Modified:
   dba/dbaccess/source/ui/app/AppController.cxx

Log:
 reverse issue #i78940#

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.2.1&r2=1.42.2.2
Delta lines:  +28 -14
---------------------
--- AppController.cxx   2007-07-11 11:34:01+0000        1.42.2.1
+++ AppController.cxx   2007-07-31 19:01:40+0000        1.42.2.2
@@ -668,8 +668,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;
@@ -1681,6 +1691,19 @@
                                {
                     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
@@ -1832,15 +1855,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]

Reply via email to