Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-07-28 06:25:52+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentevents.cxx

Log:
 #i76128#

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: documentevents.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentevents.cxx?r1=1.1.2.3&r2=1.1.2.4
Delta lines:  +49 -28
---------------------
--- documentevents.cxx  2008-07-23 10:07:36+0000        1.1.2.3
+++ documentevents.cxx  2008-07-28 06:25:50+0000        1.1.2.4
@@ -7,7 +7,7 @@
 *
 * $RCSfile: documentevents.cxx,v $
 *
-* $Revision: 1.1.2.3 $
+* $Revision: 1.1.2.4 $
 *
 * This file is part of OpenOffice.org.
 *
@@ -27,9 +27,10 @@
 * for a copy of the LGPLv3 License.
 ************************************************************************/
 
-#ifndef DBACCESS_DOCUMENTEVENTS_HXX
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_dbaccess.hxx"
+
 #include "documentevents.hxx"
-#endif
 
 /** === begin UNO includes === **/
 #include <com/sun/star/beans/PropertyValue.hpp>
@@ -82,38 +83,58 @@
     };
 
     //====================================================================
+    //= helper
+    //====================================================================
+    struct DocumentEventData
+    {
+        const sal_Char* pAsciiEventName;
+        bool            bNeedsSyncNotify;
+    };
+
+    //--------------------------------------------------------------------
+    namespace
+    {
+        static const DocumentEventData* lcl_getDocumentEventData()
+        {
+            static const DocumentEventData s_aData[] = {
+                { "OnCreate",               true  },
+                { "OnLoadFinished",         true  },
+                { "OnNew",                  false },    // compatibility, see 
http://www.openoffice.org/issues/show_bug.cgi?id=46484
+                { "OnLoad",                 false },    // compatibility, see 
http://www.openoffice.org/issues/show_bug.cgi?id=46484
+                { "OnSaveAs",               true  },
+                { "OnSaveAsDone",           false },
+                { "OnSaveAsFailed",         false },
+                { "OnSave",                 true  },
+                { "OnSaveDone",             false },
+                { "OnSaveFailed",           false },
+                { "OnPrepareUnload",        true  },
+                { "OnUnload",               true  },
+                { "OnFocus",                false },
+                { "OnUnfocus",              false },
+                { "OnModifyChanged",        false },
+                { "OnViewCreated",          false },
+                { "OnPrepareViewClosing",   true  },
+                { "OnViewClosed",           false },
+                { "OnTitleChanged",         false },
+                { NULL, false }
+            };
+            return s_aData;
+        }
+    }
+
+    //====================================================================
     //= DocumentEvents
     //====================================================================
     //--------------------------------------------------------------------
     DocumentEvents::DocumentEvents( ::cppu::OWeakObject& _rParent, 
::osl::Mutex& _rMutex )
         :m_pData( new DocumentEvents_Data( _rParent, _rMutex ) )
     {
-        static const sal_Char* s_pSupportedEventNames[] = {
-            "OnCreate",
-            "OnLoadFinished",
-            "OnNew",                // compatibility event, see 
http://www.openoffice.org/issues/show_bug.cgi?id=46484
-            "OnLoad",               // compatibility event, see 
http://www.openoffice.org/issues/show_bug.cgi?id=46484
-            "OnSaveAs",
-            "OnSaveAsDone",
-            "OnSaveAsFailed",
-            "OnSave",
-            "OnSaveDone",
-            "OnSaveFailed",
-            "OnPrepareUnload",
-            "OnUnload",
-            "OnFocus",
-            "OnUnfocus",
-            "OnModifyChanged",
-            "OnViewCreated",
-            "OnPrepareViewClosing",
-            "OnViewClosed",
-            "OnTitleChanged"
-        };
-
-        for (   size_t i=0; i < sizeof( s_pSupportedEventNames ) / sizeof( 
s_pSupportedEventNames[0] ); ++i )
+        const DocumentEventData* pEventData = lcl_getDocumentEventData();
+        while ( pEventData->pAsciiEventName )
         {
-            m_pData->aEventDescs[ ::rtl::OUString::createFromAscii( 
s_pSupportedEventNames[i] ) ] =
+            m_pData->aEventDescs[ ::rtl::OUString::createFromAscii( 
pEventData->pAsciiEventName ) ] =
                 Sequence< PropertyValue >();
+            ++pEventData;
         }
     }
 
@@ -147,7 +168,7 @@
         if ( _Element.hasValue() && !( _Element >>= aEventDescriptor ) )
             throw IllegalArgumentException( _Element.getValueTypeName(), 
*this, 2 );
 
-        // Weird enough, the event assignment UI has the idea of using an 
empty "EventType"
+        // Weird enough, the event assignment UI has (well: had) the idea of 
using an empty "EventType"
         // to indicate the event descriptor should be reset.
         ::comphelper::NamedValueCollection aCheck( aEventDescriptor );
         if ( aCheck.has( "EventType" ) )




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

Reply via email to