Commits

Anonymous committed f961c95

comment ...

Comments (0)

Files changed (92)

editeng/source/editeng/editdoc.cxx

 	4035, 4036, 4037, 4038
 };
 
-//SV_IMPL_PTRARR( DummyContentList, ContentNode* );
-//SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo );
-//SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo );
+SV_IMPL_PTRARR( DummyContentList, ContentNode* );
+SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo );
+SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo );
 // SV_IMPL_VARARR( ExtraCharInfos, ExtraCharInfo );
-SV_IMPL_PTRARR_CRITICAL( DummyContentList, ContentNode* );
-SV_IMPL_VARARR_CRITICAL( ScriptTypePosInfos, ScriptTypePosInfo );
-SV_IMPL_VARARR_CRITICAL( WritingDirectionInfos, WritingDirectionInfo );
+
 
 int SAL_CALL CompareStart( const void* pFirst, const void* pSecond )
 {

editeng/source/editeng/editdoc.hxx

 #include <svl/style.hxx>
 #include <svl/itempool.hxx>
 #include <tools/table.hxx>
-#include <svl/svarray2.hxx>
 
 class ImpEditEngine;
 class SvxTabStop;
 	}
 };
 
-//SV_DECL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo, 0, 4 )
-SV_DECL_VARARR_CRITICAL( ScriptTypePosInfos, ScriptTypePosInfo, 0, 4 )
+SV_DECL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo, 0, 4 )
 
 struct WritingDirectionInfo
 {
 	}
 };
 
-//SV_DECL_VARARR( WritingDirectionInfos, WritingDirectionInfo, 0, 4 )
-SV_DECL_VARARR_CRITICAL( WritingDirectionInfos, WritingDirectionInfo, 0, 4 )
+SV_DECL_VARARR( WritingDirectionInfos, WritingDirectionInfo, 0, 4 )
 
 typedef EditCharAttrib* EditCharAttribPtr;
 SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0, 4 )
 };
 
 typedef ContentNode* ContentNodePtr;
-//SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 )
-SV_DECL_PTRARR_CRITICAL( DummyContentList, ContentNodePtr, 0, 4 )
+SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 )
 
 class ContentList : public DummyContentList
 {

sal/osl/w32/MAKEFILE.MK

 # --- Settings -----------------------------------------------------
 
 .INCLUDE :  settings.mk
-.INCLUDE: $(PRJ)$/util$/makefile.pmk
 
 # Uncomment the following line if you want to compile with -Wall
 # it disables lots of unnecessary warnings comming from the Win32
 
 SLOFILES=   $(SLO)$/conditn.obj  \
             $(SLO)$/diagnose.obj \
-            $(SLO)$/dllinit.obj \
             $(SLO)$/dllentry.obj \
             $(SLO)$/semaphor.obj \
             $(SLO)$/socket.obj   \

sal/osl/w32/dllentry.c

 extern oslMutex         g_Mutex;
 extern oslMutex         g_CurrentDirectoryMutex;
 
-extern oslMutex SAL_CALL _osl_createMutex_(void);
-extern void SAL_CALL _osl_destroyMutex_(oslMutex Mutex);
-
-extern void SAL_CALL _init_(void);
-extern void SAL_CALL _finit_(void);
-
 extern void rtl_locale_fini (void);
 extern void rtl_memory_fini (void);
 extern void rtl_cache_fini (void);
                 SetErrorMode( SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS );
 
                 /* initialize global mutex */
-                g_Mutex = _osl_createMutex_();
+                g_Mutex = osl_createMutex();
 
                 /* initialize "current directory" mutex */
-                g_CurrentDirectoryMutex = _osl_createMutex_();
+                g_CurrentDirectoryMutex = osl_createMutex();
 
-      			_init_();
+      
                 /* initialize Win9x unicode functions */                
                 aInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
 
             TlsFree( g_dwTLSTextEncodingIndex );
             DeleteCriticalSection( &g_ThreadKeyListCS );
 
-			_finit_();
-			
-            _osl_destroyMutex_( g_Mutex );
+            osl_destroyMutex( g_Mutex );
 
-            _osl_destroyMutex_( g_CurrentDirectoryMutex );           
-            
-			
+            osl_destroyMutex( g_CurrentDirectoryMutex );
 
 #ifndef __MINGW32__
 

sal/osl/w32/mutex.c

 
 #include <osl/mutex.h>
 #include <osl/diagnose.h>
-#include <rtl/alloc.h>
+
 /*
 	Implementation notes:
 	The void* hidden by oslMutex points to a WIN32
 
 static CRITICAL_SECTION MutexLock;
 
-oslMutex SAL_CALL _osl_createMutex_(void)
+/*****************************************************************************/
+/* osl_createMutex */
+/*****************************************************************************/
+oslMutex SAL_CALL osl_createMutex(void)
 {
 	oslMutexImpl *pMutexImpl;
 
 	return (oslMutex)pMutexImpl;
 }
 
-void SAL_CALL _osl_destroyMutex_(oslMutex Mutex)
-{
-	oslMutexImpl *pMutexImpl = (oslMutexImpl *)Mutex;
-
-	if (pMutexImpl)
-	{
-		DeleteCriticalSection(&pMutexImpl->m_Mutex);
-		free(pMutexImpl);
-	}
-}
-
-/*****************************************************************************/
-/* osl_createMutex */
-/*****************************************************************************/
-oslMutex SAL_CALL osl_createMutex(void)
-{
-	oslMutexImpl *pMutexImpl;
-	/* Window 95 does not support "TryEnterCriticalSection" */
-	pMutexImpl= rtl_allocateMemory(sizeof(oslMutexImpl));
-
-	OSL_ASSERT(pMutexImpl); /* alloc successful? */
-	InitializeCriticalSection(&pMutexImpl->m_Mutex);
-	return (oslMutex)pMutexImpl;
-}
 /*****************************************************************************/
 /* osl_destroyMutex */
 /*****************************************************************************/
 	if (pMutexImpl)
 	{
 		DeleteCriticalSection(&pMutexImpl->m_Mutex);
-		rtl_freeMemory(pMutexImpl);
+		free(pMutexImpl);
 	}
 }
 

sal/rtl/source/alloc_arena.c

 	sal_Size         size   = sizeof(rtl_arena_type);
 
     (void) flags; /* unused */
-    ////
-	EnterMemoryCritical();
+
 try_alloc:
 	result = (rtl_arena_type*)rtl_arena_alloc (gp_arena_arena, &size);
 	if (result != 0)
 			goto try_alloc;
 		}
 	}
-	LeaveMemoryCritical();
 	return (result);
 }
 
 	rtl_arena_type * arena
 ) 
 {
-	EnterMemoryCritical();
 	if (arena != 0)
 	{
 		rtl_arena_deactivate (arena);
 		rtl_arena_destructor (arena);
 		rtl_arena_free (gp_arena_arena, arena, sizeof(rtl_arena_type));
 	}
-	LeaveMemoryCritical();
 }
 
 /** rtl_arena_alloc()
 ) SAL_THROW_EXTERN_C()
 {
 	void * addr = 0;
-	EnterMemoryCritical();
+
 	if ((arena != 0) && (pSize != 0))
 	{
 		sal_Size size = RTL_MEMORY_ALIGN((*pSize), arena->m_quantum);
 				(*pSize) = size;
 		}
 	}
-	LeaveMemoryCritical();
 	return (addr);
 }
 
 	sal_Size         size
 ) SAL_THROW_EXTERN_C()
 {
-	EnterMemoryCritical();
 	if (arena != 0)
 	{
 		size = RTL_MEMORY_ALIGN(size, arena->m_quantum);
 						RTL_MEMORY_LOCK_RELEASE(&(arena->m_lock));
 
 						(arena->m_source_free)(arena->m_source_arena, addr, size);
-						LeaveMemoryCritical();
 						return;
 					}
 				}
 			rtl_cache_free (arena->m_qcache_ptr[index], addr);
 		}
 	}
-	LeaveMemoryCritical();
 }
 
 /* ================================================================= *

sal/rtl/source/alloc_cache.c

 {
 	rtl_cache_type * result = 0;
 	sal_Size         size   = sizeof(rtl_cache_type);
-	////
-	EnterMemoryCritical();
+
 try_alloc:
 	result = (rtl_cache_type*)rtl_arena_alloc (gp_cache_arena, &size);
 	if (result != 0)
 			goto try_alloc;
 		}
 	}
-	////
-	LeaveMemoryCritical();
-	
 	return (result);
 }
 
     rtl_cache_type * cache
 ) SAL_THROW_EXTERN_C()
 {
-	////
-	EnterMemoryCritical();
 	if (cache != 0)
 	{
 		rtl_cache_deactivate (cache);
 		rtl_cache_destructor (cache);
 		rtl_arena_free (gp_cache_arena, cache, sizeof(rtl_cache_type));
 	}
-	/////
-	LeaveMemoryCritical();
 }
 
 /** rtl_cache_alloc()
 ) SAL_THROW_EXTERN_C()
 {
 	void * obj = 0;
-	////
-	EnterMemoryCritical();
+
 	if (cache == 0)
-	{
-		////
-		LeaveMemoryCritical();
 		return (0);
-	}
 
 	if (cache->m_cpu_curr != 0)
 	{
 				obj = curr->m_objects[--curr->m_mag_used];
 				cache->m_cpu_stats.m_alloc += 1;
 				RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
-				////
-				LeaveMemoryCritical();
+
 				return (obj);
 			}
 
 			rtl_cache_slab_free (cache, obj), obj = 0;
 		}
 	}
-	////
-	LeaveMemoryCritical();
+
 	return (obj);
 }
 
     void *           obj
 ) SAL_THROW_EXTERN_C()
 {
-	////
-	EnterMemoryCritical();
 	if ((obj != 0) && (cache != 0))
 	{
 		RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
 				curr->m_objects[curr->m_mag_used++] = obj;
 				cache->m_cpu_stats.m_free += 1;
 				RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
-				LeaveMemoryCritical();
+
 				return;
 			}
 
 		/* return buffer to slab layer */
 		rtl_cache_slab_free (cache, obj);
 	}
