User: rt      
Date: 05/02/02 06:01:32

Modified:
 /dba/dbaccess/source/core/dataaccess/
  databasedocument.cxx

Log:
 INTEGRATION: CWS imprec01 (1.7.12); FILE MERGED
 2005/02/02 06:20:54 as 1.7.12.4: resolve conflicts after resync
 2005/01/12 12:56:23 oj 1.7.12.3: #i39228# send document events
 2005/01/11 13:59:33 oj 1.7.12.2: #i39228# send document events
 2005/01/11 08:58:23 oj 1.7.12.1: #i39228# send document events

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.8&r2=1.9
Delta lines:  +37 -11
---------------------
--- databasedocument.cxx        21 Jan 2005 17:03:37 -0000      1.8
+++ databasedocument.cxx        2 Feb 2005 14:01:30 -0000       1.9
@@ -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 )
@@ -483,7 +497,8 @@
                        
                }
                m_aArgs = lArguments;
-               store();
+               store(m_sFileURL,m_aArgs);
+        
notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnSaveAsDone")));
        }
        else
                throw IOException();
@@ -546,6 +561,7 @@
                m_bModified = _bModified;
                lang::EventObject aEvt(*this);
                NOTIFY_LISTERNERS(m_aModifyListeners,XModifyListener,modified)
+        
notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnModifyChanged")));
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -837,11 +853,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);
 
@@ -1072,6 +1088,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;
@@ -1091,6 +1116,7 @@
        }
        return bStore;
 }
+
 //........................................................................
 }      // namespace dbaccess
 //........................................................................




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to