Tag: cws_src680_hsqldb2 User: oj Date: 05/01/28 04:19:44 Modified: /dba/dbaccess/source/core/api/ KeySet.cxx /dba/dbaccess/source/core/dataaccess/ databasecontext.cxx, databasecontext.hxx, databasedocument.cxx, datasource.cxx, datasource.hxx, intercept.cxx /dba/dbaccess/source/core/inc/ core_resource.hrc /dba/dbaccess/source/core/resource/ strings.src /dba/dbaccess/source/ui/app/ AppController.cxx
Log: #i39922# fix for storeAsURL and merges from dba23 File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: KeySet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/KeySet.cxx?r1=1.54&r2=1.54.12.1 Delta lines: +1 -1 ------------------- --- KeySet.cxx 5 Jan 2005 12:26:22 -0000 1.54 +++ KeySet.cxx 28 Jan 2005 12:19:38 -0000 1.54.12.1 @@ -628,7 +628,7 @@ ::std::vector< ::rtl::OUString >::iterator aAutoEnd = m_aAutoColumns.end(); for (sal_Int32 i = 1;aAutoIter != aAutoEnd && i <= nColumnCount; ++aAutoIter,++i) { -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 1 ::rtl::OUString sColumnName( xMd->getColumnName(i) ); #endif OColumnNamePos::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: databasecontext.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.cxx?r1=1.25.22.1&r2=1.25.22.2 Delta lines: +64 -35 --------------------- --- databasecontext.cxx 19 Jan 2005 07:06:47 -0000 1.25.22.1 +++ databasecontext.cxx 28 Jan 2005 12:19:38 -0000 1.25.22.2 @@ -150,6 +150,9 @@ #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX #include <svtools/pathoptions.hxx> #endif +#ifndef SVTOOLS_FILENOTATION_HXX +#include <svtools/filenotation.hxx> +#endif using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; @@ -168,6 +171,8 @@ using ::com::sun::star::task::InteractionClassification_ERROR; using ::com::sun::star::ucb::IOErrorCode_NO_FILE; using ::com::sun::star::ucb::InteractiveIOException; +using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING; +using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING_PATH; //========================================================================== @@ -377,14 +382,37 @@ } catch(InteractiveIOException e) { - throw WrappedTargetException( _sURL, Reference<XNamingService>(this), makeAny( e ) ); + if ( ( e.Code == IOErrorCode_NO_FILE ) + || ( e.Code == IOErrorCode_NOT_EXISTING ) + || ( e.Code == IOErrorCode_NOT_EXISTING_PATH ) + ) + { + // #i40463# #i39187# + String sErrorMessage( DBACORE_RESSTRING( RID_STR_FILE_DOES_NOT_EXIST ) ); + ::svt::OFileNotation aTransformer( _sURL ); + sErrorMessage.SearchAndReplaceAscii( "$file$", aTransformer.get( ::svt::OFileNotation::N_SYSTEM ) ); + + SQLException aError; + aError.Message = sErrorMessage; + + throw WrappedTargetException( _sURL, Reference< XNamingService >( this ), makeAny( aError ) ); + } + throw WrappedTargetException( _sURL, Reference< XNamingService >( this ), makeAny( e ) ); } catch(Exception e) { throw WrappedTargetException( _sURL, Reference<XNamingService>(this), makeAny( e ) ); } - Reference< XInterface > xExistent = *(new ODatabaseSource(*this, _rName, m_xServiceManager,this)); + Reference< XInterface > xExistent = getObject(_sURL); + if ( xExistent.is() ) // we found a object registered under the URL + { + m_aDatabaseObjects.erase(_sURL); + registerPrivate(_rName,xExistent); + } + else + { + xExistent = *(new ODatabaseSource(*this, _rName, m_xServiceManager,this)); Sequence< PropertyValue > aArgs(1); aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FileName")); @@ -417,6 +445,7 @@ else DBG_ERROR("ODatabaseContext::getRegisteredObject: missing an interface!"); } + } return xExistent; } File [changed]: databasecontext.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.hxx?r1=1.10.78.1&r2=1.10.78.2 Delta lines: +2 -2 ------------------- File [changed]: databasedocument.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.7.20.2&r2=1.7.20.3 Delta lines: +83 -48 --------------------- --- databasedocument.cxx 26 Jan 2005 06:53:02 -0000 1.7.20.2 +++ databasedocument.cxx 28 Jan 2005 12:19:39 -0000 1.7.20.3 @@ -100,6 +100,9 @@ #ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif +#ifndef _COMPHELPER_MEDIADESCRIPTOR_HXX_ +#include <comphelper/mediadescriptor.hxx> +#endif #ifndef _DRAFTS_COM_SUN_STAR_UI_XUICONFIGURATIONSTORAGE_HPP_ #include <drafts/com/sun/star/ui/XUIConfigurationStorage.hpp> #endif @@ -213,7 +216,12 @@ m_bDocumentReadOnly = sal_False; - m_aArgs = _aArguments; + static ::rtl::OUString s_sStatusIndicator(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); + static ::rtl::OUString s_sInteractionHandler(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")); + ::comphelper::MediaDescriptor aMedia(_aArguments); + aMedia.erase(s_sStatusIndicator); + aMedia.erase(s_sInteractionHandler); + aMedia >> m_aArgs; m_sFileURL = _sURL; if ( !m_sName.getLength() ) m_sName = m_sFileURL; @@ -223,14 +231,15 @@ try { - const PropertyValue* pValue =::std::find_if(m_aArgs.getConstArray(), - m_aArgs.getConstArray() + m_aArgs.getLength(), - ::std::bind2nd(::comphelper::TPropertyValueEqualFunctor(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")))); + const PropertyValue* pValue =::std::find_if(_aArguments.getConstArray(), + _aArguments.getConstArray() + _aArguments.getLength(), + ::std::bind2nd(::comphelper::TPropertyValueEqualFunctor(),s_sStatusIndicator)); Sequence<Any> aFilterArgs; - if ( pValue && pValue != (m_aArgs.getConstArray() + m_aArgs.getLength()) ) + Reference<XStatusIndicator> xStatusIndicator; + if ( pValue && pValue != (_aArguments.getConstArray() + _aArguments.getLength()) ) { - Reference<XStatusIndicator> xStatusIndicator(pValue->Value,UNO_QUERY); + xStatusIndicator.set(pValue->Value,UNO_QUERY); // set progress range and start status indicator sal_Int32 nProgressRange(1000000); @@ -250,7 +259,9 @@ xImporter->setTargetDocument(xComponent); Reference<XFilter> xFilter(xImporter,UNO_QUERY); - xFilter->filter(m_aArgs); + xFilter->filter(_aArguments); + if ( xStatusIndicator.is() ) + xStatusIndicator->end(); } else return sal_False; @@ -263,6 +274,7 @@ { return sal_False; } + return sal_True; } // ----------------------------------------------------------------------------- @@ -383,6 +395,8 @@ throw DisposedException(); store(m_sFileURL,m_aArgs); + + notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnSaveDone"))); } // ----------------------------------------------------------------------------- void ODatabaseSource::store(const ::rtl::OUString& sURL, const Sequence< PropertyValue >& lArguments ) @@ -390,35 +404,7 @@ if ( m_bDocumentReadOnly ) throw IOException(); - try - { - -// if ( m_aContainer[E_FORM].get() ) -// { -// Reference<XTransactedObject> xForms(getFormDocuments(),UNO_QUERY); -// if ( xForms.is() ) -// xForms->commit(); -// } - -// if ( m_aContainer[E_REPORT].get() ) -// { -// Reference<XTransactedObject> xReports(getReportDocuments(),UNO_QUERY); -// if ( xReports.is() ) -// xReports->commit(); -// } - TStorages::iterator aIter = m_aStorages.begin(); - TStorages::iterator aEnd = m_aStorages.end(); - for (; aIter != aEnd ; ++aIter) - { - Reference<XTransactedObject> xTrans(aIter->second,UNO_QUERY); - if ( xTrans.is() ) - xTrans->commit(); - } - } - catch(WrappedTargetException) - { - throw IOException(); - } + commitStorages(); writeStorage(sURL,lArguments); @@ -443,7 +429,8 @@ Reference<XSingleServiceFactory> xStorageFactory(m_xServiceFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ),UNO_QUERY); if ( xStorageFactory.is() ) { - if ( sURL != m_sFileURL ) + sal_Bool bClearConnections; + if ( bClearConnections = (sURL != m_sFileURL) ) { Sequence<Any> aParam(2); aParam[0] <<= sURL; @@ -458,32 +445,51 @@ if ( !xStorage.is() ) throw IOException(); + if ( m_sConnectURL.compareToAscii("sdbc:embedded:",14) == 0 ) + clearConnections(); + commitEmbeddedStorage(); + Reference<XStorage> xMyStorage = getStorage(); if ( xMyStorage.is() ) { + commitStorages(); xMyStorage->copyToStorage( xStorage ); } disposeStorages(); + ::comphelper::disposeComponent(xMyStorage); m_xStorage = xStorage; - ::comphelper::disposeComponent(xMyStorage); m_bDocumentReadOnly = sal_False; if ( sURL != m_sFileURL ) { if ( m_pDBContext ) + { + if ( m_sFileURL.getLength() ) m_pDBContext->nameChangePrivate(m_sFileURL,sURL); + else + m_pDBContext->registerPrivate(sURL,*this); + } - INetURLObject aURL( m_sName ); + INetURLObject aURL( sURL ); if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) m_sName = sURL; } - m_sFileURL = sURL; + m_sFileURL = sURL; } - m_aArgs = lArguments; - store(); + + static ::rtl::OUString s_sStatusIndicator(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); + static ::rtl::OUString s_sInteractionHandler(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")); + ::comphelper::MediaDescriptor aMedia(lArguments); + aMedia.erase(s_sStatusIndicator); + aMedia.erase(s_sInteractionHandler); + aMedia >> m_aArgs; + + store(m_sFileURL,lArguments); + + notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnSaveAsDone"))); } else throw IOException(); @@ -546,6 +552,7 @@ m_bModified = _bModified; lang::EventObject aEvt(*this); NOTIFY_LISTERNERS(m_aModifyListeners,XModifyListener,modified) + notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnModifyChanged"))); } } // ----------------------------------------------------------------------------- @@ -837,11 +844,11 @@ Reference<XStatusIndicator> xStatusIndicator; try { - const PropertyValue* pValue =::std::find_if(m_aArgs.getConstArray(), - m_aArgs.getConstArray() + m_aArgs.getLength(), + const PropertyValue* pValue =::std::find_if(lArguments.getConstArray(), + lArguments.getConstArray() + lArguments.getLength(), ::std::bind2nd(::comphelper::TPropertyValueEqualFunctor(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")))); - if ( pValue && pValue != (m_aArgs.getConstArray() + m_aArgs.getLength()) ) + if ( pValue && pValue != (lArguments.getConstArray() + lArguments.getLength()) ) { xStatusIndicator.set(pValue->Value,UNO_QUERY); @@ -1124,6 +1131,34 @@ { } //------------------------------------------------------------------ +void ODatabaseSource::commitStorages() +{ + try + { + TStorages::iterator aIter = m_aStorages.begin(); + TStorages::iterator aEnd = m_aStorages.end(); + for (; aIter != aEnd ; ++aIter) + { + Reference<XTransactedObject> xTrans(aIter->second,UNO_QUERY); + if ( xTrans.is() ) + xTrans->commit(); + } + } + catch(WrappedTargetException) + { + throw IOException(); + } +} + +void ODatabaseSource::notifyEvent(const ::rtl::OUString& _sEventName) +{ + if ( m_xDocEventBroadcaster.is() ) + { + ::com::sun::star::document::EventObject aEvent(*this, _sEventName); + m_xDocEventBroadcaster->notifyEvent(aEvent); + } +} + //........................................................................ } // namespace dbaccess //........................................................................ File [changed]: datasource.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.52.20.1&r2=1.52.20.2 Delta lines: +28 -18 --------------------- --- datasource.cxx 19 Jan 2005 07:06:48 -0000 1.52.20.1 +++ datasource.cxx 28 Jan 2005 12:19:39 -0000 1.52.20.2 @@ -590,6 +590,15 @@ m_bReadOnly = sal_False; m_aContainer.resize(4); m_pChildCommitListen = NULL; + try + { + m_xDocEventBroadcaster.set(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), + UNO_QUERY); + } + catch(Exception) + { + OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!"); + } } // ----------------------------------------------------------------------------- void ODatabaseSource::setMeAsParent(const Reference< XNameAccess >& _xName) @@ -676,19 +685,19 @@ if ( xCon == i->get() ) { *i = OWeakConnection(); - try - { - Reference<XTransactedObject> xTrans(xCon,UNO_QUERY); - if ( bStore = xTrans.is() ) - { - xTrans->commit(); - bStore = commitEmbeddedStorage(); - } - } - catch(Exception&) - { - OSL_ENSURE(0,"Exception Caught: Could not store embedded database!"); - } +// try +// { +// Reference<XTransactedObject> xTrans(xCon,UNO_QUERY); +// if ( bStore = xTrans.is() ) +// { +// xTrans->commit(); +// bStore = commitEmbeddedStorage(); +// } +// } +// catch(Exception&) +// { +// OSL_ENSURE(0,"Exception Caught: Could not store embedded database!"); +// } } } @@ -786,6 +795,7 @@ //------------------------------------------------------------------------------ void ODatabaseSource::disposing() { + notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload"))); OSubComponent::disposing(); OPropertySetHelper::disposing(); File [changed]: datasource.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.hxx?r1=1.23.20.1&r2=1.23.20.2 Delta lines: +20 -3 -------------------- --- datasource.hxx 19 Jan 2005 07:06:48 -0000 1.23.20.1 +++ datasource.hxx 28 Jan 2005 12:19:40 -0000 1.23.20.2 @@ -92,6 +92,9 @@ #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ #include <com/sun/star/util/XNumberFormatter.hpp> #endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_ +#include <com/sun/star/document/XEventListener.hpp> +#endif #ifndef _COM_SUN_STAR_UTIL_XFLUSHABLE_HPP_ #include <com/sun/star/util/XFlushable.hpp> #endif @@ -297,6 +300,7 @@ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController> m_xCurrentController; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xStorage; ::com::sun::star::uno::Reference< ::drafts::com::sun::star::ui::XUIConfigurationManager> m_xUIConfigurationManager; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener > m_xDocEventBroadcaster; ODatabaseContext* m_pDBContext; @@ -352,6 +356,18 @@ /** dispose all frames for registered controllers */ void disposeControllerFrames(); + + /** notifies the global event broadcaster + @param _sEventName + On of + OnNew => new document + OnLoad => load document + OnUnload => close document + OnSaveDone => "Save" ended + OnSaveAsDone => "SaveAs" ended + OnModifyChanged => modified/unmodified + */ + void notifyEvent(const ::rtl::OUString& _sEventName); protected: ODatabaseSource( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory @@ -538,6 +554,7 @@ void clearConnections(); ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage> getStorage(); + void commitStorages(); }; //........................................................................ File [changed]: intercept.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/intercept.cxx?r1=1.2&r2=1.2.78.1 Delta lines: +4 -30 -------------------- --- intercept.cxx 2 Aug 2004 15:10:59 -0000 1.2 +++ intercept.cxx 28 Jan 2005 12:19:40 -0000 1.2.78.1 @@ -100,8 +100,7 @@ #define DISPATCH_CLOSEDOC 2 #define DISPATCH_CLOSEWIN 3 #define DISPATCH_CLOSEFRAME 4 -#define DISPATCH_EDITDOC 5 -#define DISPATCH_RELOAD 6 +#define DISPATCH_RELOAD 5 // the OSL_ENSURE in CTOR has to be changed too, when adding new defines void OInterceptor::DisconnectContentHolder() @@ -164,14 +163,13 @@ ,m_aInterceptedURL(7) ,m_bAllowEditDoc(_bAllowEditDoc) { - OSL_ENSURE(DISPATCH_EDITDOC < m_aInterceptedURL.getLength(),"Illegal size."); + OSL_ENSURE(DISPATCH_RELOAD < m_aInterceptedURL.getLength(),"Illegal size."); m_aInterceptedURL[DISPATCH_SAVEAS] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SaveAs")); m_aInterceptedURL[DISPATCH_SAVE] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Save")); m_aInterceptedURL[DISPATCH_CLOSEDOC] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc")); m_aInterceptedURL[DISPATCH_CLOSEWIN] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CloseWin")); m_aInterceptedURL[DISPATCH_CLOSEFRAME] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CloseFrame")); - m_aInterceptedURL[DISPATCH_EDITDOC] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:EditDoc")); m_aInterceptedURL[DISPATCH_RELOAD] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Reload")); } @@ -248,13 +246,6 @@ if ( xDispatch.is() ) xDispatch->dispatch( _URL, Arguments ); } - else if ( _URL.Complete == m_aInterceptedURL[DISPATCH_EDITDOC] ) - { - Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch( - _URL, ::rtl::OUString::createFromAscii( "_self" ), 0 ); - if ( xDispatch.is() ) - xDispatch->dispatch( _URL, Arguments ); - } } void SAL_CALL @@ -306,23 +297,6 @@ Reference< ::com::sun::star::document::XEventBroadcaster> xEvtB(m_pContentHolder->getComponent(),UNO_QUERY); if ( xEvtB.is() ) xEvtB->addEventListener(this); - } - else if ( m_pContentHolder && _URL.Complete == m_aInterceptedURL[DISPATCH_EDITDOC] ) - { // EditDoc - FeatureStateEvent aStateEvent; - aStateEvent.FeatureURL.Complete = m_aInterceptedURL[DISPATCH_EDITDOC]; - aStateEvent.FeatureDescriptor = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Update")); - aStateEvent.IsEnabled = m_bAllowEditDoc; - aStateEvent.Requery = sal_False; - - Control->statusChanged(aStateEvent); - { - osl::MutexGuard aGuard(m_aMutex); - if(!m_pStatCL) - m_pStatCL = new PropertyChangeListenerContainer(m_aMutex); - } - - m_pStatCL->addInterface(_URL.Complete,Control); } else { Directory: /dba/dbaccess/source/core/inc/ ========================================= File [changed]: core_resource.hrc Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/inc/core_resource.hrc?r1=1.9&r2=1.9.78.1 Delta lines: +4 -3 ------------------- --- core_resource.hrc 2 Aug 2004 15:13:50 -0000 1.9 +++ core_resource.hrc 28 Jan 2005 12:19:40 -0000 1.9.78.1 @@ -106,6 +106,7 @@ #define RID_STR_FORM ( RID_CORE_STRINGS_START + 32 ) #define RID_STR_REPORT ( RID_CORE_STRINGS_START + 33 ) #define RID_STR_DATASOURCE_NOT_STORED ( RID_CORE_STRINGS_START + 34 ) +#define RID_STR_FILE_DOES_NOT_EXIST ( RID_CORE_STRINGS_START + 35 ) #endif // _DBA_CORE_RESOURCE_HRC_ Directory: /dba/dbaccess/source/core/resource/ ============================================== File [changed]: strings.src Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/resource/strings.src?r1=1.45&r2=1.45.12.1 Delta lines: +8 -4 ------------------- --- strings.src 5 Jan 2005 12:29:52 -0000 1.45 +++ strings.src 28 Jan 2005 12:19:41 -0000 1.45.12.1 @@ -245,4 +245,8 @@ Text [ de ] = "Der Treiber unterst�tzt das Ver�ndern einer Spaltendefinition, anhand des Indexes, nicht."; Text [ en-US ] = "The driver does not support the modification of column descriptions by changing the index."; }; - +String RID_STR_FILE_DOES_NOT_EXIST +{ + Text [ de ] ="Die Datei \"$file$\" existiert nicht."; + Text[ en-US ] = "The file \"$file$\" does not exist."; +}; Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.12&r2=1.12.2.1 Delta lines: +14 -2 -------------------- --- AppController.cxx 21 Jan 2005 17:05:05 -0000 1.12 +++ AppController.cxx 28 Jan 2005 12:19:41 -0000 1.12.2.1 @@ -519,7 +519,7 @@ Reference<XConnection> xCon(_rSource.Source, UNO_QUERY); if ( xCon.is() ) { - if ( getContainer()&& getContainer()->getElementType() == E_TABLE ) + if ( getContainer() && getContainer()->getElementType() == E_TABLE ) { TDataSourceConnections::iterator aIter = m_aDataSourceConnections.begin(); TDataSourceConnections::iterator aEnd = m_aDataSourceConnections.end(); @@ -528,6 +528,7 @@ if ( aIter->second.is() && aIter->second == xCon ) { getContainer()->clearPages(); + m_aDataSourceConnections.erase(aIter); break; } } @@ -1049,9 +1050,15 @@ case ID_BROWSER_SAVEASDOC: { WinBits nBits(WB_STDMODAL|WB_SAVEAS); + Reference<XModel> xModel(m_xDataSource,UNO_QUERY); + ::rtl::OUString sUrl; + if ( xModel.is() ) + sUrl = xModel->getURL(); + if ( !sUrl.getLength() ) + sUrl = SvtPathOptions().GetWorkPath(); ::sfx2::FileDialogHelper aFileDlg( ::sfx2::FILESAVE_AUTOEXTENSION,static_cast<sal_uInt32>(nBits) ,getView()); - aFileDlg.SetDisplayDirectory( SvtPathOptions().GetWorkPath() ); + aFileDlg.SetDisplayDirectory( sUrl ); const SfxFilter* pFilter = getStandardDatabaseFilter(); if ( pFilter ) @@ -1073,6 +1080,11 @@ updateTitle(); m_bCurrentlyModified = sal_False; InvalidateFeature(ID_BROWSER_SAVEDOC); + if ( getContainer()->getElementType() == E_NONE ) + { + getContainer()->changeContainer(E_NONE); + getContainer()->changeContainer(E_TABLE); + } } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
