--- sw/inc/doc.hxx.orig	2007-07-27 11:00:21.000000000 +0800
+++ sw/inc/doc.hxx	2007-07-27 15:23:00.000000000 +0800
@@ -613,6 +613,9 @@ class SwDoc :
     bool mbUnixForceZeroExtLeading                  : 1;   // FME 2006-10-09 #i60945#
     bool mbOldPrinterMetrics                        : 1;   // FME 2007-05-14 #147385#
 
+	// #i78591#
+	sal_uInt32  n32DummyCompatabilityOptions1;
+	sal_uInt32  n32DummyCompatabilityOptions2;
     //
     // COMPATIBILITY FLAGS END
     //
@@ -1978,6 +1981,24 @@ public:
     //Update all the page masters
     SW_DLLPUBLIC void SetDefaultPageMode(bool bSquaredPageMode);
     SW_DLLPUBLIC sal_Bool IsSquaredPageMode() const;    
+    
+ 	// i#78591#
+ 	void Setn32DummyCompatabilityOptions1( sal_uInt32 CompatabilityOptions1 )
+ 	{
+ 		n32DummyCompatabilityOptions1 = CompatabilityOptions1;
+ 	}	
+ 	sal_uInt32 Getn32DummyCompatabilityOptions1( )
+ 	{
+ 		return n32DummyCompatabilityOptions1;
+ 	}	
+ 	void Setn32DummyCompatabilityOptions2( sal_uInt32 CompatabilityOptions2 )
+ 	{
+ 		n32DummyCompatabilityOptions2 = CompatabilityOptions2;
+ 	}	
+ 	sal_uInt32 Getn32DummyCompatabilityOptions2( )
+ 	{
+ 		return n32DummyCompatabilityOptions2;
+ 	}	
 };
 
 
--- sw/source/core/doc/docnew.cxx.orig	2007-07-18 21:29:46.000000000 +0800
+++ sw/source/core/doc/docnew.cxx	2007-07-27 15:20:25.000000000 +0800
@@ -337,7 +337,10 @@ SwDoc::SwDoc() :
     mbWinEncryption(sal_False),
     mbStartIdleTimer(sal_False),
     // --> OD 2005-02-11 #i38810#
-    mbLinksUpdated( sal_False )
+    mbLinksUpdated( sal_False ),
+	// i#78591#
+	n32DummyCompatabilityOptions1(0),
+	n32DummyCompatabilityOptions2(0)
 {
 	RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDoc::SwDoc" );
 
--- sw/source/filter/ww8/ww8scan.hxx.orig	2007-01-03 19:32:33.000000000 +0800
+++ sw/source/filter/ww8/ww8scan.hxx	2007-07-27 15:20:25.000000000 +0800
@@ -1602,15 +1602,26 @@ public:
     UINT32 fTransparentMetafiles            :1; // see above
     UINT32 fShowBreaksInFrames              :1; // see above
     UINT32 fSwapBordersFacingPgs            :1; // see above
-    UINT32                                                      :4; // reserved
+	UINT32 fCompatabilityOptions_Unknown1_13	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_14	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_15	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_16	:1; // #i78591#
     UINT32 fSuppressTopSpacingMac5      :1; // Suppress extra line spacing at top
                                                                                 // of page like MacWord 5.x
     UINT32 fTruncDxaExpand                      :1; // Expand/Condense by whole number of points
     UINT32 fPrintBodyBeforeHdr              :1; // Print body text before header/footer
     UINT32 fNoLeading                                   :1; // Don't add extra spacebetween rows of text
-    UINT32                                                      :1; // reserved
+	UINT32 fCompatabilityOptions_Unknown1_21	:1; // #i78591#
     UINT32 fMWSmallCaps : 1;    // Use larger small caps like MacWord 5.x
-    UINT32 : 9;                 // reserved
+	UINT32 fCompatabilityOptions_Unknown1_23	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_24	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_25	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_26	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_27	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_28	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_29	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_30	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown1_31	:1; // #i78591#
     UINT32 fUsePrinterMetrics : 1;  //The magic option
 
     // hier sollte bei nFib <= 105  Schluss sein, sonst ist Datei fehlerhaft!
@@ -1650,9 +1661,38 @@ public:
     INT16 hpsZoonFontPag;
     INT16 dywDispPag;
 
-    UINT32 fUnknown1:2;
+	UINT32 fCompatabilityOptions_Unknown2_1	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_2	:1; // #i78591#
     UINT32 fDontUseHTMLAutoSpacing:1;
-    UINT32 fUnknown2:29;
+	UINT32 fCompatabilityOptions_Unknown2_4	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_5	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_6	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_7	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_8	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_9	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_10	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_11	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_12	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_13	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_14	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_15	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_16	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_17	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_18	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_19	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_20	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_21	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_22	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_23	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_24	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_25	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_26	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_27	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_28	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_29	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_30	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_31	:1; // #i78591#
+	UINT32 fCompatabilityOptions_Unknown2_32	:1; // #i78591#
 
     UINT16 fUnknown3:15;
     UINT16 fUseBackGroundInAllmodes:1;
@@ -1668,9 +1708,12 @@ public:
     /* Constructs default DOP suitable for exporting */
     WW8Dop();
     bool Write(SvStream& rStrm, WW8Fib& rFib) const;
-private:
+public:
     UINT32 GetCompatabilityOptions() const;
     void SetCompatabilityOptions(UINT32 a32Bit);
+	// i#78591#
+	UINT32 GetCompatabilityOptions2() const;
+	void SetCompatabilityOptions2(UINT32 a32Bit);
 };
 
 class WW8PLCF_HdFt
