--- sc/source/core/data/sortparam.cxx	2005-09-08 19:29:28.000000000 +0100
+++ sc/source/core/data/sortparam.cxx	2006-02-15 18:11:20.000000000 +0000
@@ -79,6 +79,7 @@ void ScSortParam::Clear()
 {
 	nCol1=nCol2=nDestCol = 0;
 	nRow1=nRow2=nDestRow = 0;
+	nCompatHeader = 2;
 	nDestTab = 0;
 	nUserIndex = 0;
 	bHasHeader=bCaseSens=bUserDef = FALSE;
--- sc/inc/sortparam.hxx	2005-09-08 18:57:52.000000000 +0100
+++ sc/inc/sortparam.hxx	2006-02-16 16:34:21.000000000 +0000
@@ -80,6 +80,7 @@ struct SC_DLLPUBLIC ScSortParam
 	BOOL		bAscending[MAXSORT];
 	::com::sun::star::lang::Locale		aCollatorLocale;
 	String		aCollatorAlgorithm;
+	USHORT		nCompatHeader;
 
 	ScSortParam();
 	ScSortParam( const ScSortParam& r );
--- sc/inc/document.hxx 2006-02-14 10:28:17.000000000 +0000
+++ sc/inc/document.hxx 2006-02-16 17:10:54.000000000 +0000
@@ -1639,7 +1639,8 @@ public:
 
     void            InvalidateStyleSheetUsage()
                         { bStyleSheetUsageInvalid = TRUE; }
-
+	void GetSortParam( ScSortParam& rParam, SCTAB nTab );
+	void SetSortParam( ScSortParam& rParam, SCTAB nTab );
 private: // CLOOK-Impl-Methoden
 	void	ImplLoadDocOptions( SvStream& rStream );
 	void	ImplLoadViewOptions( SvStream& rStream );
@@ -1671,7 +1672,18 @@ private: // CLOOK-Impl-Methoden
 
 	BOOL	HasPartOfMerged( const ScRange& rRange );
 
+	std::map< sal_Int16, ScSortParam > mSheetSortParams;
+
 };
+inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab )
+{ 
+	rParam = mSheetSortParams[ nTab ]; 
+}
+
+inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab )
+{ 
+	mSheetSortParams[ nTab ] = rParam;
+}
 
 inline BOOL ScDocument::ColFiltered( USHORT nCol, USHORT nTab ) const
 {