-	////
-	LeaveMemoryCritical();
 }
 
 /* ================================================================= *
 {
 	{
 		/* list of caches */
-		//RTL_MEMORY_LOCK_INIT(&(g_cache_list.m_lock));
+		RTL_MEMORY_LOCK_INIT(&(g_cache_list.m_lock));
 		(void) rtl_cache_constructor (&(g_cache_list.m_cache_head));
 	}
 	{
 }
 
 /* ================================================================= */
-
-void InitMemoryCritical()
-{
-	RTL_MEMORY_LOCK_INIT(&(g_cache_list.m_lock));
-}
-
-void FinitMemoryCritical()
-{
-	RTL_MEMORY_LOCK_DESTROY(&(g_cache_list.m_lock));
-}
-
-void EnterMemoryCritical()
-{
-	RTL_MEMORY_LOCK_ACQUIRE(&(g_cache_list.m_lock));
-}
-
-void LeaveMemoryCritical()
-{
-	RTL_MEMORY_LOCK_RELEASE(&(g_cache_list.m_lock));
-}

sal/rtl/source/alloc_global.c

 SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
 {
 	void * p = 0;
-	EnterMemoryCritical();
 	if (n > 0)
 	{
 		char *     addr;
 		OSL_ASSERT(RTL_MEMALIGN >= sizeof(sal_Size));
 		if (n >= SAL_MAX_SIZE - (RTL_MEMALIGN + RTL_MEMALIGN - 1))
 		{
-			LeaveMemoryCritical();
 			/* requested size too large for roundup alignment */
 			return 0;
 		}
 			}
 		}
 	}
-	LeaveMemoryCritical();
 	return (p);
 }
 
 
 void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
 {
-	EnterMemoryCritical();
 	if (p != 0)
 	{
 		char *   addr = (char*)(p) - RTL_MEMALIGN;
 		else
 			rtl_arena_free (gp_alloc_arena, addr, size);
 	}
-	LeaveMemoryCritical();
 }
 
 /* ================================================================= */
 
 void * SAL_CALL rtl_allocateMemory (sal_Size n)
 {
-	void * result = NULL;
-	EnterMemoryCritical();
-	result = malloc (n);
-	LeaveMemoryCritical();
-	return result;
+	return malloc (n);
 }
 
 /* ================================================================= */
 
 void SAL_CALL rtl_freeMemory (void * p)
 {
-	EnterMemoryCritical();
 	free (p);
-	LeaveMemoryCritical();
 }
 
 /* ================================================================= */
 
 void * SAL_CALL rtl_reallocateMemory (void * p, sal_Size n)
 {
-	void * result = NULL;
-	EnterMemoryCritical();
-	result = realloc (p, n);;
-	LeaveMemoryCritical();
-	return result;
+	return realloc (p, n);
 }
 
 /* ================================================================= */

sal/rtl/source/alloc_impl.h

 #define RTL_CACHE_FLAG_NOMAGAZINE   (1 << 13) /* w/o magazine layer */
 #define RTL_CACHE_FLAG_QUANTUMCACHE (2 << 13) /* used as arena quantum cache */
 
-void EnterMemoryCritical();
-void LeaveMemoryCritical();
-
-void SAL_CALL InitMemoryCritical();
-void SAL_CALL FinitMemoryCritical();
-
 
 #ifdef __cplusplus
 }

sal/util/makefile.mk

 # --- Settings -----------------------------------------------------
 
 .INCLUDE :  settings.mk
-.INCLUDE: $(PRJ)$/util$/makefile.pmk
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
         rtl_tres_destroy;
 		osl_getProcessLocale;
 		osl_setProcessLocale;
-		
-		
-		osl_isParallel;
-		osl_enterStructSection;
-		osl_leaveStructSection
-		osl_getParallelMutex;
-		
     local:
         *;
 };

sd/inc/drawdoc.hxx

 #endif
 #include "sddllapi.h"
 #include "sdpage.hxx"
-#include "shapelist_critical.hxx"
 
 namespace com
 {
 	::sd::Outliner*		mpInternalOutliner;  // internal outliner for creation of text objects
 	Timer*			    mpWorkStartupTimer;
 	Timer*              mpOnlineSpellingTimer;
-	//sd::ShapeList*		mpOnlineSpellingList;
-	sd::ShapeListCritical*	mpOnlineSpellingList;	
+	sd::ShapeList*		mpOnlineSpellingList;
 	SvxSearchItem*      mpOnlineSearchItem;
 	List*               mpFrameViewList;
 	List*               mpCustomShowList;

sd/source/core/drawdoc4.cxx

 
 		pOutl->SetDefaultLanguage( meLanguage );
 
-		mpOnlineSpellingList = new ShapeListCritical;
+		mpOnlineSpellingList = new ShapeList;
 		USHORT nPage;
 
 		for ( nPage = 0; nPage < GetPageCount(); nPage++ )

sd/source/core/makefile.mk

            $(SLO)$/undoanim.obj\
            $(SLO)$/EffectMigration.obj\
            $(SLO)$/CustomAnimationCloner.obj\
-           $(SLO)$/shapelist.obj\
-           $(SLO)$/shapelist_critical.obj
+           $(SLO)$/shapelist.obj
 
 # --- Tagets -------------------------------------------------------
 

sd/source/core/sdpage.cxx

 #include <svx/sdr/contact/viewcontact.hxx>
 #include <svx/sdr/contact/objectcontact.hxx>
 #include <svx/unoapi.hxx>
-#include <osl/mutex_help.hxx>
+
 #include <set>
 
 using namespace ::sd;
 */
 SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rectangle& rRect, BOOL /* bInsert */ )
 {
-	PARALLEL_GUARD();
 	sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
 	const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted();
 
 		default:
 			break;
 	}