--- sw/source/filter/ww8/ww8scan.cxx.orig	2007-05-25 21:03:35.000000000 +0800
+++ sw/source/filter/ww8/ww8scan.cxx	2007-07-27 15:20:25.000000000 +0800
@@ -6517,7 +6517,10 @@ WW8Dop::WW8Dop(SvStream& rSt, INT16 nFib
                 a32Bit = Get_Long( pData );
                 SetCompatabilityOptions(a32Bit);
                 a32Bit = Get_Long( pData );
-                fDontUseHTMLAutoSpacing = (a32Bit & 0x4) >> 2;
+
+				// i#78591#
+                // fDontUseHTMLAutoSpacing = (a32Bit & 0x4) >> 2;
+				SetCompatabilityOptions2(a32Bit);
             }
             if (nRead >= 600)
             {
@@ -6593,11 +6596,25 @@ void WW8Dop::SetCompatabilityOptions(UIN
     fTransparentMetafiles       = ( a32Bit &  0x00000200 ) >>  9 ;
     fShowBreaksInFrames         = ( a32Bit &  0x00000400 ) >> 10 ;
     fSwapBordersFacingPgs       = ( a32Bit &  0x00000800 ) >> 11 ;
+    fCompatabilityOptions_Unknown1_13       = ( a32Bit &  0x00001000 ) >> 12 ;
+    fCompatabilityOptions_Unknown1_14       = ( a32Bit &  0x00002000 ) >> 13 ;
+    fCompatabilityOptions_Unknown1_15       = ( a32Bit &  0x00004000 ) >> 14 ;
+    fCompatabilityOptions_Unknown1_16       = ( a32Bit &  0x00008000 ) >> 15 ;
     fSuppressTopSpacingMac5     = ( a32Bit &  0x00010000 ) >> 16 ;
     fTruncDxaExpand             = ( a32Bit &  0x00020000 ) >> 17 ;
     fPrintBodyBeforeHdr         = ( a32Bit &  0x00040000 ) >> 18 ;
     fNoLeading                  = ( a32Bit &  0x00080000 ) >> 19 ;
+    fCompatabilityOptions_Unknown1_21       = ( a32Bit &  0x00100000 ) >> 20 ;
     fMWSmallCaps                = ( a32Bit &  0x00200000 ) >> 21 ;
+    fCompatabilityOptions_Unknown1_23       = ( a32Bit &  0x00400000 ) >> 22 ;
+    fCompatabilityOptions_Unknown1_24       = ( a32Bit &  0x00800800 ) >> 23 ;
+    fCompatabilityOptions_Unknown1_25       = ( a32Bit &  0x01000000 ) >> 24 ;
+    fCompatabilityOptions_Unknown1_26       = ( a32Bit &  0x02000000 ) >> 25 ;
+    fCompatabilityOptions_Unknown1_27       = ( a32Bit &  0x04000000 ) >> 26 ;
+    fCompatabilityOptions_Unknown1_28       = ( a32Bit &  0x08000000 ) >> 27 ;
+    fCompatabilityOptions_Unknown1_29       = ( a32Bit &  0x10000000 ) >> 28 ;
+    fCompatabilityOptions_Unknown1_30       = ( a32Bit &  0x20000000 ) >> 29 ;
+    fCompatabilityOptions_Unknown1_31       = ( a32Bit &  0x40000000 ) >> 30 ;
 
     fUsePrinterMetrics          = ( a32Bit &  0x80000000 ) >> 31 ;
 }
@@ -6617,15 +6634,108 @@ UINT32 WW8Dop::GetCompatabilityOptions()
     if (fTransparentMetafiles)          a32Bit |= 0x00000200;
     if (fShowBreaksInFrames)            a32Bit |= 0x00000400;
     if (fSwapBordersFacingPgs)          a32Bit |= 0x00000800;
+    if (fCompatabilityOptions_Unknown1_13)          a32Bit |= 0x00001000;
+    if (fCompatabilityOptions_Unknown1_14)          a32Bit |= 0x00002000;
+    if (fCompatabilityOptions_Unknown1_15)          a32Bit |= 0x00004000;
+    if (fCompatabilityOptions_Unknown1_16)          a32Bit |= 0x00008000;
     if (fSuppressTopSpacingMac5)        a32Bit |= 0x00010000;
     if (fTruncDxaExpand)                a32Bit |= 0x00020000;
     if (fPrintBodyBeforeHdr)            a32Bit |= 0x00040000;
     if (fNoLeading)                     a32Bit |= 0x00080000;
+    if (fCompatabilityOptions_Unknown1_21)          a32Bit |= 0x00100000;
     if (fMWSmallCaps)                   a32Bit |= 0x00200000;
+    if (fCompatabilityOptions_Unknown1_23)          a32Bit |= 0x00400000;
+    if (fCompatabilityOptions_Unknown1_24)          a32Bit |= 0x00800000;
+    if (fCompatabilityOptions_Unknown1_25)          a32Bit |= 0x01000000;
+    if (fCompatabilityOptions_Unknown1_26)          a32Bit |= 0x02000000;
+    if (fCompatabilityOptions_Unknown1_27)          a32Bit |= 0x04000000;
+    if (fCompatabilityOptions_Unknown1_28)          a32Bit |= 0x08000000;
+    if (fCompatabilityOptions_Unknown1_29)          a32Bit |= 0x10000000;
+    if (fCompatabilityOptions_Unknown1_30)          a32Bit |= 0x20000000;
+    if (fCompatabilityOptions_Unknown1_31)          a32Bit |= 0x40000000;
     if (fUsePrinterMetrics)             a32Bit |= 0x80000000;
     return a32Bit;
 }
 
