Tag: cws_src680_rpt23fix02 User: lla Date: 2007-07-23 11:11:57+0000 Modified: dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
Log: #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.43&r2=1.43.14.1 Delta lines: +22 -3 -------------------- --- documentdefinition.cxx 2007-07-06 07:54:16+0000 1.43 +++ documentdefinition.cxx 2007-07-23 11:11:54+0000 1.43.14.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentdefinition.cxx,v $ * - * $Revision: 1.43 $ + * $Revision: 1.43.14.1 $ * - * last change: $Author: rt $ $Date: 2007/07/06 07:54:16 $ + * last change: $Author: lla $ $Date: 2007/07/23 11:11:54 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -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; @@ -1308,6 +1312,21 @@ 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 ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
