Tag: cws_src680_dba24c User: fs Date: 2007-09-20 18:34:08+0000 Modified: dba/dbaccess/source/core/dataaccess/commandcontainer.cxx dba/dbaccess/source/core/dataaccess/definitioncontainer.cxx dba/dbaccess/source/core/dataaccess/documentcontainer.cxx dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
Log: during #i80856#: m_xORB -> m_aContext File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: commandcontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/commandcontainer.cxx?r1=1.14&r2=1.14.142.1 Delta lines: +8 -6 ------------------- --- commandcontainer.cxx 2006-09-17 06:38:31+0000 1.14 +++ commandcontainer.cxx 2007-09-20 18:34:05+0000 1.14.142.1 @@ -4,9 +4,9 @@ * * $RCSfile: commandcontainer.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.142.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 06:38:31 $ + * last change: $Author: fs $ $Date: 2007/09/20 18:34:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -92,9 +92,11 @@ { const ODefinitionContainer_Impl& rDefinitions( getDefinitions() ); OSL_ENSURE( rDefinitions.find(_rName) != rDefinitions.end(), "OCommandContainer::createObject: Invalid entry in map!" ); + + const TContentPtr& pElementContent( rDefinitions.find( _rName )->second ); if ( m_bTables ) - return new OComponentDefinition( *this, _rName, m_xORB, rDefinitions.find( _rName )->second, m_bTables ); - return new OCommandDefinition( *this, _rName, m_xORB, rDefinitions.find( _rName )->second ); + return new OComponentDefinition( *this, _rName, m_aContext.getLegacyServiceFactory(), pElementContent, m_bTables ); + return new OCommandDefinition( *this, _rName, m_aContext.getLegacyServiceFactory(), pElementContent ); } // ----------------------------------------------------------------------------- @@ -106,7 +108,7 @@ // ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OCommandContainer::createInstance( ) throw (Exception, RuntimeException) { - return m_xORB->createInstance(m_bTables ? SERVICE_SDB_TABLEDEFINITION : SERVICE_SDB_COMMAND_DEFINITION); + return m_aContext.createComponent( (::rtl::OUString)( m_bTables ? SERVICE_SDB_TABLEDEFINITION : SERVICE_SDB_COMMAND_DEFINITION ) ); } //........................................................................ File [changed]: definitioncontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/definitioncontainer.cxx?r1=1.24&r2=1.24.58.1 Delta lines: +8 -4 ------------------- --- definitioncontainer.cxx 2007-05-10 10:12:32+0000 1.24 +++ definitioncontainer.cxx 2007-09-20 18:34:05+0000 1.24.58.1 @@ -4,9 +4,9 @@ * * $RCSfile: definitioncontainer.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.24.58.1 $ * - * last change: $Author: kz $ $Date: 2007/05/10 10:12:32 $ + * last change: $Author: fs $ $Date: 2007/09/20 18:34:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -73,6 +73,9 @@ #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif +#ifndef _COM_SUN_STAR_SDB_ERRORCONDITION_HPP_ +#include <com/sun/star/sdb/ErrorCondition.hpp> +#endif #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif @@ -87,6 +90,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::sdb; using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; @@ -645,7 +649,7 @@ if ( _sName.indexOf( '/' ) != -1 ) throw IllegalArgumentException( - DBA_RES( RID_STR_NO_SLASH_IN_OBJECT_NAME ), + m_aErrorHelper.getErrorMessage( ErrorCondition::DB_OBJECT_NAME_WITH_SLASHES ), *this, 0 ); File [changed]: documentcontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.24&r2=1.24.40.1 Delta lines: +30 -14 --------------------- --- documentcontainer.cxx 2007-07-06 07:53:39+0000 1.24 +++ documentcontainer.cxx 2007-09-20 18:34:05+0000 1.24.40.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentcontainer.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.24.40.1 $ * - * last change: $Author: rt $ $Date: 2007/07/06 07:53:39 $ + * last change: $Author: fs $ $Date: 2007/09/20 18:34:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -72,12 +72,18 @@ #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> #endif +#ifndef _COM_SUN_STAR_SDB_ERRORCONDITION_HPP_ +#include <com/sun/star/sdb/ErrorCondition.hpp> +#endif #ifndef _DBA_COREDATAACCESS_DATASOURCE_HXX_ #include "datasource.hxx" #endif #ifndef _COMPHELPER_MIMECONFIGHELPER_HXX_ #include <comphelper/mimeconfighelper.hxx> #endif +#ifndef CONNECTIVITY_SQLERROR_HXX +#include <connectivity/sqlerror.hxx> +#endif #ifndef _SO_CLSIDS_HXX #include <so3/clsids.hxx> #endif @@ -89,6 +95,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::io; using namespace ::osl; using namespace ::comphelper; @@ -104,8 +111,17 @@ //========================================================================== class LocalNameApproval : public IContainerApprove { + ::connectivity::SQLError m_aErrors; + public: - LocalNameApproval() { } + LocalNameApproval( const Reference< XMultiServiceFactory >& _rxFactory ) + :m_aErrors( ::comphelper::ComponentContext( _rxFactory ) ) + { + } + virtual ~LocalNameApproval() + { + } + void SAL_CALL approveElement( const ::rtl::OUString& _rName, const Reference< XInterface >& _rxElement ); }; @@ -114,10 +130,10 @@ { if ( _rName.indexOf( '/' ) != -1 ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The name must not contain any / characters." ) ), + m_aErrors.getErrorMessage( ErrorCondition::DB_OBJECT_NAME_WITH_SLASHES ), NULL, - 0 ); - // TODO: resource + 0 + ); } //========================================================================== @@ -138,7 +154,7 @@ registerProperty(PROPERTY_NAME, PROPERTY_ID_NAME, PropertyAttribute::BOUND | PropertyAttribute::READONLY | PropertyAttribute::CONSTRAINED, &m_pImpl->m_aProps.aTitle, ::getCppuType(&m_pImpl->m_aProps.aTitle)); - setElementApproval( PContainerApprove( new LocalNameApproval ) ); + setElementApproval( PContainerApprove( new LocalNameApproval ( _xORB ) ) ); } //-------------------------------------------------------------------------- @@ -173,8 +189,8 @@ ODefinitionContainer_Impl::const_iterator aFind = rDefinitions.find( _rName ); OSL_ENSURE( aFind != rDefinitions.end(), "ODocumentContainer::createObject:Invalid entry in map!" ); if ( aFind->second->m_aProps.bIsFolder ) - return new ODocumentContainer( m_xORB, *this, aFind->second, m_bFormsContainer ); - return new ODocumentDefinition( *this, m_xORB, aFind->second, m_bFormsContainer ); + return new ODocumentContainer( m_aContext.getLegacyServiceFactory(), *this, aFind->second, m_bFormsContainer ); + return new ODocumentDefinition( *this, m_aContext.getLegacyServiceFactory(), aFind->second, m_bFormsContainer ); } // ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODocumentContainer::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (Exception, RuntimeException) @@ -261,7 +277,7 @@ } if ( ( aClassID.getLength() == 0 ) && ( 0 == sURL.getLength() ) ) - ODocumentDefinition::GetDocumentServiceFromMediaType(getStorage(),sPersistentName,m_xORB,aClassID); + ODocumentDefinition::GetDocumentServiceFromMediaType( getStorage(), sPersistentName, m_aContext.getLegacyServiceFactory(), aClassID ); } ODefinitionContainer_Impl::const_iterator aFind = rDefinitions.find( sName ); @@ -279,7 +295,7 @@ else pElementImpl = aFind->second; - xContent = new ODocumentDefinition(*this, m_xORB,pElementImpl,m_bFormsContainer,aClassID,xConnection); + xContent = new ODocumentDefinition( *this, m_aContext.getLegacyServiceFactory(), pElementImpl, m_bFormsContainer, aClassID, xConnection ); if ( sURL.getLength() ) { @@ -329,7 +345,7 @@ else pElementImpl = aFind->second; OSL_ENSURE( pElementImpl ," Invalid entry in map!"); - xContent = new ODocumentContainer(m_xORB,*this,pElementImpl,ServiceSpecifier == SERVICE_NAME_FORM_COLLECTION); + xContent = new ODocumentContainer( m_aContext.getLegacyServiceFactory(), *this, pElementImpl, ServiceSpecifier == SERVICE_NAME_FORM_COLLECTION ); // copy children if ( xCopyFrom.is() ) @@ -420,7 +436,7 @@ // open as folder - return result set Reference< XDynamicResultSet > xSet - = new DynamicResultSet( m_xORB, + = new DynamicResultSet( m_aContext.getLegacyServiceFactory(), this, aOpenCommand, Environment ); File [changed]: documentdefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.46&r2=1.46.20.1 Delta lines: +16 -16 --------------------- --- documentdefinition.cxx 2007-08-03 10:22:23+0000 1.46 +++ documentdefinition.cxx 2007-09-20 18:34:05+0000 1.46.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentdefinition.cxx,v $ * - * $Revision: 1.46 $ + * $Revision: 1.46.20.1 $ * - * last change: $Author: hr $ $Date: 2007/08/03 10:22:23 $ + * last change: $Author: fs $ $Date: 2007/09/20 18:34:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -164,6 +164,9 @@ #ifndef DBA_INTERCEPT_HXX #include "intercept.hxx" #endif +#ifndef _COM_SUN_STAR_SDB_ERRORCONDITION_HPP_ +#include <com/sun/star/sdb/ErrorCondition.hpp> +#endif #ifndef _COM_SUN_STAR_SDB_XINTERACTIONDOCUMENTSAVE_HPP_ #include <com/sun/star/sdb/XInteractionDocumentSave.hpp> #endif @@ -655,7 +658,7 @@ void ODocumentDefinition::impl_removeFrameFromDesktop_throw( const Reference< XFrame >& _rxFrame ) { if ( !m_xDesktop.is() ) - m_xDesktop.set( m_xORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); + m_xDesktop.set( m_aContext.createComponent( (::rtl::OUString)SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); Reference< XFrames > xFrames( m_xDesktop->getFrames(), UNO_QUERY_THROW ); xFrames->remove( _rxFrame ); @@ -915,7 +918,7 @@ { // we are in ReadOnly mode // we would like to open the Writer or Calc with the report direct, without design it. - Reference< report::XReportEngine> xReportEngine( m_xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OReportEngineJFree"))) ,UNO_QUERY); + Reference< report::XReportEngine > xReportEngine( m_aContext.createComponent( "com.sun.star.comp.report.OReportEngineJFree" ), UNO_QUERY_THROW ); xReportEngine->setReportDefinition(xReportDefinition); xReportEngine->setActiveConnection(m_xLastKnownConnection); @@ -1081,7 +1084,7 @@ Reference< XStorage> xStorage = getStorage(); if ( xStorage.is() ) { - Reference< XEmbedObjectCreator> xEmbedFactory( m_xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.EmbeddedObjectCreator"))) ,UNO_QUERY); + Reference< XEmbedObjectCreator> xEmbedFactory( m_aContext.createComponent( "com.sun.star.embed.EmbeddedObjectCreator" ), UNO_QUERY ); if ( xEmbedFactory.is() ) { Sequence<PropertyValue> aEmpty,aMediaDesc(1); @@ -1171,7 +1174,7 @@ pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler(m_xORB->createInstance(SERVICE_SDB_INTERACTION_HANDLER), UNO_QUERY); + Reference< XInteractionHandler > xHandler( m_aContext.createComponent( (::rtl::OUString)SERVICE_SDB_INTERACTION_HANDLER ), UNO_QUERY ); if ( xHandler.is() ) xHandler->handle(xRequest); @@ -1287,7 +1290,7 @@ Reference< XStorage> xStorage = getStorage(); if ( xStorage.is() ) { - Reference< XEmbedObjectFactory> xEmbedFactory( m_xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OOoEmbeddedObjectFactory"))) ,UNO_QUERY); + Reference< XEmbedObjectFactory> xEmbedFactory( m_aContext.createComponent( "com.sun.star.embed.OOoEmbeddedObjectFactory" ), UNO_QUERY ); if ( xEmbedFactory.is() ) { ::rtl::OUString sDocumentService; @@ -1301,13 +1304,13 @@ } else { - sDocumentService = GetDocumentServiceFromMediaType(xStorage,m_pImpl->m_aProps.sPersistentName,m_xORB,aClassID); + sDocumentService = GetDocumentServiceFromMediaType( xStorage, m_pImpl->m_aProps.sPersistentName, m_aContext.getLegacyServiceFactory(), 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); + Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), 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() ) @@ -1501,13 +1504,10 @@ if ( _rNewName.equals( m_pImpl->m_aProps.aTitle ) ) return; - // document definitions are organized in a hierarchicalway, so reject names + // document definitions are organized in a hierarchical way, so reject names // which contain a /, as this is reserved for hierarchy level separation if ( _rNewName.indexOf( '/' ) != -1 ) - { - ::dbtools::throwGenericSQLException( - DBA_RES( RID_STR_NO_SLASH_IN_OBJECT_NAME ), *this ); - } + m_aErrorHelper.raiseException( ErrorCondition::DB_OBJECT_NAME_WITH_SLASHES, *this ); sal_Int32 nHandle = PROPERTY_ID_NAME; Any aOld = makeAny( m_pImpl->m_aProps.aTitle ); @@ -1604,7 +1604,7 @@ aValue.Value <<= m_xLastKnownConnection; aArgs[1] <<= aValue; - Reference< XJobExecutor > xExecuteable(m_xORB->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.wizards.report.CallReportWizard")),aArgs),UNO_QUERY); + Reference< XJobExecutor > xExecuteable( m_aContext.createComponentWithArguments( "com.sun.star.wizards.report.CallReportWizard", aArgs ), UNO_QUERY ); if ( xExecuteable.is() ) xExecuteable->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fill"))); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
