Tag: cws_src680_dba202a User: fs Date: 05/11/01 01:03:20 Modified: /dba/dbaccess/source/core/dataaccess/ documentcontainer.cxx, documentdefinition.cxx, documentdefinition.hxx
Log: #i57097# +getDefaultDocumentTypeClassId File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: documentcontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.15&r2=1.15.24.1 Delta lines: +12 -6 -------------------- --- documentcontainer.cxx 23 Sep 2005 12:06:11 -0000 1.15 +++ documentcontainer.cxx 1 Nov 2005 09:03:15 -0000 1.15.24.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentcontainer.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.15.24.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:06:11 $ + * last change: $Author: fs $ $Date: 2005/11/01 09:03:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -203,8 +203,8 @@ ODefinitionContainer_Impl* pItem = static_cast<ODefinitionContainer_Impl*>(m_pImpl.get()); - sal_Bool bNew; - if ( bNew = (0 == sPersistentName.getLength()) ) + sal_Bool bNew = ( 0 == sPersistentName.getLength() ); + if ( bNew ) { const static ::rtl::OUString sBaseName(RTL_CONSTASCII_USTRINGPARAM("Obj")); // ----------------------------------------------------------------------------- @@ -213,6 +213,7 @@ Reference<XNameAccess> xElements(getStorage(),UNO_QUERY); if ( xElements.is() ) sPersistentName = ::dbtools::createUniqueName(xElements,sPersistentName); + if ( xCopyFrom.is() ) { Sequence<Any> aIni(2); @@ -227,6 +228,11 @@ if ( xProp.is() && xProp->getPropertySetInfo().is() && xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_AS_TEMPLATE) ) xProp->getPropertyValue(PROPERTY_AS_TEMPLATE) >>= bAsTemplate; } + + if ( aClassID.getLength() == 0 ) + // default the class id, if none is given + // #i57097# / 2005-11-01 / [EMAIL PROTECTED] + aClassID = ODocumentDefinition::getDefaultDocumentTypeClassId(); } ODefinitionContainer_Impl::Documents::iterator aFind = pItem->m_aDocumentMap.find(sName); File [changed]: documentdefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.29&r2=1.29.22.1 Delta lines: +14 -43 --------------------- --- documentdefinition.cxx 23 Sep 2005 12:06:25 -0000 1.29 +++ documentdefinition.cxx 1 Nov 2005 09:03:16 -0000 1.29.22.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentdefinition.cxx,v $ * - * $Revision: 1.29 $ + * $Revision: 1.29.22.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:06:25 $ + * last change: $Author: fs $ $Date: 2005/11/01 09:03:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -307,28 +307,19 @@ virtual void SAL_CALL saveObject( ) throw (ObjectSaveVetoException, Exception, RuntimeException) { - if ( m_pClient ) - m_pClient->saveObject(); } virtual void SAL_CALL onShowWindow( sal_Bool bVisible ) throw (RuntimeException) { - if ( m_pClient ) - m_pClient->onShowWindow(bVisible); } // XComponentSupplier virtual Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent( ) throw (RuntimeException) { - Reference< ::com::sun::star::util::XCloseable > xRet; - // if ( m_pClient ) - // xRet = m_pClient->getComponent(); - return xRet; + return Reference< css::util::XCloseable >(); } // XEmbeddedClient virtual void SAL_CALL visibilityChanged( ::sal_Bool bVisible ) throw (WrongStateException, RuntimeException) { - if ( m_pClient ) - m_pClient->visibilityChanged( bVisible ); } inline void resetClient(ODocumentDefinition* _pClient) { m_pClient = _pClient; } }; @@ -908,10 +899,6 @@ // inserted(); } // ----------------------------------------------------------------------------- -void SAL_CALL ODocumentDefinition::saveObject( ) throw (ObjectSaveVetoException, Exception, RuntimeException) -{ -} -// ----------------------------------------------------------------------------- sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) { // default handling: instantiate an interaction handler and let it handle the parameter request @@ -1047,6 +1034,12 @@ _rEmbeddedObjectDescriptor[nLen++].Value <<= xInterceptor; } // ----------------------------------------------------------------------------- +Sequence< sal_Int8 > ODocumentDefinition::getDefaultDocumentTypeClassId() +{ + return lcl_GetSequenceClassID( SO3_SW_CLASSID ); +} + +// ----------------------------------------------------------------------------- void ODocumentDefinition::loadEmbeddedObject(const Sequence< sal_Int8 >& _aClassID,const Reference<XConnection>& _xConnection,sal_Bool _bReadOnly) { if ( !m_xEmbeddedObject.is() ) @@ -1068,7 +1061,7 @@ } else { - aClassID = lcl_GetSequenceClassID(SO3_SW_CLASSID); + aClassID = getDefaultDocumentTypeClassId(); sDocumentService = lcl_GetDocumentServiceFromMediaType(xStorage,m_pImpl->m_aProps.sPersistentName); } @@ -1108,7 +1101,10 @@ else if ( m_xEmbeddedObject->getCurrentState() == EmbedStates::LOADED ) { if ( !m_pClientHelper ) + { m_pClientHelper = new OEmbeddedClientHelper(this); + m_pClientHelper->acquire(); + } Reference<XEmbeddedClient> xClient = m_pClientHelper; m_xEmbeddedObject->setClientSite(xClient); @@ -1162,11 +1158,6 @@ } } // ----------------------------------------------------------------------------- -void SAL_CALL ODocumentDefinition::onShowWindow( sal_Bool bVisible ) throw (RuntimeException) -{ - ::osl::MutexGuard aGuard(m_aMutex); -} -// ----------------------------------------------------------------------------- void ODocumentDefinition::generateNewImage(Any& _rImage) { loadEmbeddedObject( Sequence< sal_Int8 >(), Reference< XConnection >(), sal_True ); @@ -1238,26 +1229,6 @@ } } return xComp; -} -// ----------------------------------------------------------------------------- -void SAL_CALL ODocumentDefinition::visibilityChanged( ::sal_Bool bVisible ) throw (WrongStateException, RuntimeException) -{ -// ::osl::MutexGuard aGuard(m_aMutex); -// if ( m_xEmbeddedObject.is() && !bVisible ) -// { -// try -// { -// Reference< com::sun::star::util::XCloseable> xCloseable(m_xEmbeddedObject,UNO_QUERY); -// if ( xCloseable.is() ) -// xCloseable->close(sal_True); -// } -// catch(Exception) -// { -// } -// m_xEmbeddedObject = NULL; -// if ( m_pClientHelper ) -// m_pClientHelper->resetClient(NULL); -// } } // ----------------------------------------------------------------------------- void SAL_CALL ODocumentDefinition::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) File [changed]: documentdefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.14&r2=1.14.24.1 Delta lines: +9 -16 -------------------- --- documentdefinition.hxx 23 Sep 2005 12:06:40 -0000 1.14 +++ documentdefinition.hxx 1 Nov 2005 09:03:17 -0000 1.14.24.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentdefinition.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.24.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:06:40 $ + * last change: $Author: fs $ $Date: 2005/11/01 09:03:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -60,9 +60,6 @@ #ifndef _COMPHELPER_UNO3_HXX_ #include <comphelper/uno3.hxx> #endif -#ifndef _COM_SUN_STAR_EMBED_XEMBEDDEDCLIENT_HPP_ -#include <com/sun/star/embed/XEmbeddedClient.hpp> -#endif #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ #include <com/sun/star/sdbc/XConnection.hpp> #endif @@ -78,9 +75,6 @@ { //........................................................................ - typedef ::cppu::ImplHelper1< ::com::sun::star::embed::XEmbeddedClient - > ODocumentDefinition_Base; - class OInterceptor; class OEmbeddedClientHelper; //========================================================================== @@ -88,6 +82,9 @@ //= document //========================================================================== + typedef ::cppu::ImplHelper1< ::com::sun::star::embed::XComponentSupplier + > ODocumentDefinition_Base; + class ODocumentDefinition :public OContentHelper ,public ::comphelper::OPropertyStateContainer @@ -165,18 +162,12 @@ // XComponentSupplier virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL visibilityChanged( ::sal_Bool bVisible ) throw (::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::RuntimeException); - // OPropertySetHelper virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XCommandProcessor virtual ::com::sun::star::uno::Any SAL_CALL execute( const ::com::sun::star::ucb::Command& aCommand, sal_Int32 CommandId, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& Environment ) throw (::com::sun::star::uno::Exception, ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException) ; - // XEmbeddedClient - virtual void SAL_CALL saveObject( ) throw (::com::sun::star::embed::ObjectSaveVetoException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL onShowWindow( sal_Bool bVisible ) throw (::com::sun::star::uno::RuntimeException); - // XRename virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException); @@ -196,6 +187,8 @@ <TRUE/> if and only if the document component can be closed */ bool prepareClose(); + + static ::com::sun::star::uno::Sequence< sal_Int8 > getDefaultDocumentTypeClassId(); protected: // OPropertyArrayUsageHelper --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
