Tag: cws_src680_dba23 User: oj Date: 05/02/11 02:10:12 Modified: /dba/dbaccess/source/core/dataaccess/ databasedocument.cxx
Log: RESYNC: (1.8-1.9); FILE MERGED File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: databasedocument.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.7.16.2&r2=1.7.16.3 Delta lines: +37 -11 --------------------- --- databasedocument.cxx 3 Feb 2005 08:06:47 -0000 1.7.16.2 +++ databasedocument.cxx 11 Feb 2005 10:10:09 -0000 1.7.16.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 ) @@ -487,7 +501,8 @@ m_sFileURL = sURL; } m_aArgs = lArguments; - store(); + store(m_sFileURL,m_aArgs); + notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnSaveAsDone"))); } else throw IOException(); @@ -550,6 +565,7 @@ m_bModified = _bModified; lang::EventObject aEvt(*this); NOTIFY_LISTERNERS(m_aModifyListeners,XModifyListener,modified) + notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnModifyChanged"))); } } // ----------------------------------------------------------------------------- @@ -841,11 +857,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); @@ -1076,6 +1092,15 @@ m_aFlushListeners.removeInterface(_xListener); } // ----------------------------------------------------------------------------- +void ODatabaseSource::notifyEvent(const ::rtl::OUString& _sEventName) +{ + if ( m_xDocEventBroadcaster.is() ) + { + ::com::sun::star::document::EventObject aEvent(*this, _sEventName); + m_xDocEventBroadcaster->notifyEvent(aEvent); + } +} +// ----------------------------------------------------------------------------- sal_Bool ODatabaseSource::commitEmbeddedStorage() { sal_Bool bStore = sal_False; @@ -1095,6 +1120,7 @@ } return bStore; } + //........................................................................ } // namespace dbaccess //........................................................................ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