+// i#78591#
+void WW8Dop::SetCompatabilityOptions2(UINT32 a32Bit)
+{
+	fCompatabilityOptions_Unknown2_1 						= ( a32Bit &  0x00000001 );
+    fCompatabilityOptions_Unknown2_2						= ( a32Bit &  0x00000002 ) >>  1 ;
+    fDontUseHTMLAutoSpacing		= ( a32Bit &  0x00000004 ) >>  2 ;
+	fCompatabilityOptions_Unknown2_4					= ( a32Bit &  0x00000008 ) >>  3 ;
+   	fCompatabilityOptions_Unknown2_5					= ( a32Bit &  0x00000010 ) >>  4 ;
+   	fCompatabilityOptions_Unknown2_6					= ( a32Bit &  0x00000020 ) >>  5 ;
+   	fCompatabilityOptions_Unknown2_7					= ( a32Bit &  0x00000040 ) >>  6 ;
+   	fCompatabilityOptions_Unknown2_8					= ( a32Bit &  0x00000080 ) >>  7 ;
+   	fCompatabilityOptions_Unknown2_9					= ( a32Bit &  0x00000100 ) >>  8 ;
+   	fCompatabilityOptions_Unknown2_10					= ( a32Bit &  0x00000200 ) >>  9 ;
+   	fCompatabilityOptions_Unknown2_11					= ( a32Bit &  0x00000400 ) >> 10 ;
+   	fCompatabilityOptions_Unknown2_12					= ( a32Bit &  0x00000800 ) >> 11 ;
+	fCompatabilityOptions_Unknown2_13					= ( a32Bit &  0x00001000 ) >> 12 ;	
+	fCompatabilityOptions_Unknown2_14					= ( a32Bit &  0x00002000 ) >> 13 ;	
+	fCompatabilityOptions_Unknown2_15					= ( a32Bit &  0x00004000 ) >> 14 ;	
+	fCompatabilityOptions_Unknown2_16					= ( a32Bit &  0x00008000 ) >> 15 ;	
+   	fCompatabilityOptions_Unknown2_17					= ( a32Bit &  0x00010000 ) >> 16 ;
+   	fCompatabilityOptions_Unknown2_18					= ( a32Bit &  0x00020000 ) >> 17 ;
+   	fCompatabilityOptions_Unknown2_19					= ( a32Bit &  0x00040000 ) >> 18 ;
+   	fCompatabilityOptions_Unknown2_20					= ( a32Bit &  0x00080000 ) >> 19 ;
+	fCompatabilityOptions_Unknown2_21					= ( a32Bit &  0x00100000 ) >> 20 ;	
+   	fCompatabilityOptions_Unknown2_22					= ( a32Bit &  0x00200000 ) >> 21 ;
+	fCompatabilityOptions_Unknown2_23					= ( a32Bit &  0x00400000 ) >> 22 ;	
+	fCompatabilityOptions_Unknown2_24					= ( a32Bit &  0x00800800 ) >> 23 ;	
+	fCompatabilityOptions_Unknown2_25					= ( a32Bit &  0x01000800 ) >> 24 ;	
+	fCompatabilityOptions_Unknown2_26					= ( a32Bit &  0x02000800 ) >> 25 ;	
+	fCompatabilityOptions_Unknown2_27					= ( a32Bit &  0x04000800 ) >> 26 ;	
+	fCompatabilityOptions_Unknown2_28					= ( a32Bit &  0x08000800 ) >> 27 ;	
+	fCompatabilityOptions_Unknown2_29					= ( a32Bit &  0x10000800 ) >> 28 ;	
+	fCompatabilityOptions_Unknown2_30					= ( a32Bit &  0x20000800 ) >> 29 ;	
+	fCompatabilityOptions_Unknown2_31					= ( a32Bit &  0x40000800 ) >> 30 ;	
+   	fCompatabilityOptions_Unknown2_32					= ( a32Bit &  0x80000000 ) >> 31 ;
+}
+
+UINT32 WW8Dop::GetCompatabilityOptions2() const
+{
+    UINT32 a32Bit = 0;
+    if (fCompatabilityOptions_Unknown2_1)			a32Bit |= 0x00000001;
+    if (fCompatabilityOptions_Unknown2_2)           a32Bit |= 0x00000002;
+    if (fDontUseHTMLAutoSpacing)     a32Bit |= 0x00000004;
+    if (fCompatabilityOptions_Unknown2_4)           a32Bit |= 0x00000008;
+    if (fCompatabilityOptions_Unknown2_5)           a32Bit |= 0x00000010;
+    if (fCompatabilityOptions_Unknown2_6)           a32Bit |= 0x00000020;
+    if (fCompatabilityOptions_Unknown2_7)           a32Bit |= 0x00000040;
+    if (fCompatabilityOptions_Unknown2_8)           a32Bit |= 0x00000080;
+    if (fCompatabilityOptions_Unknown2_9)           a32Bit |= 0x00000100;
+    if (fCompatabilityOptions_Unknown2_10)          a32Bit |= 0x00000200;
+    if (fCompatabilityOptions_Unknown2_11)          a32Bit |= 0x00000400;
+    if (fCompatabilityOptions_Unknown2_12)          a32Bit |= 0x00000800;
+    if (fCompatabilityOptions_Unknown2_13)          a32Bit |= 0x00001000;
+	//#i42909# set thai "line breaking rules" compatibility option
+	// pflin, wonder whether bUseThaiLineBreakingRules is correct 
+	// when importing word document.
+    if (bUseThaiLineBreakingRules)          a32Bit |= 0x00002000;
+	else if (fCompatabilityOptions_Unknown2_14) 		a32Bit |= 0x00002000;
+    if (fCompatabilityOptions_Unknown2_15)          a32Bit |= 0x00004000;
+    if (fCompatabilityOptions_Unknown2_16)          a32Bit |= 0x00008000;
+    if (fCompatabilityOptions_Unknown2_17)        	a32Bit |= 0x00010000;
+    if (fCompatabilityOptions_Unknown2_18)          a32Bit |= 0x00020000;
+    if (fCompatabilityOptions_Unknown2_19)          a32Bit |= 0x00040000;
+    if (fCompatabilityOptions_Unknown2_20)          a32Bit |= 0x00080000;
+    if (fCompatabilityOptions_Unknown2_21)          a32Bit |= 0x00100000;
+    if (fCompatabilityOptions_Unknown2_22)          a32Bit |= 0x00200000;
+    if (fCompatabilityOptions_Unknown2_23)          a32Bit |= 0x00400000;
+    if (fCompatabilityOptions_Unknown2_24)          a32Bit |= 0x00800000;
+    if (fCompatabilityOptions_Unknown2_25)          a32Bit |= 0x01000000;
+    if (fCompatabilityOptions_Unknown2_26)          a32Bit |= 0x02000000;
+    if (fCompatabilityOptions_Unknown2_27)          a32Bit |= 0x04000000;
+    if (fCompatabilityOptions_Unknown2_28)          a32Bit |= 0x08000000;
+    if (fCompatabilityOptions_Unknown2_29)          a32Bit |= 0x10000000;
+    if (fCompatabilityOptions_Unknown2_30)          a32Bit |= 0x20000000;
+    if (fCompatabilityOptions_Unknown2_31)          a32Bit |= 0x40000000;
+    if (fCompatabilityOptions_Unknown2_32)          a32Bit |= 0x80000000;
+    return a32Bit;
+}
+
 bool WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const
 {
     const int nMaxDopLen = 600;
@@ -6806,13 +6916,17 @@
         pData += 8;
         Set_UInt32(pData, GetCompatabilityOptions());
         sal_uInt32 a32Bit = 0;
-		if (bUseThaiLineBreakingRules)
-		{
-			a32Bit|=0x2000; //#i42909# set thai "line breaking rules" compatibility option
-		}
-        if (fDontUseHTMLAutoSpacing)    
-            a32Bit |= 0x0004;
-        Set_UInt32(pData, a32Bit);
+
+		// i#78591#
+//		if (bUseThaiLineBreakingRules)
+//		{
+//			a32Bit|=0x2000; //#i42909# set thai "line breaking rules" compatibility option
+//		}
+//       if (fDontUseHTMLAutoSpacing)    
+//            a32Bit |= 0x0004;
+		Set_UInt32(pData, GetCompatabilityOptions2());
+		
+//        Set_UInt32(pData, a32Bit);
         pData += 82;
         a16Bit = 0x80;
         Set_UInt16(pData, a16Bit);
--- sw/source/filter/ww8/wrtww8.cxx.orig	2007-07-17 21:09:18.000000000 +0800
+++ sw/source/filter/ww8/wrtww8.cxx	2007-07-27 15:20:25.000000000 +0800
@@ -311,6 +311,10 @@ static void WriteDop( SwWW8Writer& rWrt 
 {
     WW8Dop& rDop = *rWrt.pDop;
 
+	// i#78951#, store the value of  unknown compatability options
+	rDop.SetCompatabilityOptions( rWrt.pDoc->Getn32DummyCompatabilityOptions1());
+	rDop.SetCompatabilityOptions2( rWrt.pDoc->Getn32DummyCompatabilityOptions2());
+	
     rDop.fNoLeading = !rWrt.pDoc->get(IDocumentSettingAccess::ADD_EXT_LEADING);
     rDop.fUsePrinterMetrics = !rWrt.pDoc->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE);
 
--- sw/source/filter/ww8/ww8par.cxx.orig	2007-07-18 22:46:00.000000000 +0800
+++ sw/source/filter/ww8/ww8par.cxx	2007-07-27 15:20:25.000000000 +0800
@@ -1548,6 +1548,11 @@ void SwWW8ImplReader::ImportDop()
     // COMPATIBILITY FLAGS START
     //
 
+	// i#78951, remember the unknown compatability options 
+	// so as to export them out
+	rDoc.Setn32DummyCompatabilityOptions1( pWDop->GetCompatabilityOptions());
+	rDoc.Setn32DummyCompatabilityOptions2( pWDop->GetCompatabilityOptions2());
+	
     // Abstand zwischen zwei Absaetzen ist die SUMME von unterem
     // Abst. des ersten und oberem Abst. des zweiten
     rDoc.set(IDocumentSettingAccess::PARA_SPACE_MAX, pWDop->fDontUseHTMLAutoSpacing);
