User: hr      
Date: 2007-08-03 10:22:26+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx

Log:
 INTEGRATION: CWS rpt23fix02 (1.43.14); FILE MERGED
 2007/07/24 12:45:30 oj 1.43.14.3: merge from rpt23fix01
 2007/07/24 09:49:43 oj 1.43.14.2: #i79794# correct class id for report 
definition
 2007/07/23 11:11:54 lla 1.43.14.1: #i79879# open old reports, if extension not 
present fix

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.45&r2=1.46
Delta lines:  +20 -2
--------------------
--- documentdefinition.cxx      2007-08-02 14:25:26+0000        1.45
+++ documentdefinition.cxx      2007-08-03 10:22:23+0000        1.46
@@ -242,6 +242,10 @@
 #ifndef _COMPHELPER_STORAGEHELPER_HXX
 #include <comphelper/storagehelper.hxx>
 #endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HPP_
+#include <com/sun/star/container/XContentEnumerationAccess.hpp>
+#endif
+#include <com/sun/star/io/WrongFormatException.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::view;
@@ -1298,14 +1302,28 @@
                                else
                                {
                                        sDocumentService = 
GetDocumentServiceFromMediaType(xStorage,m_pImpl->m_aProps.sPersistentName,m_xORB,aClassID);
+                    // check if we are not a form and
+                    // the com.sun.star.report.pentaho.SOReportJobFactory is 
not present.
+                                       if (m_bForm == 0 /* MAGIC! */ && 
!sDocumentService.equalsAscii("com.sun.star.text.TextDocument"))
+                                       {
+                                               // we seems to be a new report, 
check if report extension is present.
+                               Reference< XContentEnumerationAccess > 
xEnumAccess(m_xORB, 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() )
+                                               {
+                                                       
com::sun::star::io::WrongFormatException aWFE;
+                                                       aWFE.Message = 
::rtl::OUString::createFromAscii("Extension not present.");
+                                                       throw aWFE;
+                                               }
+                                       }
                     if ( !aClassID.getLength() )
                     {
                         if ( m_bForm )
                                                    aClassID = 
MimeConfigurationHelper::GetSequenceClassID(SO3_SW_CLASSID);
                                            else
                                                {
-                                                       
::comphelper::MimeConfigurationHelper aConfigHelper(m_xORB);
-                                                       aClassID = 
aConfigHelper.GetSequenceClassIDFromObjectName((::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Report"))));
+                                                       aClassID = 
MimeConfigurationHelper::GetSequenceClassID(SO3_RPT_CLASSID_90);
                                                }
                     }
                                }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to