Tag: cws_src680_dba28 User: fs Date: 05/03/21 06:35:35 Modified: /dba/dbaccess/source/core/dataaccess/ ContentHelper.cxx, ModelImpl.cxx, ModelImpl.hxx, databasedocument.cxx, databasedocument.hxx, datasource.cxx, definitioncontainer.cxx, documentcontainer.cxx, documentdefinition.cxx, documentdefinition.hxx /dba/dbaccess/source/core/inc/ ContentHelper.hxx /dba/dbaccess/source/filter/migration/ cfgimport.cxx, cfgimport.hxx /dba/dbaccess/source/filter/xml/ dbloader2.cxx /dba/dbaccess/source/ui/dlg/ AutoControls_tmpl.hrc, indexdialog.cxx /dba/dbaccess/source/ui/inc/ JoinController.hxx /dba/dbaccess/source/ui/querydesign/ JoinController.cxx, JoinDesignView.cxx
Log: copying the changes from CWS dba26 herein, since they're needed to fix i45314 File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: ContentHelper.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ContentHelper.cxx?r1=1.3&r2=1.3.66.1 Delta lines: +19 -8 -------------------- --- ContentHelper.cxx 16 Nov 2004 09:27:28 -0000 1.3 +++ ContentHelper.cxx 21 Mar 2005 14:35:25 -0000 1.3.66.1 @@ -2,9 +2,9 @@ * * $RCSfile: ContentHelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.66.1 $ * - * last change: $Author: obo $ $Date: 2004/11/16 09:27:28 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -441,13 +441,21 @@ { aEvent.PropertyName = rValue.Name; aEvent.OldValue = makeAny( m_pImpl->m_aProps.aTitle ); - aEvent.NewValue = makeAny( aNewValue ); - aChanges.getArray()[ nChanged ] = aEvent; + try + { + rename( aNewValue ); + OSL_ENSURE( m_pImpl->m_aProps.aTitle == aNewValue, "OContentHelper::setPropertyValues('Title'): rename did not work!" ); - m_pImpl->m_aProps.aTitle = aNewValue; + aEvent.NewValue = makeAny( aNewValue ); + aChanges.getArray()[ nChanged ] = aEvent; nChanged++; } + catch( const Exception& ) + { + OSL_ENSURE( sal_False, "OContentHelper::setPropertyValues('Title'): caught an exception while renaming!" ); + } + } else { // Old value equals new value. No error! @@ -680,6 +688,9 @@ void SAL_CALL OContentHelper::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); + if ( newName.equals( m_pImpl->m_aProps.aTitle ) ) + return; + Reference<XNameContainer> xNameCont(m_xParentContainer,UNO_QUERY); if ( xNameCont.is() ) { File [changed]: ModelImpl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.cxx?r1=1.2&r2=1.2.8.1 Delta lines: +18 -8 -------------------- --- ModelImpl.cxx 10 Mar 2005 16:32:40 -0000 1.2 +++ ModelImpl.cxx 21 Mar 2005 14:35:25 -0000 1.2.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: ModelImpl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.8.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:32:40 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -449,16 +449,26 @@ { Sequence<Any> aArgs(2); const PropertyValue* pEnd = m_aArgs.getConstArray() + m_aArgs.getLength(); - const PropertyValue* pValue =::std::find_if(m_aArgs.getConstArray(), + const PropertyValue* pValue =::std::find_if( + m_aArgs.getConstArray(), pEnd, - ::std::bind2nd(::comphelper::TPropertyValueEqualFunctor(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Stream")))); + ::std::bind2nd( + ::comphelper::TPropertyValueEqualFunctor(), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Stream" ) ) + )); + if ( pValue && pValue != pEnd ) aArgs[0] = pValue->Value; else { - pValue =::std::find_if(m_aArgs.getConstArray(), + pValue =::std::find_if( + m_aArgs.getConstArray(), pEnd, - ::std::bind2nd(::comphelper::TPropertyValueEqualFunctor(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")))); + ::std::bind2nd( + ::comphelper::TPropertyValueEqualFunctor(), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) ) + )); + if ( pValue && pValue != pEnd ) aArgs[0] = pValue->Value; else if ( m_sFileURL.getLength() ) File [changed]: ModelImpl.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.hxx?r1=1.2&r2=1.2.8.1 Delta lines: +6 -2 ------------------- --- ModelImpl.hxx 10 Mar 2005 16:32:51 -0000 1.2 +++ ModelImpl.hxx 21 Mar 2005 14:35:26 -0000 1.2.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: ModelImpl.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.8.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:32:51 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -266,6 +266,10 @@ void lateInit(); + + /** determines whether the database document has an embedded data storage + */ + inline bool isEmbeddedDatabase() const { return ( m_sConnectURL.compareToAscii( "sdbc:embedded:", 14 ) == 0 ); } /** stores the embedded storage ("database") @return <TRUE/> if the storage could be commited, otherwise <FALSE/> File [changed]: databasedocument.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.14&r2=1.14.8.1 Delta lines: +36 -21 --------------------- --- databasedocument.cxx 10 Mar 2005 16:33:50 -0000 1.14 +++ databasedocument.cxx 21 Mar 2005 14:35:26 -0000 1.14.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: databasedocument.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.8.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:33:50 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -195,7 +195,7 @@ ,m_aModifyListeners(m_aMutex) ,m_aCloseListener(m_aMutex) ,m_aDocEventListeners(m_aMutex) - + ,m_bCommitMasterStorage(sal_True) { DBG_CTOR(ODatabaseDocument,NULL); // adjust our readonly flag @@ -292,8 +292,6 @@ m_pImpl->getStorage(); - Reference<XDataSource> xDs = m_pImpl->getDataSource(); - try { static ::rtl::OUString s_sStatusIndicator(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); @@ -487,7 +485,8 @@ notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnSaveDone"))); } // ----------------------------------------------------------------------------- -void ODatabaseDocument::store(const ::rtl::OUString& sURL, const Sequence< PropertyValue >& lArguments ) +void ODatabaseDocument::store(const ::rtl::OUString& sURL + ,const Sequence< PropertyValue >& lArguments) { OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); if ( m_pImpl->m_bDocumentReadOnly ) @@ -495,7 +494,7 @@ m_pImpl->commitStorages(); - writeStorage(sURL,lArguments); + writeStorage(sURL,lArguments,m_pImpl->getStorage()); try { @@ -506,7 +505,7 @@ catch(Exception) { } - m_pImpl->m_bModified = sal_False; + setModified(sal_False); } // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::storeAsURL( const ::rtl::OUString& sURL, const Sequence< PropertyValue >& lArguments ) throw (IOException, RuntimeException) @@ -535,7 +534,7 @@ if ( !xStorage.is() ) throw IOException(); - if ( m_pImpl->m_sConnectURL.compareToAscii("sdbc:embedded:",14) == 0 ) + if ( m_pImpl->isEmbeddedDatabase() ) m_pImpl->clearConnections(); m_pImpl->commitEmbeddedStorage(); @@ -598,9 +597,22 @@ if ( !xStorage.is() ) throw IOException(); - if ( ! m_pImpl->m_bDocumentReadOnly ) - store(sURL,lArguments); + m_bCommitMasterStorage = sal_False; + m_pImpl->commitEmbeddedStorage(); + m_bCommitMasterStorage = sal_True; xMyStorage->copyToStorage( xStorage ); + writeStorage(sURL,lArguments,xStorage); + try + { + Reference<XTransactedObject> xTransact(xStorage,UNO_QUERY); + if ( xTransact.is() ) + xTransact->commit(); + } + catch(Exception) + { + OSL_ENSURE(0,"Exception Caught: Could not store database!"); + throw IOException(); + } } else throw IOException(); @@ -770,12 +782,13 @@ const sal_Char* pServiceName, const Sequence<Any> & rArguments, const Sequence<PropertyValue> & rMediaDesc, - sal_Bool bPlainStream ) + sal_Bool bPlainStream + ,const Reference<XStorage>& _xStorageToSaveTo) { OSL_ENSURE( NULL != pStreamName, "Need stream name!" ); OSL_ENSURE( NULL != pServiceName, "Need service name!" ); - Reference<XStorage> xMyStorage = m_pImpl->getStorage(); + Reference<XStorage> xMyStorage = _xStorageToSaveTo; // open stream ::rtl::OUString sStreamName = ::rtl::OUString::createFromAscii( pStreamName ); Reference<XStream> xStream = xMyStorage->openStreamElement( sStreamName,ElementModes::READWRITE | ElementModes::TRUNCATE ); @@ -835,7 +848,7 @@ const Reference<XComponent> & xComponent, const sal_Char* pServiceName, const Sequence<Any> & rArguments, - const Sequence<PropertyValue> & rMediaDesc ) + const Sequence<PropertyValue> & rMediaDesc) { OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" ); OSL_ENSURE( xComponent.is(), "Need component!" ); @@ -877,7 +890,9 @@ return xFilter->filter( rMediaDesc ); } // ----------------------------------------------------------------------------- -void ODatabaseDocument::writeStorage(const ::rtl::OUString& _sURL, const Sequence< PropertyValue >& lArguments ) +void ODatabaseDocument::writeStorage(const ::rtl::OUString& _sURL + ,const Sequence< PropertyValue >& lArguments + ,const Reference<XStorage>& _xStorageToSaveTo) { // create XStatusIndicator Reference<XStatusIndicator> xStatusIndicator; @@ -932,7 +947,7 @@ sal_Bool bWarn = sal_False, bErr = sal_False; String sWarnFile, sErrFile; - Reference<XPropertySet> xProp(m_pImpl->getStorage(),UNO_QUERY); + Reference<XPropertySet> xProp(_xStorageToSaveTo,UNO_QUERY); if ( xProp.is() ) { static const ::rtl::OUString sPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); @@ -947,7 +962,7 @@ if( !WriteThroughComponent( xCom, "settings.xml", "com.sun.star.comp.sdb.XMLSettingsExporter", - aEmptyArgs, aProps, sal_True ) ) + aEmptyArgs, aProps, sal_True,_xStorageToSaveTo ) ) { if( !bWarn ) { @@ -963,7 +978,7 @@ if( !WriteThroughComponent( xCom, "content.xml", "com.sun.star.comp.sdb.DBExportFilter", - aFilterArgs, aProps, sal_True ) ) + aFilterArgs, aProps, sal_True,_xStorageToSaveTo ) ) { bErr = sal_True; sErrFile = String( RTL_CONSTASCII_STRINGPARAM("content.xml"), @@ -1271,7 +1286,7 @@ //------------------------------------------------------------------ void SAL_CALL ODatabaseDocument::commited( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException) { - if ( m_pImpl.is() ) + if ( m_pImpl.is() && m_bCommitMasterStorage ) { ::osl::MutexGuard aGuard(m_aMutex); TStorages::iterator aFind = m_pImpl->m_aStorages.find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database"))); File [changed]: databasedocument.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.hxx?r1=1.2&r2=1.2.8.1 Delta lines: +22 -6 -------------------- --- databasedocument.hxx 10 Mar 2005 16:34:06 -0000 1.2 +++ databasedocument.hxx 21 Mar 2005 14:35:26 -0000 1.2.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: databasedocument.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.8.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:34:06 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -152,6 +152,7 @@ ::cppu::OInterfaceContainerHelper m_aCloseListener; ::cppu::OInterfaceContainerHelper m_aDocEventListeners; ::rtl::Reference<ODatabaseModelImpl> m_pImpl; + sal_Bool m_bCommitMasterStorage; void setMeAsParent(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xName); @@ -160,8 +161,11 @@ The URL @param lArguments The media descriptor + @param _xStorageToSaveTo + The storage which should be used for saving */ - void store(const ::rtl::OUString& sURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& lArguments ); + void store(const ::rtl::OUString& sURL + , const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& lArguments); /** notifies the global event broadcaster @param _sEventName @@ -188,7 +192,8 @@ /// output descriptor const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> & rMediaDesc, - sal_Bool bPlainStream ); /// neither compress nor encrypt + sal_Bool bPlainStream + , const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _xStorageToSaveTo); /// neither compress nor encrypt /// write a single output stream /// (to be called either directly or by WriteThroughComponent(...)) @@ -201,8 +206,19 @@ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> & rArguments, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue> & rMediaDesc ); - void writeStorage(const ::rtl::OUString& _sURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& lArguments); + ::com::sun::star::beans::PropertyValue> & rMediaDesc); + + /** writes the content and settings + @param sURL + The URL + @param lArguments + The media descriptor + @param _xStorageToSaveTo + The storage which should be used for saving + */ + void writeStorage(const ::rtl::OUString& _sURL + , const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& lArguments + , const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _xStorageToSaveTo); protected: File [changed]: datasource.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.58&r2=1.58.8.1 Delta lines: +6 -6 ------------------- --- datasource.cxx 10 Mar 2005 16:34:20 -0000 1.58 +++ datasource.cxx 21 Mar 2005 14:35:26 -0000 1.58.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: datasource.cxx,v $ * - * $Revision: 1.58 $ + * $Revision: 1.58.8.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:34:20 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -378,8 +378,8 @@ { ::comphelper::disposeComponent(aFind->second->second.xMasterConnection); m_aConnections.erase(aFind->second); - m_aSharedConnection.erase(aFind); } + m_aSharedConnection.erase(aFind); } } @@ -730,7 +730,7 @@ { Sequence< PropertyValue > aDriverInfo = lcl_filterDriverProperties(xDriver,m_pImpl->m_sConnectURL,m_pImpl->m_aInfo); - if ( m_pImpl->m_sConnectURL.compareToAscii("sdbc:embedded:",14) == 0 ) + if ( m_pImpl->isEmbeddedDatabase() ) { sal_Int32 nCount = aDriverInfo.getLength(); aDriverInfo.realloc(nCount + 2 ); @@ -1086,7 +1086,7 @@ { Reference< XConnection > xConn; Reference< XConnection > xSdbcConn = buildLowLevelConnection(user, password); - DBG_ASSERT( xSdbcConn.is(), "ODatabaseSource::getConnection: invalid return value of buildLowLevelConnection!" ); + DBG_ASSERT( xSdbcConn.is(), "ODatabaseSource::buildIsolatedConnection: invalid return value of buildLowLevelConnection!" ); // buildLowLevelConnection is expected to always succeed if ( xSdbcConn.is() ) { File [changed]: definitioncontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/definitioncontainer.cxx?r1=1.17&r2=1.17.116.1 Delta lines: +66 -9 -------------------- --- definitioncontainer.cxx 2 Aug 2004 15:09:49 -0000 1.17 +++ definitioncontainer.cxx 21 Mar 2005 14:35:27 -0000 1.17.116.1 @@ -2,9 +2,9 @@ * * $RCSfile: definitioncontainer.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.17.116.1 $ * - * last change: $Author: hr $ $Date: 2004/08/02 15:09:49 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,6 +109,7 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; +using namespace ::com::sun::star::sdbcx; using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; @@ -476,6 +477,51 @@ } //-------------------------------------------------------------------------- +namespace +{ + bool lcl_ensureName( const Reference< XContent >& _rxContent, const ::rtl::OUString& _rName ) + { + if ( !_rxContent.is() ) + return true; + + // .......................................................... + // obtain the current name. If it's the same as the new one, + // don't do anything + try + { + Reference< XPropertySet > xProps( _rxContent, UNO_QUERY ); + if ( xProps.is() ) + { + ::rtl::OUString sCurrentName; + OSL_VERIFY( xProps->getPropertyValue( PROPERTY_NAME ) >>= sCurrentName ); + if ( sCurrentName.equals( _rName ) ) + return true; + } + } + catch( const Exception& ) + { + OSL_ENSURE( sal_False, "lcl_ensureName: caught an exception while obtaining the current name!" ); + } + + // .......................................................... + // set the new name + Reference< XRename > xRename( _rxContent, UNO_QUERY ); + OSL_ENSURE( xRename.is(), "lcl_ensureName: invalid content (not renameable)!" ); + if ( !xRename.is() ) + return false; + try + { + xRename->rename( _rName ); + return true; + } + catch( const Exception& ) + { + OSL_ENSURE( sal_False, "lcl_ensureName: caught an exception!" ); + } + return false; + } +} +//-------------------------------------------------------------------------- void ODefinitionContainer::implAppend(const ::rtl::OUString& _rName, const Reference< XContent >& _rxNewObject) { MutexGuard aGuard(m_aMutex); @@ -489,16 +535,27 @@ ODefinitionContainer_Impl::Documents::iterator aFind = pItem->m_aDocumentMap.find(_rName); if ( aFind == pItem->m_aDocumentMap.end() ) { + // ensure that the new object thas the proper name. + // Somebody could create an object with name "foo", and insert it as "bar" + // into a container. In this case, we need to ensure that the object name + // is also "bar" + // #i44786# / 2005-03-11 / [EMAIL PROTECTED] + lcl_ensureName( _rxNewObject, _rName ); + Reference<XUnoTunnel> xUnoTunnel(_rxNewObject,UNO_QUERY); ::rtl::Reference<OContentHelper> pContent = NULL; if ( xUnoTunnel.is() ) { pContent = reinterpret_cast<OContentHelper*>(xUnoTunnel->getSomething(OContentHelper::getUnoTunnelImplementationId())); TContentPtr pImpl = pContent->getImpl(); - ODefinitionContainer_Impl::Documents::iterator aIter = ::std::find_if(pItem->m_aDocumentMap.begin(),pItem->m_aDocumentMap.end(), + ODefinitionContainer_Impl::Documents::iterator aIter = + ::std::find_if( + pItem->m_aDocumentMap.begin(), + pItem->m_aDocumentMap.end(), ::std::compose1( ::std::bind2nd(::std::equal_to<TContentPtr>(), pImpl), - ::std::select2nd<ODefinitionContainer_Impl::Documents::value_type>()) + ::std::select2nd<ODefinitionContainer_Impl::Documents::value_type>() + ) ); if ( aIter != pItem->m_aDocumentMap.end() ) @@ -518,7 +575,7 @@ } catch(Exception&) { - DBG_ERROR("ODefinitionContainer::implAppend : catched something !"); + DBG_ERROR("ODefinitionContainer::implAppend: caught something !"); } } File [changed]: documentcontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.11&r2=1.11.6.1 Delta lines: +4 -4 ------------------- --- documentcontainer.cxx 10 Mar 2005 16:34:52 -0000 1.11 +++ documentcontainer.cxx 21 Mar 2005 14:35:27 -0000 1.11.6.1 @@ -2,9 +2,9 @@ * * $RCSfile: documentcontainer.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.11.6.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:34:52 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -254,7 +254,7 @@ ODefinitionContainer_Impl::Documents::iterator aFind = pItem->m_aDocumentMap.find(sName); TContentPtr pElementImpl; - if ( aFind == pItem->m_aDocumentMap.end() ) + if ( bNew || ( aFind == pItem->m_aDocumentMap.end() ) ) { pElementImpl.reset( new OContentHelper_Impl ); if ( !bNew ) File [changed]: documentdefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.23&r2=1.23.2.1 Delta lines: +40 -31 --------------------- --- documentdefinition.cxx 16 Mar 2005 15:49:18 -0000 1.23 +++ documentdefinition.cxx 21 Mar 2005 14:35:27 -0000 1.23.2.1 @@ -2,9 +2,9 @@ * * $RCSfile: documentdefinition.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.23.2.1 $ * - * last change: $Author: obo $ $Date: 2005/03/16 15:49:18 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -619,6 +619,8 @@ ( ( aOpenCommand.Mode == OpenMode::ALL ) || ( aOpenCommand.Mode == OpenMode::FOLDERS ) || ( aOpenCommand.Mode == OpenMode::DOCUMENTS ) ); + if ( xConnection.is() ) + m_xLastKnownConnection = xConnection; if ( bOpenFolder ) { @@ -1285,16 +1287,20 @@ { try { - sal_Int32 nHandle = PROPERTY_ID_NAME; osl::ClearableGuard< osl::Mutex > aGuard(m_aMutex); + if ( newName.equals( m_pImpl->m_aProps.aTitle ) ) + return; + sal_Int32 nHandle = PROPERTY_ID_NAME; Any aOld = makeAny(m_pImpl->m_aProps.aTitle); - aGuard.clear(); Any aNew = makeAny(newName); + + aGuard.clear(); fire(&nHandle, &aNew, &aOld, 1, sal_True ); m_pImpl->m_aProps.aTitle = newName; fire(&nHandle, &aNew, &aOld, 1, sal_False ); + ::osl::ClearableGuard< ::osl::Mutex > aGuard2( m_aMutex ); if ( m_xEmbeddedObject.is() && m_xEmbeddedObject->getCurrentState() == EmbedStates::ACTIVE ) updateDocumentTitle(); } @@ -1345,11 +1351,14 @@ if ( !m_bForm && _bFill && m_pImpl->m_aProps.bAsTemplate && !m_bOpenInDesign ) // open a report in alive mode, so we need to fill it { setModelReadOnly(sal_False); - Sequence<Any> aArgs(1); + Sequence<Any> aArgs(2); PropertyValue aValue; aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextDocument")); aValue.Value <<= getComponent(); aArgs[0] <<= aValue; + aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")); + 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); if ( xExecuteable.is() ) xExecuteable->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fill"))); File [changed]: documentdefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.11&r2=1.11.52.1 Delta lines: +11 -10 --------------------- --- documentdefinition.hxx 21 Jan 2005 17:04:48 -0000 1.11 +++ documentdefinition.hxx 21 Mar 2005 14:35:28 -0000 1.11.52.1 @@ -2,9 +2,9 @@ * * $RCSfile: documentdefinition.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.11.52.1 $ * - * last change: $Author: kz $ $Date: 2005/01/21 17:04:48 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,6 +123,7 @@ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject> m_xEmbeddedObject; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener > m_xListener; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader > m_xFrameLoader; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xLastKnownConnection; OInterceptor* m_pInterceptor; sal_Bool m_bForm; // <TRUE/> if it is a form sal_Bool m_bOpenInDesign; Directory: /dba/dbaccess/source/core/inc/ ========================================= File [changed]: ContentHelper.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/inc/ContentHelper.hxx?r1=1.4&r2=1.4.6.1 Delta lines: +4 -4 ------------------- --- ContentHelper.hxx 10 Mar 2005 16:36:09 -0000 1.4 +++ ContentHelper.hxx 21 Mar 2005 14:35:28 -0000 1.4.6.1 @@ -2,9 +2,9 @@ * * $RCSfile: ContentHelper.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.6.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:36:09 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,7 +136,7 @@ sal_Bool bIsDocument; // IsDocument sal_Bool bIsFolder; // IsFolder sal_Bool bAsTemplate; // AsTemplate - ::rtl::OUString sPersistentName;// persitent name of the document + ::rtl::OUString sPersistentName;// persistent name of the document // @@@ Add other properties supported by your content. Directory: /dba/dbaccess/source/filter/migration/ ================================================= File [changed]: cfgimport.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/migration/cfgimport.cxx?r1=1.7&r2=1.7.6.1 Delta lines: +57 -43 --------------------- --- cfgimport.cxx 11 Mar 2005 11:00:24 -0000 1.7 +++ cfgimport.cxx 21 Mar 2005 14:35:29 -0000 1.7.6.1 @@ -2,9 +2,9 @@ * * $RCSfile: cfgimport.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.7.6.1 $ * - * last change: $Author: vg $ $Date: 2005/03/11 11:00:24 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -663,30 +663,30 @@ } } // ----------------------------------------------------------------------------- -void OCfgImport::setProperties() +void OCfgImport::setProperties(sal_Int16 _eType) { - if ( m_aValues.getLength() ) + if ( m_aValues[_eType].getLength() ) { - OSL_ENSURE(m_aProperties.getLength() == m_aValues.getLength(),"Count is not equal!"); + OSL_ENSURE(m_aProperties[_eType].getLength() == m_aValues[_eType].getLength(),"Count is not equal!"); try { Reference< XMultiPropertySet > xFormMultiSet; - if ( m_xCurrentColumn.is() ) + if ( _eType == COLUMN ) xFormMultiSet.set(m_xCurrentColumn,UNO_QUERY); - else if ( m_xCurrentObject.is() ) + else if ( _eType == TABLE || _eType == QUERY ) xFormMultiSet.set(m_xCurrentObject,UNO_QUERY); - else if ( m_xCurrentDS.is() ) + else if ( _eType == DATASOURCE ) xFormMultiSet.set(m_xCurrentDS,UNO_QUERY); if ( xFormMultiSet.is() ) - xFormMultiSet->setPropertyValues(m_aProperties, m_aValues); + xFormMultiSet->setPropertyValues(m_aProperties[_eType], m_aValues[_eType]); } catch(const Exception& e) { throw WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property could not be set.")),*this,makeAny(e)); } - m_aValues = Sequence< Any>(); - m_aProperties = Sequence< ::rtl::OUString>(); + m_aValues[_eType] = Sequence< Any>(); + m_aProperties[_eType] = Sequence< ::rtl::OUString>(); } } // ----------------------------------------------------------------------------- @@ -830,11 +830,15 @@ { if ( !m_aStack.empty() ) { - switch(m_aStack.top().second) + sal_Int16 nElementType = m_aStack.top().second; + ::rtl::OUString sName = m_aStack.top().first; + m_aStack.pop(); + + switch(nElementType) { case DATASOURCE: { - setProperties(); + setProperties(nElementType); Reference<XStorable> xStr(m_xModel,UNO_QUERY); if ( xStr.is() ) { @@ -872,7 +876,7 @@ break; case TABLE: { - setProperties(); + setProperties(nElementType); Reference<XTablesSupplier> xSupplier(m_xCurrentDS,UNO_QUERY); Reference<XNameContainer> xTables(xSupplier->getTables(),UNO_QUERY); ::rtl::OUString sName; @@ -884,10 +888,10 @@ break; case QUERY: { - setProperties(); + setProperties(nElementType); Reference<XQueryDefinitionsSupplier> xQueriesSupplier(m_xCurrentDS,UNO_QUERY); Reference<XNameContainer> xQueries(xQueriesSupplier->getQueryDefinitions(),UNO_QUERY); - xQueries->insertByName(m_aStack.top().first,makeAny(m_xCurrentObject)); + xQueries->insertByName(sName,makeAny(m_xCurrentObject)); m_xCurrentObject = NULL; } break; @@ -895,7 +899,7 @@ try { if ( !UCBContentHelper::IsDocument(m_sDocumentLocation) ) - return; + break; sal_Bool bForm = sal_True; bForm = !isDocumentReport(m_xORB,m_sDocumentLocation); @@ -951,7 +955,7 @@ case COLUMN: if ( m_xCurrentColumn.is() ) { - setProperties(); + setProperties(nElementType); Reference<XColumnsSupplier> xSupplier(m_xCurrentObject,UNO_QUERY); Reference<XAppend> xAppend(xSupplier->getColumns(),UNO_QUERY); if ( xAppend.is() ) @@ -960,8 +964,6 @@ } break; } - - m_aStack.pop(); } } // ----------------------------------------------------------------------------- @@ -1010,9 +1012,11 @@ if ( sProp.getLength() ) { - sal_Int32 nPos = m_aProperties.getLength(); - m_aProperties.realloc(nPos+1); - m_aProperties[nPos] = sProp; + if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) + m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); + sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); + m_aProperties[m_aStack.top().second].realloc(nPos+1); + m_aProperties[m_aStack.top().second][nPos] = sProp; } else if ( aName == CONFIGKEY_DBLINK_LOGINTIMEOUT ) m_aStack.push(TElementStack::value_type(aName,LOGINTIMEOUT)); @@ -1039,9 +1043,11 @@ if ( sProp.getLength() ) { - sal_Int32 nPos = m_aProperties.getLength(); - m_aProperties.realloc(nPos+1); - m_aProperties[nPos] = sProp; + if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) + m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); + sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); + m_aProperties[m_aStack.top().second].realloc(nPos+1); + m_aProperties[m_aStack.top().second][nPos] = sProp; } else m_aStack.push(TElementStack::value_type(aName,NO_PROP)); @@ -1079,9 +1085,11 @@ if ( sProp.getLength() ) { - sal_Int32 nPos = m_aProperties.getLength(); - m_aProperties.realloc(nPos+1); - m_aProperties[nPos] = sProp; + if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) + m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); + sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); + m_aProperties[m_aStack.top().second].realloc(nPos+1); + m_aProperties[m_aStack.top().second][nPos] = sProp; } else m_aStack.push(TElementStack::value_type(aName,NO_PROP)); @@ -1102,9 +1110,11 @@ if ( sProp.getLength() ) { - sal_Int32 nPos = m_aProperties.getLength(); - m_aProperties.realloc(nPos+1); - m_aProperties[nPos] = sProp; + if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) + m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); + sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); + m_aProperties[m_aStack.top().second].realloc(nPos+1); + m_aProperties[m_aStack.top().second][nPos] = sProp; } else m_aStack.push(TElementStack::value_type(aName,NO_PROP)); @@ -1151,20 +1161,22 @@ m_aStack.pop(); break; default: - OSL_ENSURE(m_aProperties.getLength(),"Properties are zero!"); - if ( m_aProperties.getLength() ) + OSL_ENSURE(m_aProperties[m_aStack.top().second].getLength(),"Properties are zero!"); + if ( m_aProperties[m_aStack.top().second].getLength() ) { - if ( m_aProperties[m_aProperties.getLength()-1] != PROPERTY_LAYOUTINFORMATION ) + if ( m_aProperties[m_aStack.top().second][m_aProperties[m_aStack.top().second].getLength()-1] != PROPERTY_LAYOUTINFORMATION ) { if ( !m_bPropertyMayBeVoid && !aValue.hasValue() ) { - m_aProperties.realloc(m_aProperties.getLength()-1); + m_aProperties[m_aStack.top().second].realloc(m_aProperties[m_aStack.top().second].getLength()-1); } else { - sal_Int32 nPos = m_aValues.getLength(); - m_aValues.realloc(nPos+1); - m_aValues[nPos] = aValue; + if ( m_aValues.find(m_aStack.top().second) == m_aValues.end() ) + m_aValues.insert(::std::map< sal_Int16 ,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>())); + sal_Int32 nPos = m_aValues[m_aStack.top().second].getLength(); + m_aValues[m_aStack.top().second].realloc(nPos+1); + m_aValues[m_aStack.top().second][nPos] = aValue; } } else @@ -1173,8 +1185,10 @@ { Sequence< sal_Int8 > aInputSequence; aValue >>= aInputSequence; - sal_Int32 nPos = m_aValues.getLength(); - m_aValues.realloc(nPos+1); + if ( m_aValues.find(m_aStack.top().second) == m_aValues.end() ) + m_aValues.insert(::std::map< sal_Int16 ,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>())); + sal_Int32 nPos = m_aValues[m_aStack.top().second].getLength(); + m_aValues[m_aStack.top().second].realloc(nPos+1); Sequence< PropertyValue > aLayout; if ( aInputSequence.getLength() ) { @@ -1191,7 +1205,7 @@ else if ( QUERY == m_aStack.top().second ) LoadTableFields(xInStream,aLayout); } - m_aValues[nPos] <<= aLayout; + m_aValues[m_aStack.top().second][nPos] <<= aLayout; } catch(const Exception& e) { File [changed]: cfgimport.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/migration/cfgimport.hxx?r1=1.4&r2=1.4.6.1 Delta lines: +6 -6 ------------------- --- cfgimport.hxx 10 Mar 2005 16:38:44 -0000 1.4 +++ cfgimport.hxx 21 Mar 2005 14:35:29 -0000 1.4.6.1 @@ -2,9 +2,9 @@ * * $RCSfile: cfgimport.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.6.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:38:44 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -131,8 +131,8 @@ Reference<XModel> m_xModel; Reference<XPropertySet> m_xCurrentObject; /// can either be a query or a table Reference<XPropertySet> m_xCurrentColumn; - Sequence< ::rtl::OUString> m_aProperties; - Sequence< Any> m_aValues; + ::std::map< sal_Int16 ,Sequence< ::rtl::OUString> > m_aProperties; + ::std::map< sal_Int16 ,Sequence< Any> > m_aValues; ::rtl::OUString m_sCurrentDataSourceName; ::rtl::OUString m_sBookmarkName; ::rtl::OUString m_sDocumentLocation; @@ -146,7 +146,7 @@ void convert(); void createDataSource(const ::rtl::OUString& _sName); void createObject(sal_Bool _bQuery ,const ::rtl::OUString& _sName); - void setProperties(); + void setProperties(sal_Int16 _eType); protected: virtual ~OCfgImport() throw(); Directory: /dba/dbaccess/source/filter/xml/ =========================================== File [changed]: dbloader2.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/dbloader2.cxx?r1=1.9&r2=1.9.8.1 Delta lines: +30 -3 -------------------- --- dbloader2.cxx 10 Mar 2005 16:38:59 -0000 1.9 +++ dbloader2.cxx 21 Mar 2005 14:35:30 -0000 1.9.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: dbloader2.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.9.8.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:38:59 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,6 +95,12 @@ #ifndef _COM_SUN_STAR_FRAME_XLOADEVENTLISTENER_HPP_ #include <com/sun/star/frame/XLoadEventListener.hpp> #endif +#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_HPP_ +#include <com/sun/star/embed/XStorage.hpp> +#endif +#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_ +#include <com/sun/star/embed/ElementModes.hpp> +#endif #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> #endif @@ -156,6 +162,9 @@ #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> #endif +#ifndef _COMPHELPER_TYPES_HXX_ +#include <comphelper/types.hxx> +#endif #ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_ #include <comphelper/sequenceashashmap.hxx> #endif @@ -177,6 +186,9 @@ #ifndef _COMPHELPER_STLTYPES_HXX_ #include <comphelper/stl_types.hxx> #endif +#ifndef _COMPHELPER_STORAGEHELPER_HXX +#include <comphelper/storagehelper.hxx> +#endif #ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_ #include <com/sun/star/task/XJobExecutor.hpp> #endif @@ -197,6 +209,7 @@ using namespace ::com::sun::star::document; using namespace ::com::sun::star::registry; using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::embed; namespace css = ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; namespace css = ::com::sun::star; @@ -207,6 +220,7 @@ class DBTypeDetection : public ::cppu::WeakImplHelper2< XExtendedFilterDetection, XServiceInfo> { + Reference< XMultiServiceFactory > m_xServiceFactory; public: DBTypeDetection(const Reference< XMultiServiceFactory >&); @@ -228,6 +242,7 @@ }; // ------------------------------------------------------------------------- DBTypeDetection::DBTypeDetection(const Reference< XMultiServiceFactory >& _rxFactory) +: m_xServiceFactory(_rxFactory) { } // ------------------------------------------------------------------------- @@ -242,6 +257,18 @@ INetURLObject aURL(sTemp); if ( aURL.GetExtension().equalsIgnoreAsciiCaseAscii("odb") ) return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBase")); + else + { + Reference<XPropertySet> xProp(::comphelper::OStorageHelper::GetStorageFromURL(sTemp,ElementModes::READ,m_xServiceFactory),UNO_QUERY); + if ( xProp.is() ) + { + ::rtl::OUString sMediaType; + xProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= sMediaType; + if ( sMediaType.equalsAscii("application/vnd.sun.xml.base") ) + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBase")); + ::comphelper::disposeComponent(xProp); + } + } } return ::rtl::OUString(); } Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: AutoControls_tmpl.hrc Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc?r1=1.4&r2=1.4.4.1 Delta lines: +9 -7 ------------------- --- AutoControls_tmpl.hrc 10 Mar 2005 16:46:45 -0000 1.4 +++ AutoControls_tmpl.hrc 21 Mar 2005 14:35:31 -0000 1.4.4.1 @@ -2,9 +2,9 @@ * * $RCSfile: AutoControls_tmpl.hrc,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.4.1 $ * - * last change: $Author: vg $ $Date: 2005/03/10 16:46:45 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -504,6 +504,7 @@ Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - BUTTON_WIDTH - RELATED_CONTROLS - UNRELATED_CONTROLS , EDIT_HEIGHT ) ; \ TabStop = TRUE ; \ Border = TRUE ; \ + HelpId = AUTO_HID; \ }; \ \ PushButton PB_AUTOTESTDRIVERCLASS \ @@ -512,6 +513,7 @@ Pos = MAP_APPFONT ( WIZARD_PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , AUTO_Y + FIXEDTEXT_HEIGHT + 2) ; \ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; \ Size = MAP_APPFONT (50, 14); \ + HelpId = AUTO_HID + 1; \ Text [ de ] = "Klasse testen"; \ Text[ en-US ] = "Test class" ; \ }; @@ -520,10 +522,10 @@ #define AUTOHELP_JDBCCONTROLGROUP(AUTO_HID) \ - AUTO_HELP_NAMECONTROLGROUP(6, AUTO_HID + 1) \ - AUTO_HOSTCONTROLGROUP(96, AUTO_HID + 2) \ - AUTO_PORTCONTROLGROUP(113, AUTO_HID + 3 ) \ - AUTO_JDBCDRIVERCLASSGROUP(129, AUTO_HID + 4) + AUTO_HELP_NAMECONTROLGROUP(6, AUTO_HID ) \ + AUTO_HOSTCONTROLGROUP(96, AUTO_HID + 1) \ + AUTO_PORTCONTROLGROUP(113, AUTO_HID + 2 ) \ + AUTO_JDBCDRIVERCLASSGROUP(129, AUTO_HID + 3) // -------------------------------------------------------------------------------------------------- File [changed]: indexdialog.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/indexdialog.cxx?r1=1.18&r2=1.18.204.1 Delta lines: +7 -5 ------------------- --- indexdialog.cxx 1 Dec 2003 18:02:08 -0000 1.18 +++ indexdialog.cxx 21 Mar 2005 14:35:31 -0000 1.18.204.1 @@ -2,9 +2,9 @@ * * $RCSfile: indexdialog.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.18.204.1 $ * - * last change: $Author: rt $ $Date: 2003/12/01 18:02:08 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -347,8 +347,7 @@ SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); sal_Bool bSelectedAnything = NULL != pSelected; - m_aActions.EnableItem(ID_INDEX_DROP, bSelectedAnything); - m_aActions.EnableItem(ID_INDEX_RENAME, bSelectedAnything); + if (pSelected) { @@ -356,12 +355,15 @@ OIndexCollection::const_iterator aSelectedPos = reinterpret_cast<OIndexCollection::const_iterator>(pSelected->GetUserData()); m_aActions.EnableItem(ID_INDEX_SAVE, aSelectedPos->isModified() || aSelectedPos->isNew()); m_aActions.EnableItem(ID_INDEX_RESET, aSelectedPos->isModified() || aSelectedPos->isNew()); + bSelectedAnything = bSelectedAnything && !aSelectedPos->bPrimaryKey; } else { m_aActions.EnableItem(ID_INDEX_SAVE, sal_False); m_aActions.EnableItem(ID_INDEX_RESET, sal_False); } + m_aActions.EnableItem(ID_INDEX_DROP, bSelectedAnything); + m_aActions.EnableItem(ID_INDEX_RENAME, bSelectedAnything); } //------------------------------------------------------------------ Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: JoinController.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/JoinController.hxx?r1=1.18&r2=1.18.66.1 Delta lines: +11 -8 -------------------- --- JoinController.hxx 16 Nov 2004 14:31:13 -0000 1.18 +++ JoinController.hxx 21 Mar 2005 14:35:32 -0000 1.18.66.1 @@ -2,9 +2,9 @@ * * $RCSfile: JoinController.hxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.18.66.1 $ * - * last change: $Author: obo $ $Date: 2004/11/16 14:31:13 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -178,6 +178,9 @@ m_aExceptionInfo = ::dbtools::SQLExceptionInfo(); return aInfo; } + + void clearAddTableDialog() { m_pAddTabDlg = NULL; } + protected: virtual OTableWindowData* createTableWindowData() = 0; // ask the user if the design should be saved when it is modified Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: JoinController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/JoinController.cxx?r1=1.32&r2=1.32.66.1 Delta lines: +5 -5 ------------------- --- JoinController.cxx 16 Nov 2004 14:32:37 -0000 1.32 +++ JoinController.cxx 21 Mar 2005 14:35:32 -0000 1.32.66.1 @@ -2,9 +2,9 @@ * * $RCSfile: JoinController.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.32.66.1 $ * - * last change: $Author: obo $ $Date: 2004/11/16 14:32:37 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -213,8 +213,8 @@ { OJoinController_BASE::disposing(); - m_pView = NULL; m_pAddTabDlg = NULL; + m_pView = NULL; { ::std::vector< OTableConnectionData*>::iterator aIter = m_vTableConnectionData.begin(); File [changed]: JoinDesignView.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/JoinDesignView.cxx?r1=1.14&r2=1.14.106.1 Delta lines: +5 -3 ------------------- --- JoinDesignView.cxx 9 Sep 2004 09:47:56 -0000 1.14 +++ JoinDesignView.cxx 21 Mar 2005 14:35:32 -0000 1.14.106.1 @@ -2,9 +2,9 @@ * * $RCSfile: JoinDesignView.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.106.1 $ * - * last change: $Author: rt $ $Date: 2004/09/09 09:47:56 $ + * last change: $Author: fs $ $Date: 2005/03/21 14:35:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -143,6 +143,8 @@ // ----------------------------------------------------------------------------- OJoinDesignView::~OJoinDesignView() { + if ( m_pController ) + m_pController->clearAddTableDialog(); ::std::auto_ptr<Window> aT3(m_pScrollWindow); m_pScrollWindow = NULL; ::std::auto_ptr<Window> aT2(m_pTableView); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