-	
+
 	if (pSdrObj)
 	{
 		pSdrObj->SetEmptyPresObj(bEmptyPresObj);
 	{
 		return;
 	}
-	PARALLEL_GUARD();
+
 	/**************************************************************************
 	* Hintergrund, Titel- und Layout-Bereich werden angelegt
 	**************************************************************************/

svl/inc/svl/undo.hxx

 #include <tools/rtti.hxx>
 #include <tools/string.hxx>
 #include <svl/svarray.hxx>
-#include <svl/svarray2.hxx>
+
 //====================================================================
 
 class SVL_DLLPUBLIC SfxRepeatTarget
 
 //========================================================================
 
-//SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 )
-SV_DECL_PTRARR_CRITICAL( SfxUndoActions, SfxUndoAction*, 20, 8 )
+SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 )
+
 //====================================================================
 
 /** do not make use of this implementation details, unless you

svl/source/items/style.cxx

 #define _SVSTDARR_STRINGSSORTDTOR
 #define _SVSTDARR_BYTESTRINGS
 #define _SVSTDARR_BYTESTRINGSSORTDTOR
-#include <osl/mutex_help.hxx>
+
 #include <rtl/uuid.h>
 #include <tools/tenccvt.hxx>
 #include <comphelper/processfactory.hxx>
 
 void SfxStyleSheetBasePool::Insert( SfxStyleSheetBase* p )
 {
-	STRUCT_GUARD();
 	DBG_ASSERT( p, "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?" );
 
 	SfxStyleSheetIterator aIter(this, p->GetFamily(), p->GetMask());

svl/source/memtools/makefile.mk

 # --- Files --------------------------------------------------------
 
 SLOFILES=\
-	$(SLO)$/svarray.obj	\
-	$(SLO)$/svarray_critical.obj
+	$(SLO)$/svarray.obj
 
 # --- Targets -------------------------------------------------------
 

svl/source/notify/brdcst.cxx

 		for ( USHORT n = 0; n < aListeners.Count(); ++n )
 		{
 			SfxListener* pListener = aListeners[n];
-			/*
 			if ( pListener )
 				pListener->Notify( *this, rHint );
-				*/
 		}
 	}
 }

svx/inc/svx/svdmodel.hxx

 #include <sot/storage.hxx>
 #include <tools/link.hxx>
 #include <tools/contnr.hxx>
-#include <tools/contnr_critical.hxx>
 #include <tools/weakbase.hxx>
 #include <vcl/mapmod.hxx>
 #include <svl/brdcst.hxx>
 {
 protected:
 	DateTime       aReadDate;  // Datum des Einstreamens
-	//Container      maMaPag;     // StammSeiten (Masterpages)
-	//Container      maPages;
-	ContainerCritical	maMaPag;// StammSeiten (Masterpages)
-	ContainerCritical	maPages;
+	Container      maMaPag;     // StammSeiten (Masterpages)
+	Container      maPages;
 	Link           aUndoLink;  // Link fuer einen NotifyUndo-Handler
 	Link           aIOProgressLink;
 	String         aTablePath;

svx/source/svdraw/svdmodel.cxx

 
 void SdrModel::RecalcPageNums(FASTBOOL bMaster)
 {
-	//Container& rPL=*(bMaster ? &maMaPag : &maPages);
-	ContainerCritical& rPL=*(bMaster ? &maMaPag : &maPages);
+	Container& rPL=*(bMaster ? &maMaPag : &maPages);
 	USHORT nAnz=USHORT(rPL.Count());
 	USHORT i;
 	for (i=0; i<nAnz; i++) {
 ..\inc\tools\chapi.hxx %_DEST%\inc%_EXT%\tools\chapi.hxx
 ..\inc\tools\color.hxx %_DEST%\inc%_EXT%\tools\color.hxx
 ..\inc\tools\contnr.hxx %_DEST%\inc%_EXT%\tools\contnr.hxx
-..\inc\tools\contnr_critical.hxx %_DEST%\inc%_EXT%\tools\contnr_critical.hxx
 ..\inc\tools\date.hxx %_DEST%\inc%_EXT%\tools\date.hxx
 ..\inc\tools\datetime.hxx %_DEST%\inc%_EXT%\tools\datetime.hxx
 ..\inc\tools\debug.hxx %_DEST%\inc%_EXT%\tools\debug.hxx
 ..\inc\tools\inetstrm.hxx %_DEST%\inc%_EXT%\tools\inetstrm.hxx
 ..\inc\tools\link.hxx %_DEST%\inc%_EXT%\tools\link.hxx
 ..\inc\tools\list.hxx %_DEST%\inc%_EXT%\tools\list.hxx
-..\inc\tools\list_critical.hxx %_DEST%\inc%_EXT%\tools\list_critical.hxx
 ..\inc\tools\mempool.hxx %_DEST%\inc%_EXT%\tools\mempool.hxx
 ..\inc\tools\multisel.hxx %_DEST%\inc%_EXT%\tools\multisel.hxx
 ..\inc\tools\ownlist.hxx %_DEST%\inc%_EXT%\tools\ownlist.hxx

tools/source/memtools/makefile.mk

 # --- Files --------------------------------------------------------
 
 SLOFILES=	$(SLO)$/contnr.obj	\
-			$(SLO)$/contnr_critical.obj	\
 			$(SLO)$/table.obj	\
 			$(SLO)$/unqidx.obj	\
 			$(SLO)$/mempool.obj \
 EXCEPTIONSFILES= $(SLO)$/multisel.obj $(OBJ)$/multisel.obj
 
 OBJFILES=	$(OBJ)$/contnr.obj	 \
-			$(SLO)$/contnr_critical.obj	\
 			$(OBJ)$/table.obj	 \
 			$(OBJ)$/unqidx.obj	 \
 			$(OBJ)$/mempool.obj  \

vcl/util/makefile2.pmk

 CDEFS += -DADAPT_EXT_STL
 .ENDIF
 .ENDIF
+
+
+.IF "$(GUI)"=="WNT"
+CDEFS += /openmp
+LINKFLAGS +=  VCOMP.LIB
+.ELSE
+CDEFS += -fopenmp
+LINKFLAGS += gomp
+.ENDIF

vcl/win/source/app/salinst.cxx

 #include <vcl/timer.hxx>
 #include <wincomp.hxx>	// CS_DROPSHADOW
 #include <tools/solarmutex.hxx>
-#include <osl/mutex_help.h>
+#include <omp.h>
 #ifndef min
 #define min(a,b)	(((a) < (b)) ? (a) : (b))
 #endif
 #endif
 
 // =======================================================================
+#define OSL_ISPARALLEL() omp_in_parallel() 
 
 void SalAbort( const XubString& rErrorText )
 {

xmloff/inc/xmloff2/compare.hxx

     }
 };
 //=============================================================
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+using namespace com::sun::star;
+
+typedef OdfInterfaceCompare< drawing::XDrawPage > ODrawPageCompare;
+DECLARE_STL_USTRINGACCESS_MAP
+    (uno::Reference<beans::XPropertySet >, MapString2PropertySet );
+
+DECLARE_STL_MAP
+	(uno::Reference<drawing::XDrawPage >,
+	 MapString2PropertySet,
+	 ODrawPageCompare,
+	 MapDrawPage2Map);
+	 
+typedef std::pair<uno::Reference<beans::XPropertySet >, rtl::OUString > ModelStringPair;
+
 
 #endif

xmloff/inc/xmloff2/helper/odfchartimporthelper.hxx

 using import::OdfImport;
 using import::core::OdfContext;
 using import::style2::OdfStylesContext;
+	
+class OdfPageChartHelper;
 //------------------------------------------------------------
 class OdfChartImportHelper
 :public XmloffSimpleReferenceObject
 protected:
     OdfImport* mp_odfImport;
 	rtl::Reference< OdfStylesContext> mrAutoStyles;
-    std::map<sal_Int16, uno::Reference<chart::XChartDocument> > mxChartDocumentMap;
+    
+    std::map<sal_Int32, OdfPageChartHelper*> m_pChartHelperMap;
 public:
     explicit OdfChartImportHelper(OdfImport* p_odfImport);
     ~OdfChartImportHelper();
     void setAutoStyles(OdfStylesContext* pAutoStyles );
 	OdfStylesContext* getAutoStyles() const ;
 
-	OdfContext* createChartContext(const sal_Int16& id, const sal_Int16& local, const uno::Reference< frame::XModel >& model);
-    const uno::Reference< chart::XChartDocument >& getChartDocument(const sal_Int16& id);
-
+	OdfPageChartHelper*	initChartHelper(const sal_Int32&);
+	void deInitChartHelper(const sal_Int32&);
+	OdfPageChartHelper*	getChartHelper(const sal_Int32&);    
+	
+	OdfContext* createChartContext(const sal_Int32& _i, const sal_Int16& local, const uno::Reference< frame::XModel >& model);
+    const uno::Reference< chart::XChartDocument >& getChartDocument(const sal_Int32& _i);
+	
 	static sal_Int32	GetNumberOfSeries(const uno::Reference< chart::XChartDocument > & xChartDoc);
 	static sal_Int32	GetLengthOfSeries(const uno::Reference< chart::XChartDocument > & xChartDoc);
 	static void		ResizeChartData(const uno::Reference< chart::XChartDocument > & xChartDoc,

xmloff/inc/xmloff2/helper/odfformimporthelper.hxx

 #ifndef _XMLOFF_HELPER_ODFFORMIMPORTHELPER_HXX_
 #define _XMLOFF_HELPER_ODFFORMIMPORTHELPER_HXX_
 
-#include <list>
 #include <xmloff2/dllapi.h>
 #include <xmloff2/compare.hxx>
-#include <xmloff2/helper/odfeventfactory.hxx>
 #include <xmloff2/helper/odfformimporthelper2.hxx>
 #include <xmloff2/helper/eventattachermanager.hxx>
 #include <xmloff2/helper/xmloffsimplereferenceobject.hxx>
 //#include <xmloff2/import/style/odfstylescontext.hxx>
 
-#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/form/XFormsSupplier2.hpp>
 //------------------------------------------------------------
 namespace import
 {
 }
 namespace helper
 {
+class OdfPageFormControlHelper;
+	
 using import::OdfImport;
 using import::core::OdfContext;
 using import::core::IOdfParentContext;
 protected:
     OdfImport*          mpImport;
     OdfStylesContext*   mpAutoStyles;
-    OdfAttribute2Property					maAttributeMetaData;
-    //=====================================================================
-    typedef OdfInterfaceCompare< drawing::XDrawPage > ODrawPageCompare;
-    DECLARE_STL_USTRINGACCESS_MAP
-    (uno::Reference<beans::XPropertySet >, MapString2PropertySet );
-	DECLARE_STL_MAP
-	(uno::Reference<drawing::XDrawPage >,
-	 MapString2PropertySet,
-	 ODrawPageCompare,
-	 MapDrawPage2Map);
-
-    typedef std::pair<uno::Reference<beans::XPropertySet >, rtl::OUString > ModelStringPair;
-    //=====================================================================
-    std::map<sal_Int16, uno::Reference<form::XFormsSupplier2> > mxSuppMap;
-    std::map<sal_Int16, MapDrawPage2Map>                        maControlIdsMap;// ids of the controls on all known page
-    std::map<sal_Int16, MapDrawPage2MapIterator>                maCurrentPageIdsMap;// ifs of the controls on the current page
-
-    std::map<sal_Int16, std::vector<ModelStringPair> >          maControlReferencesMap;
-    std::map<sal_Int16, std::vector<ModelStringPair> >          maCellValueBindingsMap;
-    std::map<sal_Int16, std::vector<ModelStringPair> >          maCellRangeListSourcesMap;
-    std::map<sal_Int16, std::vector<ModelStringPair> >          maXFormsValueBindingsMap;
-    std::map<sal_Int16, std::vector<ModelStringPair> >          maXFormsListBindingsMap;
-    std::map<sal_Int16, std::vector<ModelStringPair> >          maXFormsSubmissionsMap;
-    //=====================================================================
-    typedef std::map<rtl::OUString, OdfEventContextFactory* > FactoryMap;
-    typedef std::map<OdfEventName, rtl::OUString > NameMap;
-    typedef std::list< NameMap* > NameMapList;
-    //=====================================================================
-    FactoryMap maFactoryMap;
-    /// map from XML to API names
-    std::map<sal_Int16, NameMap* > mNameMap;
-	/// stack of previous aEventNameMap
-	std::map<sal_Int16, NameMapList> maNameListMap;
-
+    OdfAttribute2Property					maAttributeMetaData;    
+    
+//=====================================================================    
+	std::map<sal_Int32, OdfPageFormControlHelper*> m_pControlMap;
+	
+	std::vector<ModelStringPair>          maCellValueBindings;
+    std::vector<ModelStringPair>          maCellRangeListSources;
+    std::vector<ModelStringPair>          maXFormsValueBindings;
+    std::vector<ModelStringPair>          maXFormsListBindings;
+    std::vector<ModelStringPair>          maXFormsSubmissions;	
 public:
     explicit OdfFormImportHelper(OdfImport* pImport);
     ~OdfFormImportHelper();
-
+    
+	//=====================================================================
+public:
+	OdfPageFormControlHelper*	initControlHelper(const sal_Int32&);
+	void deInitControlHelper(const sal_Int32&);
+	OdfPageFormControlHelper*	getControlHelper(const sal_Int32&);    
+    //=====================================================================
     void setAutoStyles(OdfStylesContext* pAutoStyles );
     OdfContext* findStyle(const rtl::OUString& _name);
 
     void applyControlNumberStyle
     (const uno::Reference< beans::XPropertySet >& _rControl, const ::rtl::OUString& _rControlNumerStyleName);
     //=====================================================================
-    sal_Bool startPage
-    (const sal_Int16& id, const uno::Reference< drawing::XDrawPage >& xShapes);
-    sal_Bool endPage(const sal_Int16& id);
-
-    void enterEventContext(const sal_Int16& id);
-	void leaveEventContext(const sal_Int16& id);
-
-
-    void registerCellValue(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& xElement, const rtl::OUString& );
-    void registerCellRangeListSource(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& xElement, const rtl::OUString& );
-    void registerXFormsValue(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& xElement, const rtl::OUString& );
-    void registerXFormsList(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& xElement, const rtl::OUString& );
-    void registerXFormsSubmission(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& xElement, const rtl::OUString& );
-	void registerControlId(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& _rxControl, const ::rtl::OUString& _rId);
-	void registerControlReferences(const sal_Int16& id, const uno::Reference<beans::XPropertySet >& _rxControl, const rtl::OUString& _rReferringControls);
-
-    uno::Reference< beans::XPropertySet > lookupControl(const sal_Int16& id, const rtl::OUString& _rId);
-
-    //=====================================================================
     OdfContext* createContext(const sal_uInt32& _local, OdfImport* p_odfImport, IOdfParentContext* p_parentContext);
-    OdfContext* createEventContext
-                ( const sal_uInt32& _local,
-                  OdfImport* p_odfImport,
-                  IOdfParentContext* p_parentContext,
-                  /// the context for the enclosing <script:events> element
-                  /// the event name (as understood by the API)
-                  const ::rtl::OUString& rApiEventName,
-                  /// the event type name (as registered)
-                  const ::rtl::OUString& rApiLanguage);
+    
 
     OdfAttribute2Property&  getAttributeMap();
 

xmloff/inc/xmloff2/helper/odfshapeimporthelper.hxx

 using import::style2::OdfStylesContext;
 
 using import::core::IOdfParentContext;
+	
+class OdfPageShapeGlueHelper;
+class OdfPageShapeSortHelper;	
 //=====================================================================
 class OdfShapeImportHelper
 :public XmloffSimpleReferenceObject
     sal_Bool                                    mbHandleProgressBar;
     sal_Bool                                    mbIsPresentationShapesSupported;
     //=====================================================================
-    struct ConnectionHint
-    {
-        uno::Reference<drawing::XShape > mxConnector;
-        sal_Bool  mbStart;
-        rtl::OUString maDestShapeId;
-        sal_Int32 mnDestGlueId;
-    };
-    struct ltint32
-    {
-      bool operator()(const sal_Int32 p, sal_Int32 q) const
-      {
-        return p < q;
-      }
-    };
-    typedef std::map<sal_Int32, uno::Reference<drawing::XShape >, ltint32> IdShapeMap;
+    
+    std::map<sal_Int32, OdfPageShapeGlueHelper*> m_pGlueMap;
+    std::map<sal_Int32, OdfPageShapeSortHelper*> m_pSortMap;
 
-    struct XShapeCompareHelper
-    {
-      bool operator()(uno::Reference<drawing::XShape > x1,
-                      uno::Reference<drawing::XShape > x2 ) const
-      {
-        return x1.get() < x2.get();
-      }
-    };
-
-    /** this map store all glue point id mappings for shapes that had user defined glue points. This
-        is needed because on insertion the glue points will get a new and unique id */
-    typedef std::map<sal_Int32,sal_Int32,ltint32> GluePointIdMap;
-    typedef std::map<uno::Reference <drawing::XShape >, GluePointIdMap, XShapeCompareHelper > ShapeGluePointsMap;
-
-    /** this struct is created for each startPage() call and stores information that is needed during
-	import of shapes for one page. Since pages could be nested ( notes pages inside impress ) there
-	is a pointer so one can build up a stack of this structs */
-    struct ShapePageContextImpl
-    {
-        ShapeGluePointsMap		maShapeGluePointsMap;
-
-        uno::Reference < drawing::XShapes > mxShapes;
-
-        struct ShapePageContextImpl* mpNext;
-    };
-
-    // helper functions for z-order sorting
-    struct ZOrderHint
-    {
-        sal_Int32 nIs;
-        sal_Int32 nShould;
-
-        int operator<(const ZOrderHint& rComp) const
-        { return nShould < rComp.nShould; }
-    };
-    struct ShapeSortContext
-    {
-    public:
-        uno::Reference< drawing::XShapes > mxShapes;
-        std::list<ZOrderHint>			  maZOrderList;
-        std::list<ZOrderHint>			  maUnsortedList;
-
-        sal_Int32					  mnCurrentZ;
-        ShapeSortContext*			  mpParentContext;
-        const rtl::OUString				  msZOrder;
-
-        ShapeSortContext
-        (const uno::Reference< drawing::XShapes >& rShapes,
-         ShapeSortContext* pParentContext = NULL)
-        :mxShapes(rShapes)
-        ,mnCurrentZ( 0 )
-        ,mpParentContext(pParentContext)
-        ,msZOrder(RTL_CONSTASCII_USTRINGPARAM("ZOrder"))
-        {}
-
-        void moveShape(sal_Int32 nSourcePos, sal_Int32 nDestPos)
-        {
-            uno::Any aAny( mxShapes->getByIndex( nSourcePos ) );
-            uno::Reference< beans::XPropertySet > xPropSet;
-            aAny >>= xPropSet;
-
-            if( xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName( msZOrder ) )
-            {
-                aAny <<= nDestPos;
-                xPropSet->setPropertyValue( msZOrder, aAny );
-
-                std::list<ZOrderHint>::iterator aIter = maZOrderList.begin();
-                std::list<ZOrderHint>::iterator aEnd = maZOrderList.end();
-
-                while( aIter != aEnd )
-                {
-                    if( (*aIter).nIs < nSourcePos )
-                    {
-                        DBG_ASSERT( (*aIter).nIs >= nDestPos, "Shape sorting failed" );
-                        (*aIter).nIs++;
-                    }
-                    aIter++;
-                }
-
-                aIter = maUnsortedList.begin();
-                aEnd = maUnsortedList.end();
-
-                while( aIter != aEnd )
-                {
-                    if( (*aIter).nIs < nSourcePos )
-                    {
-                        DBG_ASSERT( (*aIter).nIs >= nDestPos, "shape sorting failed" );
-                        (*aIter).nIs++;
-                    }
-                    aIter++;
-                }
-            }
-        }
-    };
-    //=====================================================================
-    // context for sorting shapes
-	std::map<sal_Int16, ShapeSortContext* >		mpSortContextMap;
-    IdShapeMap maShapeIds;
-	std::vector<ConnectionHint> maConnections;
-	//
-	std::map<sal_Int16, ShapePageContextImpl*> mPageContextMap;
-	//ShapePageContextImpl*	       mpPageContext;
-protected:
-    sal_Bool    _restoreConnections(const sal_Int16& id);
-    sal_Int32   _getGluePointId
-                (const sal_Int16& id,
-                 uno::Reference<drawing::XShape >& xShape,
-                 sal_Int32 nSourceId);
 public:
     OdfShapeImportHelper
     (OdfImport* pImporter,
 	 const uno::Reference<frame::XModel>& rModel);
 
 	~OdfShapeImportHelper();
-
+public:
+	OdfPageShapeGlueHelper*	initGlueHelper(const sal_Int32&);
+	void deInitGlueHelper(const sal_Int32&);
+	OdfPageShapeGlueHelper*	getGlueHelper(const sal_Int32&);
+	
+	OdfPageShapeSortHelper*	initSortHelper(const sal_Int32&);
+	void deInitSortHelper(const sal_Int32&);
+	OdfPageShapeSortHelper*	getSortHelper(const sal_Int32&);
+public:
+	
 	OdfContext* createGroupContext
 	(const sal_uInt32& _local,
 	 IOdfParentContext* p_parentContext,
 
 //=====================================================================
 
-    sal_Bool pushGroupForSorting(const sal_Int16& id, const uno::Reference< drawing::XShapes >& xShapes);
-    sal_Bool popGroupAndSort(const sal_Int16& id);
-
-    sal_Bool shapeWithZIndexAdded
-        (const sal_Int16 id, const uno::Reference<drawing::XShape >& rShape, sal_Int32 nZIndex );
-
-    sal_Bool addShapeConnection
-    (const sal_Int16 id, uno::Reference< drawing::XShape >& rConnectorShape,
-	 sal_Bool bStart, const rtl::OUString& rDestShapeId, sal_Int32 nDestGlueId );
-
-	sal_Bool addGluePointMapping
-	(const sal_Int16 id, const uno::Reference< drawing::XShape >& xShape,
-	 sal_Int32 nSourceId, sal_Int32 nDestinnationId );
-
-	void moveGluePointMapping(const sal_Int16 id,
-        const uno::Reference< drawing::XShape >& xShape, const sal_Int32 n );
-
-    sal_Bool startPage(const sal_Int16 id, const uno::Reference< drawing::XShapes >& xShapes);
-    sal_Bool endPage(const sal_Int16 id);
-
 //=====================================================================
 	void enableHandleProgressBar( sal_Bool bEnable = sal_True );
 	sal_Bool isHandleProgressBarEnabled() const;
     sal_Bool isPresentationShapesSupported() const;
-
-
+    
     /** creates a property mapper for external chaining */
 	static StylePropertyImport* CreateShapePropImport
         (const uno::Reference<frame::XModel>& rModel, OdfImport* pImport );

xmloff/inc/xmloff2/helper/odftextimporthelper.hxx

 #include <xmloff2/dllapi.h>
 #include <xmloff2/helper/style/odfi18nmap.hxx>
 #include <xmloff2/helper/style/stylepropertyimport.hxx>
+
 #include <xmloff2/helper/xmloffsimplereferenceobject.hxx>
 
+
+#include <map>
 #include <rtl/ref.hxx>
 #include <svl/svstdarr.hxx>
-//#include <svtools/svstdarr.hxx>
-#include <comphelper/stl_types.hxx>
 
 #include <com/sun/star/text/XFormField.hpp>
 #include <com/sun/star/text/XTextCursor.hpp>
 #include <com/sun/star/container/XIndexReplace.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
 //------------------------------------------------------------
+
 namespace import
 {
     class OdfImport;
 //------------------------------------------------------------
 namespace helper
 {
+	class OdfTextCursorHelper;
+	class OdfBookmarkHelper;
+	class OdfFieldHelper;
+	class OdfFrameHelper;
+	class OdfTextListsHelper;
+
     using import::OdfImport;
     using import::core::OdfContext;
     using import::core::IFontStylesContext;
 #define ODF_TEXT_RENAME_TYPE_TABLE 20
 //=============================================================
 using helper::style3::OdfI18NMap;
+
+class OdfTextCursorHelper;
+class OdfBookmarkHelper;
+class OdfFieldHelper;
+class OdfFrameHelper;
 class OdfTextListsHelper;
 
+
 class OdfTextImportHelper
 :public XmloffSimpleReferenceObject
 {
+	friend class OdfTextCursorHelper;
 protected:
     //=============================================================
     OdfImport* mpImport;
     rtl::Reference< StylePropertyImport > mrSectionPropertyImport;
     rtl::Reference< StylePropertyImport > mrRubyPropertyImport;
     OdfI18NMap* mpRenameMap;
-    OdfTextListsHelper* mpListsHelper;
+    //OdfTextListsHelper* mpListsHelper;
 
     import::text2::OdfPropertyBackpatcher<sal_Int16>* mpFootnoteBackpatcher;
     import::text2::OdfPropertyBackpatcher<sal_Int16>* mpSequenceIdBackpatcher;
     import::text2::OdfPropertyBackpatcher<rtl::OUString>* mpSequenceNameBackpatcher;
 //=============================================================
-    std::map<sal_Int16, uno::Reference<text::XText> >        mxTextMap;
-	std::map<sal_Int16, uno::Reference <text::XTextCursor> > mxCursorMap;
-	std::map<sal_Int16, uno::Reference<text::XTextRange> >   mxCursorAsRangeMap;
-
-    typedef std::pair<rtl::OUString, rtl::OUString> FieldName;
-	typedef std::pair<rtl::OUString, rtl::OUString> FieldParam;
-	typedef std::vector<FieldParam> FieldParams;
-	typedef std::pair<FieldName, FieldParams> FieldStackItem;
-	typedef std::stack<FieldStackItem> FieldStack;
-	std::map<sal_Int16, FieldStack> maFieldStackMap;
-
-    std::map<sal_Int16, rtl::OUString> msOpenRedlineIdentifierMap;
-    std::map<sal_Int16, sal_Bool> mbInsideDeleteContextMap;
-
-    std::map<sal_Int16, rtl::Reference<OdfContext> > mxListBlockMap;
-    std::map<sal_Int16, rtl::Reference<OdfContext> > mxListItemMap;
-
-    std::map<sal_Int16, sal_Bool> mbBodyContentStartedMap;
-
-    /// start ranges for open bookmarks
-    typedef std::map<rtl::OUString,
-                // start range, xml:id
-             std::pair<uno::Reference<text::XTextRange>, rtl::OUString>,
-             comphelper::UStringLess> BookmarkStartRangesMap;
-    typedef std::vector<rtl::OUString> BookmarkVector;
-
-    std::map<sal_Int16, BookmarkStartRangesMap> maBookmarkStartRangesMap;
-    std::map<sal_Int16, BookmarkVector> maBookmarkVectorMap;
 
 protected:
     // odftextimporthelper2.cxx
                  const rtl::OUString& rStyleName,
                  sal_uInt8& rFlags,
                  sal_Bool bPara) const;
-
-    rtl::OUString setStyleAndAttrs( /* mp_odfImport, */
-                const uno::Reference<text::XTextCursor>& rCursor,
-                const rtl::OUString& rStyleName,
-                sal_Bool bPara,
-                sal_Bool bOutlineLevelAttrFound = sal_False,
-                sal_Int8 nOutlineLevel = -1,
-                sal_Bool bSetListAttrs = sal_True );
-
     /** Find a suitable name for the given outline level.
      *  If rStyleName is empty, change it to a previously used or default style
      *  name for that level. Otherwise, leave rStyleName unmodified.
 						  const rtl::OUString& sName,
 						  sal_Int16 nAPIId);
     void processSequenceReference(const rtl::OUString& sXMLId, const uno::Reference<beans::XPropertySet> & xPropSet);
-
-
-
-    uno::Reference<beans::XPropertySet>
-        createAndInsertOLEObject
-        (const rtl::OUString& /*rHRef*/, const rtl::OUString& /*rStyleName*/,
-		 const rtl::OUString& /*rTblName*/, sal_Int32 /*nWidth*/,
-		 sal_Int32 /*nHeight*/ );
-
-    uno::Reference<beans::XPropertySet>
-		createAndInsertOOoLink
-        (const rtl::OUString& /*rHRef*/, const rtl::OUString& /*rStyleName*/,
-		 const rtl::OUString& /*rTblName*/, sal_Int32 /*nWidth*/,
-		 sal_Int32 /*nHeight*/ );
-
-    uno::Reference<beans::XPropertySet>
-        createAndInsertApplet
-        (const rtl::OUString& /*rCode*/, const rtl::OUString& /*rName*/,
-		 sal_Bool /*bMayScript*/, const rtl::OUString& /*rHRef*/,
-		 sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ );
-
-    uno::Reference<beans::XPropertySet>
-        createAndInsertPlugin
-        (const rtl::OUString& /*rMimeType*/, const rtl::OUString& /*rHRef*/,
-		 sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ );
-
-    uno::Reference<beans::XPropertySet>
-		 createAndInsertFloatingFrame
-		 (const rtl::OUString& /*rName*/, const rtl::OUString& /*rHRef*/,
-		  const rtl::OUString& /*rStyleName*/, sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ );
-
-    void endAppletOrPlugin
-        (const uno::Reference<beans::XPropertySet> &rPropSet,
-         std::map<const rtl::OUString, rtl::OUString, comphelper::UStringLess > &rParamMap );
-
 //=============================================================
-    void setCursor
-        (const sal_Int16& id, const uno::Reference < text::XTextCursor >& rCursor );
-	void resetCursor(const sal_Int16& id);
-
-    uno::Reference< text::XText >& getText(const sal_Int16& id);
-	uno::Reference< text::XTextCursor >& getCursor(const sal_Int16& id);// { return xCursor; }
-	uno::Reference< text::XTextRange >& getCursorAsRange(const sal_Int16& id);// { return xCursor; }
-
-    sal_Bool isInFrame(const sal_Int16& id) const;
-    sal_Bool isInHeaderFooter(const sal_Int16& id) const;
-
-    void insertString(const sal_Int16& id, const rtl::OUString& rChars);
-    void insertString(const sal_Int16& id, const rtl::OUString& rChars, sal_Bool& rIgnoreLeadingSpace);
-    void insertControlCharacter(const sal_Int16& id, const sal_Int16& nControl);
-    void insertTextContent(const sal_Int16& id, const uno::Reference<text::XTextContent>& xContent);
-
-    void deleteParagraph(const sal_Int16& id);
-
-    /// save the start of a range reference
-	void insertBookmarkStartRange
-        (const sal_Int16& id, const rtl::OUString& sName, const uno::Reference<text::XTextRange> & rRange, const rtl::OUString& sXmlId);
-    sal_Bool findAndRemoveBookmarkStartRange
-        (const sal_Int16& id, const rtl::OUString sName,
-         uno::Reference<text::XTextRange>& o_rRange, rtl::OUString& rXmlId);
-
-    rtl::OUString findActiveBookmarkName(const sal_Int16& id);
-
-    void pushFieldCtx(const sal_Int16& id, const rtl::OUString& name, const rtl::OUString& type);
-	void popFieldCtx(const sal_Int16& id);
-	void addFieldParam(const sal_Int16& id, const rtl::OUString& name, const rtl::OUString& value);
-	void setCurrentFieldParamsTo
-        (const sal_Int16& id, uno::Reference<text::XFormField> &xFormField);
-	rtl::OUString getCurrentFieldName(const sal_Int16& id);
-	rtl::OUString getCurrentFieldType(const sal_Int16& id);
-	sal_Bool hasCurrentFieldCtx(const sal_Int16& id);
-
-    virtual void redlineAdd
-        (const sal_Int16& id,
-		 const rtl::OUString& rType,		/// redline type (insert, del,... )
-		 const rtl::OUString& rId,			/// use to identify this redline
-		 const rtl::OUString& rAuthor,		/// name of the author
-		 const rtl::OUString& rComment,	    /// redline comment
-		 const util::DateTime& rDateTime,	/// date+time
-         sal_Bool bMergeLastParagraph);     /// merge last paras
-
-    virtual uno::Reference<text::XTextCursor>
-        redlineCreateText
-        (const sal_Int16& id,
-		 uno::Reference<text::XTextCursor>& rOldCursor,/// needed to get the document
-		 const rtl::OUString& rId);	/// ID used to RedlineAdd() call
-
-    virtual void redlineSetCursor
-        (const sal_Int16& id,
-		 const rtl::OUString& rId,			/// ID used to RedlineAdd() call
-		 sal_Bool bStart,					/// start or end Cursor
-		 sal_Bool bIsOutsideOfParagraph);   /// range is not within <text:p>
-
-    virtual void redlineAdjustStartNodeCursor
-        (const sal_Int16& id, const sal_Bool&);
-
-    virtual void setShowChanges(const sal_Int16& id,sal_Bool bShowChanges );
-	virtual void setRecordChanges(const sal_Int16& id,sal_Bool bRecordChanges );
-    virtual void setChangesProtectionKey
-        (const sal_Int16& id, const uno::Sequence<sal_Int8>& rProtectionKey );
-
-    void setOpenRedlineId(const sal_Int16& id, const rtl::OUString& rId);
-    rtl::OUString getOpenRedlineId(const sal_Int16& id);
-    void resetOpenRedlineId(const sal_Int16& id);
-
-
-
-    // Access methods to the inside_deleted_section flag (redlining)
-	void setInsideDeleteContext(const sal_Int16& id, sal_Bool bNew);
-	sal_Bool isInsideDeleteContext(const sal_Int16& id ) const;
-
-    rtl::Reference<OdfContext> getListBlock(const sal_Int16& id);
-    rtl::Reference<OdfContext> getListItem(const sal_Int16& id);
-    void setListBlock(const sal_Int16& id, const rtl::Reference<OdfContext>& );
-    void setListItem(const sal_Int16& id, const rtl::Reference<OdfContext>& );
-//=============================================================
-    sal_Bool isListProcessed(const sal_Int16& id, const rtl::OUString& sListId ) const;
-    rtl::OUString generateNewListId(const sal_Int16& id) const;
-    const rtl::OUString& getListStyleOfLastProcessedList(const sal_Int16& id) const;
-    const rtl::OUString& getLastProcessedListId(const sal_Int16& id);
-    rtl::OUString getContinueListIdOfProcessedList
-                (const sal_Int16& id, const rtl::OUString& sListId )const;
-    void keepListAsProcessed
-                (const sal_Int16& id, const rtl::OUString& sListId,
-                 const rtl::OUString& sListStyleName, const rtl::OUString& sContinueListId,
-                 const rtl::OUString& sListStyleDefaultListId );
-
-};
-//=============================================================
-class OdfTextListsHelper
-{
-public:
-        sal_Bool isListProcessed(const sal_Int16& id, const rtl::OUString& sListId );
-        rtl::OUString generateNewListId();
-        // keeping track of processed lists for import and export
-        // --> OD 2008-08-15 #i92811#
-        // - add optional parameter <sListStyleDefaultListId>
-        const ::rtl::OUString& getLastProcessedListId(const sal_Int16& id);
-        const ::rtl::OUString& getListStyleOfLastProcessedList(const sal_Int16& id);
-        rtl::OUString getContinueListIdOfProcessedList
-        (const sal_Int16& id, const rtl::OUString& sListId );
-
-        rtl::OUString getListIdForListBlock(OdfContext* rListBlock);
-        void keepListAsProcessed
-        (const sal_Int16& id, const rtl::OUString& sListId, const rtl::OUString& sListStyleName,
-         const rtl::OUString& sContinueListId, const rtl::OUString& sListStyleDefaultListId = rtl::OUString() );
-        // <--
-
-
 protected:
-        rtl::OUString _getListStyleOfProcessedList
-            (const rtl::OUString& sListId);
-    private:
-        // container type for processed lists:
-        // map with <ListId> as key and pair( <ListStyleName, ContinueListId> )
-        // as value
-        typedef std::map<rtl::OUString,
-                         std::pair<rtl::OUString, rtl::OUString>,
-                         comphelper::UStringLess > MapForLists;
-        std::map<sal_Int16, MapForLists>  mProcessedListsMap;
-
-        std::map<sal_Int16, rtl::OUString> msLastProcessedListIdMap;
-        std::map<sal_Int16, rtl::OUString> msListStyleOfLastProcessedListMap;
-
-        // --> OD 2008-08-15 #i92811#
-        // additional container for processed lists.
-        // map with <ListStyleName> as key and pair( <ListId, ListStyleDefaultListId> )
-        // as value.
-        std::map<sal_Int16, MapForLists>  mProcessedListsStyleMap;
-        /*
-        // <--
-
-        // container type to build up continue list chain:
-        // map with <ListId> of master list as key and <ListId> of last list
-        // continuing the master list as value
-        typedef ::std::map< ::rtl::OUString, ::rtl::OUString,
-                            ::comphelper::UStringLess > tMapForContinuingLists;
-        tMapForContinuingLists* mpContinuingLists;
-
-        // stack type for opened list elements and its list style:
-        // vector with pair( <ListId>, <ListStyleName> ) as value
-        typedef ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > >
-                                                                tStackForLists;
-        tStackForLists* mpListStack;
-
-        /// to connect numbered-paragraphs that have no list-id attribute:
-        /// vector of pair of style-name and list-id (indexed by level)
-        typedef ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > >
-            LastNumberedParagraphs_t;
-
-        LastNumberedParagraphs_t mLastNumberedParagraphs;
-
-        /// numbered-paragraphs
-        typedef ::std::vector< ::std::pair< ::rtl::OUString,
-            ::com::sun::star::uno::Reference<
-                ::com::sun::star::container::XIndexReplace > > > NumParaList_t;
-        ::std::map< ::rtl::OUString, NumParaList_t > mNPLists;
-        */
+	std::map<sal_Int32, OdfTextCursorHelper*>	m_pCursorHelper;
+	std::map<sal_Int32, OdfBookmarkHelper*>		m_pBookmarkHelper;
+	std::map<sal_Int32, OdfFieldHelper*>		m_pFieldHelper;
+	std::map<sal_Int32, OdfFrameHelper*>		m_pFrameHelper;
+	std::map<sal_Int32, OdfTextListsHelper*>	m_pTextListHelper;
+public:	
+	void initPageContext(const sal_Int32& _i);
+	void deInitPageContext(const sal_Int32& _i);
+	
+	OdfTextCursorHelper*	getTextCursorHelper(const sal_Int32& _i);
+	OdfBookmarkHelper*		getBookmarkHelper(const sal_Int32& _i);
+	OdfFieldHelper*			getFieldHelper(const sal_Int32& _i);
+	OdfFrameHelper*			getFrameHelper(const sal_Int32& _i);
+	OdfTextListsHelper*		getTextListsHelper(const sal_Int32& _i);
 
 };
 //=============================================================

xmloff/inc/xmloff2/import/core/odfcontext.hxx

 	OdfImport* mp_odfImport;
 	OdfElementInfoRef m_odfElementInfoRef;
     rtl::Reference< OdfContext > mr_parentContext;
-
+	sal_Int32 m_processId;	
+	
 public:
 	INLINE OdfContext(const sal_uInt32&,
                OdfImport*,
 
 public:
 	INLINE sal_uInt16 getPrefix()const;
+	
+	INLINE void setProcessId(const sal_Int32& processId);
+	INLINE sal_Int32 getProcessId()const;
+	
+	INLINE virtual sal_Bool initProcessContext(const sal_Int32& processId);	
+	INLINE virtual sal_Bool deInitProcessContext();
 
 	INLINE const ::rtl::OUString getLocalName()const;
 

xmloff/inc/xmloff2/import/core/odfcontext.inl

 ,m_odfElementInfoRef((*p_odfImport)[_local])
 ,mr_parentContext(dynamic_cast<OdfContext*>(p_parentContext))
 {
-
+	if( mr_parentContext.is() )
+	{		
+		m_processId = mr_parentContext->getProcessId();
+	}else
+	{
+		m_processId = -1;
+	}	
 }
 //=============================================================
 INLINE OdfContext::~OdfContext()
     return m_odfElementInfoRef->getPrefix();
 }
 //=============================================================
+INLINE void OdfContext::setProcessId(const sal_Int32& processId)
+{
+	m_processId = processId;
+}
+//=============================================================
+INLINE sal_Int32 OdfContext::getProcessId()const
+{
+    return m_processId;
+}
+//=============================================================
+INLINE sal_Bool OdfContext::initProcessContext(const sal_Int32& processId)
+{
+	m_processId = processId;
+	return sal_True;
+}
+//=============================================================
+INLINE sal_Bool OdfContext::deInitProcessContext()
+{	
+	return sal_True;
+}
+//=============================================================
 INLINE const ::rtl::OUString OdfContext::getLocalName()const
 {
     return m_odfElementInfoRef->getLocalName();

xmloff/inc/xmloff2/import/core/odfparallelcontext.hxx

 #ifndef _XMLOFF_IMPORT_CORE_ODFPARALLELCONTEXT_HXX
 #define _XMLOFF_IMPORT_CORE_ODFPARALLELCONTEXT_HXX
 
+#include <vector>
 #include <xmloff2/import/core/odfcontext.hxx>
 #include <xmloff2/import/core/iodfparentcontext.hxx>
 

xmloff/inc/xmloff2/import/core/odfparallelcontext.inl

 #include <xmloff2/cpuhelper.hxx>
 #include <vcl/svapp.hxx>
 #include <osl/thread.hxx>
-//#include <vos/parallel.hxx>
+//#include <xmloff2/import/odfimport.hxx>
 
 namespace import{
 	namespace core{
 {
     sal_uInt32 _begin = m_odfElementInfoRef->getLocal() + 1;
     sal_uInt32 _end = _begin + m_odfElementInfoRef->getCount();
+    int i = 0;
     while( _begin < _end )
     {
         // 1
         // 2
         /// Sometimes the result will be NULL
         if( NULL != p_currentContext )
+        {
+        	p_currentContext->initProcessContext(i ++ );
             m_rSubContexts.push_back(p_currentContext);
+        }
         // 3
         _begin += (*mp_odfImport)[_begin]->getCount() +1;
     }
 		omp_set_num_threads(_cupcount);
 		_bInit = sal_True;
 	}
-	int _size = m_rSubContexts.size();
-	int i = 0;
+	int _size = m_rSubContexts.size();	
 	//vos::IParallelRegister* pRegister = dynamic_cast<vos::IParallelRegister*>(&Application::GetSolarMutex() );
 	//sal_Int32 _parentId = osl::Thread::getCurrentIdentifier();
 
-	
+	i = 0;
 	#pragma omp parallel for private(i)
 	for( i = 0 ; i < _size ; i++ )
 	{
     XMLOFF_CHECK_RETURN_FALSE(
         r_currentContext->commit(),
         "OdfParallelContext::collectSubContext r_currentContext->commit( is not true")
-
+	r_currentContext->deInitProcessContext();
     r_currentContext = NULL;
     return true;
 }

xmloff/inc/xmloff2/import/draw/genericpagecontext.hxx

 using import::core::OdfSimpleContext;
 //------------------------------------------------------------
 // draw:g
+
+
 class GenericPageContext :public OdfSimpleContext
 {
 
 	 const uno::Reference< drawing::XShapes >& xShapes);
 
 	virtual ~GenericPageContext();
-
+	
 protected:
     virtual sal_Bool _startElement();
     virtual sal_Bool _endElement();
     virtual OdfContext* _createChildContext(const sal_uInt32&);
+public:
+	virtual sal_Bool initProcessContext(const sal_Int32& processId);
+	virtual sal_Bool deInitProcessContext();
+	
 protected:
     virtual sal_Bool _preStartElement();
     virtual sal_Bool _processAttribute(const sal_Int16& i);

xmloff/inc/xmloff2/import/draw/sdbodycontext.hxx

 {
     namespace draw
     {
-//#ifdef PERFORMANCE_PARALLEL
-//        typedef BodyContext<OdfParallelContext> SdBodyContext;
-//#else
+#ifdef PERFORMANCE_PARALLEL
+        typedef BodyContext<OdfParallelContext> SdBodyContext;
+#else
 		typedef BodyContext<OdfSimpleContext> SdBodyContext;
-//#endif     
+#endif     
     }
 }
 #endif

xmloff/inc/xmloff2/import/draw/sdpagecontext.hxx

 
 	virtual ~SdPageContext();
 
-protected:
+protected:	
     virtual sal_Bool _preStartElement();
-
     virtual sal_Bool _endElement();
     virtual OdfContext* _createChildContext(const sal_uInt32&);
 
     virtual sal_Bool _processAttribute(const sal_Int16& i);
+    
+public:
+	virtual sal_Bool initProcessContext(const sal_Int32& processId);
+	virtual sal_Bool deInitProcessContext(); 
 };
 //------------------------------------------------------------
     }

xmloff/inc/xmloff2/import/draw/style/odfshapestyle.hxx

     virtual sal_Bool _processAttribute(const sal_Int16& _i);
 
 public:
+	virtual sal_Bool commit();
+	
 	virtual void finish( sal_Bool bOverwrite );
 
     virtual void fillPropertySet

xmloff/inc/xmloff2/import/draw/style/sdstylecontext.hxx

 
 	virtual ~SdMasterPageContext();
 
-protected:
+protected:	
     //virtual sal_Bool _startElement();
     virtual sal_Bool _endElement();
     virtual OdfContext* _createChildContext(const sal_uInt32&);
     //GenericPageContext
     virtual sal_Bool _preStartElement();
-    virtual sal_Bool _processAttribute(const sal_Int16& i);
+    virtual sal_Bool _processAttribute(const sal_Int16& i);    
+public:
+	virtual sal_Bool initProcessContext(const sal_Int32& processId);
+	virtual sal_Bool deInitProcessContext();
+		
+	virtual sal_Bool commit();
 public:
 	const rtl::OUString& getPageMasterName() const { return msPageMasterName; }
 	const rtl::OUString& getEncodedName() const { return msName; }

xmloff/inc/xmloff2/import/odfimport.h

 INLINE const rtl::Reference< OdfFormImportHelper >& OdfImport::getFormHelper()
 {
     if( !mxFormHelper.is() )
+    {	
 		mxFormHelper = _createFormHelper();
+		/**
+		Note : 
+			I had no very good time to init the OdfEventImportHelper ,
+			SO I do this
+		*/
+		getEventHelper();
+	}
 
 	return mxFormHelper;
 }
 //------------------------------------------------------------
+INLINE const rtl::Reference< OdfEventImportHelper >& OdfImport::getEventHelper()
+{
+	if(!mxEventHelper.is() )
+		_createEventHelper();
+	return mxEventHelper;
+}
+//------------------------------------------------------------
 INLINE const rtl::Reference< OdfShapeImportHelper >& OdfImport::getShapeHelper()
 {
     if( !mxShapeHelper.is() )

xmloff/inc/xmloff2/import/odfimport.hxx

 #include <xmloff2/dllapi.h>
 #include <xmloff2/helper/odftextimporthelper.hxx>
 #include <xmloff2/helper/odfformimporthelper.hxx>
+#include <xmloff2/helper/odfeventimporthelper.hxx>
 #include <xmloff2/helper/odfshapeimporthelper.hxx>
 #include <xmloff2/helper/odfdataimporthelper.hxx>
 #include <xmloff2/helper/odfchartimporthelper.hxx>
 
 using helper::OdfTextImportHelper;
 using helper::OdfFormImportHelper;
+using helper::OdfEventImportHelper;
 using helper::OdfShapeImportHelper;
 using helper::OdfDataImportHelper;
 using helper::OdfChartImportHelper;
 	rtl::Reference< OdfTextImportHelper> mxTextHelper;
 	rtl::Reference< OdfChartImportHelper> mxChartHelper;
 	rtl::Reference< OdfFormImportHelper> mxFormHelper;
+	rtl::Reference< OdfEventImportHelper> mxEventHelper;	
 	rtl::Reference< OdfShapeImportHelper> mxShapeHelper;
 	rtl::Reference< OdfDataImportHelper> mxDataHelper;
 
 	///
 protected:
     sal_uInt32 mnImportFlags;
-    /// help objects
+	//============================
 	UnoInterfaceToUniqueIdentifierMapper *  mpIdentifierMapper;
+	StyleMap *          mpStyleMap;
+	//============================
+	
 	OdfUnitConverter*   mpUnitConverter;
 	ProgressBarHelper_2*  mpProgressBarHelper;
-	StyleMap *          mpStyleMap;
+	
 
 	OdfFontStylesContext* mpFontDecls;
 	OdfStylesContext* mpStyles;
     INLINE const rtl::Reference< OdfTextImportHelper >& getTextHelper();
     INLINE const rtl::Reference< OdfChartImportHelper >& getChartHelper();
     INLINE const rtl::Reference< OdfFormImportHelper >& getFormHelper();
+    INLINE const rtl::Reference< OdfEventImportHelper >& getEventHelper();
     INLINE const rtl::Reference< OdfShapeImportHelper >& getShapeHelper();
     INLINE const rtl::Reference< OdfDataImportHelper >& getDataHelper();
 
     rtl::Reference< OdfTextImportHelper > _createTextHelper();
     rtl::Reference< OdfChartImportHelper > _createChartHelper();
     rtl::Reference< OdfFormImportHelper > _createFormHelper();
+    rtl::Reference< OdfEventImportHelper > _createEventHelper();
     rtl::Reference< OdfShapeImportHelper > _createShapeHelper();
     rtl::Reference< OdfDataImportHelper > _createDataHelper();
 };

xmloff/inc/xmloff2/import/text/odffieldcontext.hxx

 #include <rtl/ustrbuf.hxx>
 #include <tools/debug.hxx>
 #include <xmloff2/cpuhelper.hxx>
+#include <xmloff2/helper/odfpagetexthelper.hxx>
 #include <xmloff2/helper/odftextimporthelper.hxx>
 #include <xmloff2/import/core/odfcontext.hxx>
 #include <xmloff2/import/core/odfsimplecontext.hxx>
                 // workaround for #80606#
                 try
                 {
-                    mrTextHelper->insertTextContent(GetThreadId(), xTextContent);
+                    mrTextHelper->getTextCursorHelper(getProcessId())->insertTextContent(xTextContent);
                 }
                 catch (lang::IllegalArgumentException e)
                 {
             }
         }
         // in case of error: write element content
-        mrTextHelper->insertString( GetThreadId(), _getContent() );
+        mrTextHelper->getTextCursorHelper(getProcessId())->insertString(_getContent() );
         return sal_True;
     }
 protected:

xmloff/inc/xmloff2/odftypes.hxx

 #define ODF_PM_TYPES_START	(0x5 << ODF_TYPE_APP_SHIFT)	// page master
 #define ODF_DB_TYPES_START	(0x6 << ODF_TYPE_APP_SHIFT)
 
+
 #endif