Index: source/core/unocore/unosett.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/unocore/unosett.cxx,v
retrieving revision 1.45
retrieving revision 1.45.162.1
diff -u -r1.45 -r1.45.162.1
--- source/core/unocore/unosett.cxx	8 Nov 2005 17:24:38 -0000	1.45
+++ source/core/unocore/unosett.cxx	20 Feb 2006 17:30:31 -0000	1.45.162.1
@@ -1217,7 +1217,7 @@
 					sal_uInt32 nPos = rInfo.GetPosFromLeft();
 					if(USHRT_MAX == nPos)
 						nPos = 0;
-					aRet <<= TWIP_TO_MM100(nPos);
+					aRet <<= static_cast < sal_Int32 >(TWIP_TO_MM100(nPos));
 				}
 				break;
 				case WID_INTERVAL   :
@@ -2633,7 +2633,7 @@
 	switch(pMap->nWID)
 	{
 		case WID_TXTCOL_LINE_WIDTH:
-			aRet <<= TWIP_TO_MM100(nSepLineWidth);
+			aRet <<= static_cast < sal_Int32 >(TWIP_TO_MM100(nSepLineWidth));
 		break;
 		case WID_TXTCOL_LINE_COLOR:
 			aRet <<= nSepLineColor;
Index: source/filter/ww8/wrtw8esh.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8esh.cxx,v
retrieving revision 1.87
retrieving revision 1.87.40.1
diff -u -r1.87 -r1.87.40.1
--- source/filter/ww8/wrtw8esh.cxx	1 Feb 2006 18:50:34 -0000	1.87
+++ source/filter/ww8/wrtw8esh.cxx	22 Feb 2006 12:59:33 -0000	1.87.40.1
@@ -570,14 +570,14 @@
     return bRet;
 }
 
-bool SwWW8Writer::MiserableRTLFrmFmtHack(long &rLeft, long &rRight,
+bool SwWW8Writer::MiserableRTLFrmFmtHack(SwTwips &rLeft, SwTwips &rRight,
     const sw::Frame &rFrmFmt)
 {
     //Require nasty bidi swap
     if (FRMDIR_HORI_RIGHT_TOP != pDoc->GetTextDirection(rFrmFmt.GetPosition()))
         return false;
 
-    long nWidth = rRight - rLeft;
+    SwTwips nWidth = rRight - rLeft;
     SwTwips nPageLeft, nPageRight;
     SwTwips nPageSize = CurrentPageWidth(nPageLeft, nPageRight);
 
@@ -703,8 +703,8 @@
             // spid
             SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId);
 
-            sal_Int32 nLeft = aRect.Left() + nThick;
-            sal_Int32 nRight = aRect.Right() - nThick;
+            SwTwips nLeft = aRect.Left() + nThick;
+            SwTwips nRight = aRect.Right() - nThick;
 
             //Nasty swap for bidi if neccessary
             rWrt.MiserableRTLFrmFmtHack(nLeft, nRight, rFrmFmt);
@@ -857,13 +857,13 @@
 {
     bool bRet = false;
     rWrt.bInWriteEscher = true;
-    long& rccp=TXT_TXTBOX == nTyp ? rWrt.pFib->ccpTxbx : rWrt.pFib->ccpHdrTxbx;
+    WW8_CP& rccp=TXT_TXTBOX == nTyp ? rWrt.pFib->ccpTxbx : rWrt.pFib->ccpHdrTxbx;
 
     bRet = WriteGenericTxt( rWrt, nTyp, rccp );
 
     WW8_CP nCP = rWrt.Fc2Cp( rWrt.Strm().Tell() );
     WW8Fib& rFib = *rWrt.pFib;
-    long nMyOffset = rFib.ccpText + rFib.ccpFtn + rFib.ccpHdr + rFib.ccpAtn
+    WW8_CP nMyOffset = rFib.ccpText + rFib.ccpFtn + rFib.ccpHdr + rFib.ccpAtn
                             + rFib.ccpEdn;
     if( TXT_TXTBOX == nTyp )
         rWrt.pFldTxtBxs->Finish( nCP, nMyOffset );
@@ -2084,7 +2084,7 @@
         DrawObjPointerVector aSorted;
         MakeZOrderArrAndFollowIds(pSdrObjs->GetObjArr(), aSorted);
 
-        ULONG nShapeId=0;
+        sal_uInt32 nShapeId=0;
         DrawObjPointerIter aEnd = aSorted.end();
         for (DrawObjPointerIter aIter = aSorted.begin(); aIter != aEnd; ++aIter)
         {
Index: source/filter/ww8/wrtw8sty.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8sty.cxx,v
retrieving revision 1.36
retrieving revision 1.36.148.1
diff -u -r1.36 -r1.36.148.1
--- source/filter/ww8/wrtw8sty.cxx	16 Nov 2005 13:54:04 -0000	1.36
+++ source/filter/ww8/wrtw8sty.cxx	22 Feb 2006 12:59:33 -0000	1.36.148.1
@@ -1739,7 +1739,7 @@
 }
 
 bool WW8_WrPlcSubDoc::WriteGenericTxt(SwWW8Writer& rWrt, BYTE nTTyp, 
-    long& rCount)
+    WW8_CP& rCount)
 {
     bool bRet = false;
     USHORT nLen = aCntnt.Count();
@@ -1826,7 +1826,7 @@
         // CR ans Ende ( sonst mault WW )
         rWrt.WriteStringAsPara( aEmptyStr );
 
-        ULONG nCpEnd = rWrt.Fc2Cp( rWrt.Strm().Tell() );
+        WW8_CP nCpEnd = rWrt.Fc2Cp( rWrt.Strm().Tell() );
         pTxtPos->Append( nCpEnd );
         rCount = nCpEnd - nCpStart;
         if (rCount)
@@ -1836,7 +1836,7 @@
 }
 
 void WW8_WrPlcSubDoc::WriteGenericPlc( SwWW8Writer& rWrt, BYTE nTTyp,
-    long& rTxtStart, long& rTxtCount, long& rRefStart, long& rRefCount ) const
+    WW8_FC& rTxtStart, sal_Int32& rTxtCount, WW8_FC& rRefStart, sal_Int32& rRefCount ) const
 {
     typedef ::std::vector<String>::iterator myiter;
 
Index: source/filter/ww8/wrtww8.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/wrtww8.cxx,v
retrieving revision 1.74
retrieving revision 1.74.182.1
diff -u -r1.74 -r1.74.182.1
--- source/filter/ww8/wrtww8.cxx	27 Oct 2005 14:08:22 -0000	1.74
+++ source/filter/ww8/wrtww8.cxx	22 Feb 2006 12:59:34 -0000	1.74.182.1
@@ -722,7 +722,8 @@
     if( WW8_WrPlc1::Count() <= 1 )
         return false;
 
-    long *pfc, *plc;
+    WW8_FC *pfc;
+    sal_Int32 *plc;
     switch (nTxtTyp)
     {
         case TXT_MAINTEXT:
@@ -1304,7 +1305,7 @@
     pPcts->GetObject( pPcts->Count() - 1)->SetStatus();
 }
 
-ULONG WW8_WrPct::Fc2Cp( ULONG nFc ) const
+WW8_CP WW8_WrPct::Fc2Cp( ULONG nFc ) const
 {
     ASSERT( nFc >= (ULONG)nOldFc, "FilePos liegt vorm letzten Piece" );
     ASSERT( pPcts->Count(), "Fc2Cp noch kein Piece vorhanden" );
Index: source/filter/ww8/wrtww8.hxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/wrtww8.hxx,v
retrieving revision 1.66
retrieving revision 1.66.182.1
diff -u -r1.66 -r1.66.182.1
--- source/filter/ww8/wrtww8.hxx	27 Oct 2005 14:08:40 -0000	1.66
+++ source/filter/ww8/wrtww8.hxx	22 Feb 2006 12:59:34 -0000	1.66.182.1
@@ -275,7 +275,7 @@
     void WritePc(SwWW8Writer& rWrt);
     void SetParaBreak();
     bool IsUnicode() const  { return bIsUni; }
-    ULONG Fc2Cp( ULONG nFc ) const;
+    WW8_CP Fc2Cp( ULONG nFc ) const;
 };
 
 class wwFont
@@ -618,7 +618,7 @@
 
     ULONG ReplaceCr( BYTE nChar );
 
-    ULONG Fc2Cp( ULONG nFc ) const          { return pPiece->Fc2Cp( nFc ); }
+    WW8_CP Fc2Cp( ULONG nFc ) const          { return pPiece->Fc2Cp( nFc ); }
 
             // einige z.T. static halb-interne Funktions-Deklarationen
 
@@ -687,7 +687,7 @@
     USHORT DupNumRuleWithLvlStart(const SwNumRule *pRule,BYTE nLvl,USHORT nVal);
 
     SwTwips CurrentPageWidth(SwTwips &rLeft, SwTwips &rRight) const;
-    bool MiserableRTLFrmFmtHack(long &rLeft, long &rRight,
+    bool MiserableRTLFrmFmtHack(SwTwips &rLeft, SwTwips &rRight,
         const sw::Frame &rFrmFmt);
     void InsUInt16( UINT16 n )      { SwWW8Writer::InsUInt16( *pO, n ); }
     void InsUInt32( UINT32 n )      { SwWW8Writer::InsUInt32( *pO, n ); }
@@ -740,9 +740,9 @@
     WW8_WrPlcSubDoc();
     virtual ~WW8_WrPlcSubDoc();
 
-    bool WriteGenericTxt(SwWW8Writer& rWrt, BYTE nTTyp, long& rCount);
-    void WriteGenericPlc( SwWW8Writer& rWrt, BYTE nTTyp, long& rTxtStt,
-        long& rTxtCnt, long& rRefStt, long& rRefCnt ) const;
+    bool WriteGenericTxt(SwWW8Writer& rWrt, BYTE nTTyp, WW8_CP& rCount);
+    void WriteGenericPlc( SwWW8Writer& rWrt, BYTE nTTyp, WW8_FC& rTxtStt,
+        sal_Int32& rTxtCnt, WW8_FC& rRefStt, sal_Int32& rRefCnt ) const;
 
     virtual const SvULongs* GetShapeIdArr() const;
 };
Index: source/filter/ww8/ww8glsy.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8glsy.cxx,v
retrieving revision 1.23
retrieving revision 1.23.148.1
diff -u -r1.23 -r1.23.148.1
--- source/filter/ww8/ww8glsy.cxx	16 Nov 2005 13:54:04 -0000	1.23
+++ source/filter/ww8/ww8glsy.cxx	22 Feb 2006 12:59:34 -0000	1.23.148.1
@@ -329,7 +329,7 @@
         SvStream &rStrm, const WW8Fib &rFib)
 {
     WW8PLCF aPlc( &rTableStrm, rFib.fcPlcfsed, rFib.lcbPlcfsed, 12 );
-    long start,ende;
+    WW8_CP start,ende;
     void *pData;
     aPlc.Get(start,ende,pData);
     UINT32 nPo = SVBT32ToLong((BYTE *)pData+2);
Index: source/filter/ww8/ww8graf.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8graf.cxx,v
retrieving revision 1.138
retrieving revision 1.138.152.1
diff -u -r1.138 -r1.138.152.1
--- source/filter/ww8/ww8graf.cxx	10 Nov 2005 16:30:57 -0000	1.138
+++ source/filter/ww8/ww8graf.cxx	22 Feb 2006 12:59:34 -0000	1.138.152.1
@@ -952,7 +952,7 @@
     aSave.Restore(this);
 }
 
-bool SwWW8ImplReader::GetTxbxTextSttEndCp(long& rStartCp, long& rEndCp,
+bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
     USHORT nTxBxS, USHORT nSequence)
 {
     // rasch den TextBox-PLCF greifen
@@ -1087,7 +1087,7 @@
     rbEraseTextObj = false;
 
     String aString;
-    long nStartCp, nEndCp;
+    WW8_CP nStartCp, nEndCp;
     bool bContainsGraphics = false;
     bool bTextWasRead = GetTxbxTextSttEndCp( nStartCp, nEndCp, nTxBxS,
         nSequence ) && GetTxbxText( aString, nStartCp, nEndCp );
@@ -1489,7 +1489,7 @@
 void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp )
 {
     pPF->SeekPos( nGrafAnchorCp );
-    long nStartFc;
+    WW8_FC nStartFc;
     void* pF0;
     if( !pPF->Get( nStartFc, pF0 ) )
     {
@@ -2610,7 +2610,7 @@
     //Normal case of Word 8+ version stuff
     pPF->SeekPos( nGrafAnchorCp );
 
-    long nStartFc;
+    WW8_FC nStartFc;
     void* pF0;
     if( !pPF->Get( nStartFc, pF0 ) ){
         ASSERT( !this, "+Wo ist die Grafik (2) ?" );
Index: source/filter/ww8/ww8par.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.cxx,v
retrieving revision 1.163
retrieving revision 1.163.2.1
diff -u -r1.163 -r1.163.2.1
--- source/filter/ww8/ww8par.cxx	17 Feb 2006 15:28:41 -0000	1.163
+++ source/filter/ww8/ww8par.cxx	22 Feb 2006 12:59:34 -0000	1.163.2.1
@@ -2512,7 +2512,7 @@
 }
 
 // Returnwert: true for no Sonderzeichen
-bool SwWW8ImplReader::ReadPlainChars(long& rPos, long nEnd, long nCpOfs)
+bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
 {
     // Unicode-Flag neu setzen und notfalls File-Pos korrigieren
     // merke: Seek kostet nicht viel, da inline geprueft wird,
@@ -2562,7 +2562,7 @@
 
         if (pStrm->GetError())
         {
-            rPos = LONG_MAX-10;     // -> eof or other error
+            rPos = WW8_CP_MAX-10;     // -> eof or other error
             sPlainCharsBuf.ReleaseBufferAccess( 0 );
             return true;
         }
@@ -2645,7 +2645,7 @@
 }
 
 // Returnwert: true for para end
-bool SwWW8ImplReader::ReadChars(long& rPos, long nNextAttr, long nTextEnd,
+bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd,
     long nCpOfs)
 {
     long nEnd = ( nNextAttr < nTextEnd ) ? nNextAttr : nTextEnd;
@@ -2836,7 +2836,7 @@
                 if (pTest && pTest->SeekPosExact(nPosCp+1+nCpOfs) &&
                     pTest->Where() == nPosCp+1+nCpOfs)
                 {
-                    long nPos;
+                    WW8_FC nPos;
                     void *pData;
                     pTest->Get(nPos, pData);
                     sal_uInt32 nData = SVBT32ToLong(*(SVBT32*)pData);
@@ -2916,7 +2916,7 @@
     }
 }
 
-long SwWW8ImplReader::ReadTextAttr(long& rTxtPos, bool& rbStartLine)
+long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTxtPos, bool& rbStartLine)
 {
     long nSkipChars = 0;
     WW8PLCFManResult aRes;
@@ -3014,7 +3014,7 @@
     return nNext;
 }
 
-void SwWW8ImplReader::ReadAttrs(long& rNext, long& rTxtPos, bool& rbStartLine)
+void SwWW8ImplReader::ReadAttrs(WW8_CP& rNext, WW8_CP& rTxtPos, bool& rbStartLine)
 {
     if( rTxtPos >= rNext )
     {           // Stehen Attribute an ?
@@ -3206,7 +3206,7 @@
             // the plcf will already be sitting on the correct location
             // if it is there.
             WW8PLCFxDesc aTemp;
-            aTemp.nStartPos = aTemp.nEndPos = LONG_MAX;
+            aTemp.nStartPos = aTemp.nEndPos = WW8_CP_MAX;
             if (pPlcxMan->GetSepPLCF())
                 pPlcxMan->GetSepPLCF()->GetSprms(&aTemp);
             if ((aTemp.nStartPos != l) && (aTemp.nEndPos != l))
@@ -4856,7 +4856,7 @@
             // wasn't successful. Thus, continue in this case.
             // Note: Ask MM for initialization of <nStartCp> and <nEndCp>.
             // Note: Ask MM about assertions in method <rReader.GetTxbxTextSttEndCp(..)>.
-            long nStartCp, nEndCp;
+            WW8_CP nStartCp, nEndCp;
             if ( rReader.GetTxbxTextSttEndCp(nStartCp, nEndCp,
                             static_cast<sal_uInt16>((nOLEId >> 16) & 0xFFFF),
                             static_cast<sal_uInt16>(nOLEId & 0xFFFF)) )
Index: source/filter/ww8/ww8par.hxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.hxx,v
retrieving revision 1.143
retrieving revision 1.143.2.1
diff -u -r1.143 -r1.143.2.1
--- source/filter/ww8/ww8par.hxx	9 Feb 2006 13:47:25 -0000	1.143
+++ source/filter/ww8/ww8par.hxx	22 Feb 2006 12:59:35 -0000	1.143.2.1
@@ -1101,15 +1101,15 @@
     bool AddTextToParagraph(const String& sAddString);
     bool HandlePageBreakChar();
     bool ReadChar(long nPosCp, long nCpOfs);
-    bool ReadPlainChars(long& rPos, long nEnd, long nCpOfs);
-    bool ReadChars(long& rPos, long nNextAttr, long nTextEnd, long nCpOfs);
+    bool ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs);
+    bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, long nCpOfs);
 
     void SetDocumentGrid(SwFrmFmt &rFmt, const wwSection &rSection);
 
     void ProcessAktCollChange(WW8PLCFManResult& rRes, bool* pStartAttr,
         bool bCallProcessSpecial);
-    long ReadTextAttr(long& rTxtPos, bool& rbStartLine);
-    void ReadAttrs(long& rNext, long& rTxtPos, bool& rbStartLine);
+    long ReadTextAttr(WW8_CP& rTxtPos, bool& rbStartLine);
+    void ReadAttrs(WW8_CP& rNext, WW8_CP& rTxtPos, bool& rbStartLine);
     void CloseAttrEnds();
     bool ReadText(long nStartCp, long nTextLen, short nType);
 
@@ -1273,7 +1273,7 @@
     void InsertTxbxStyAttrs( SfxItemSet& rS, USHORT nColl );
     void InsertTxbxAttrs(long nStartCp, long nEndCp, bool bONLYnPicLocFc);
 
-    bool GetTxbxTextSttEndCp(long& rStartCp, long& rEndCp, USHORT nTxBxS,
+    bool GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, USHORT nTxBxS,
         USHORT nSequence);
     bool GetTxbxText(String& rString, long StartCp, long nEndCp);
     SwFrmFmt* InsertTxbxText(SdrTextObj* pTextObj, Size* pObjSiz,
@@ -1496,7 +1496,7 @@
     eF_ResT Read_F_DocInfo( WW8FieldDesc* pF, String& rStr );
     eF_ResT Read_F_Author( WW8FieldDesc*, String& );
     eF_ResT Read_F_TemplName( WW8FieldDesc*, String& );
-    short GetTimeDatePara(String& rStr, ULONG& rFormat, USHORT &rLang,
+    short GetTimeDatePara(String& rStr, sal_uInt32& rFormat, USHORT &rLang,
         int nWhichDefault, bool bHijri = false);
     bool ForceFieldLanguage(SwField &rFld, USHORT nLang);
     eF_ResT Read_F_DateTime( WW8FieldDesc*, String& rStr );
Index: source/filter/ww8/ww8par2.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8par2.cxx,v
retrieving revision 1.119
retrieving revision 1.119.64.1
diff -u -r1.119 -r1.119.64.1
--- source/filter/ww8/ww8par2.cxx	26 Jan 2006 18:20:49 -0000	1.119
+++ source/filter/ww8/ww8par2.cxx	22 Feb 2006 12:59:35 -0000	1.119.64.1
@@ -555,9 +555,9 @@
     aRes.pMemPos = 0;
     aRes.nEndPos = rStartCp;
 
-    while (pPap->HasFkp() && rStartCp != LONG_MAX)
+    while (pPap->HasFkp() && rStartCp != WW8_CP_MAX)
     {
-        if (pPap->Where() != LONG_MAX)
+        if (pPap->Where() != WW8_CP_MAX)
         {
             const BYTE* pB = pPap->HasSprm(TabRowSprm(nLevel));
             if (pB && *pB == 1)
@@ -581,7 +581,7 @@
         //Seek to our next block of properties
         if (!(pPap->SeekPos(aRes.nStartPos)))
         {
-            aRes.nEndPos = LONG_MAX;
+            aRes.nEndPos = WW8_CP_MAX;
             pPap->SetDirty(true);
         }
         pPap->GetSprms(&aRes);
@@ -1993,7 +1993,7 @@
 
         if (!(pPap->SeekPos(aRes.nStartPos)))
         {
-            aRes.nEndPos = LONG_MAX;
+            aRes.nEndPos = WW8_CP_MAX;
             pPap->SetDirty(true);
         }
         pPap->GetSprms(&aRes);
@@ -2001,8 +2001,8 @@
 
         //Are we at the end of available properties
         if (
-             !pPap->HasFkp() || pPap->Where() == LONG_MAX ||
-             aRes.nStartPos == LONG_MAX
+             !pPap->HasFkp() || pPap->Where() == WW8_CP_MAX ||
+             aRes.nStartPos == WW8_CP_MAX
            )
         {
             bOk = false;
@@ -2034,7 +2034,7 @@
         pIo->pPlcxMan->GetPap()->nOrigStartPos = aRes.nStartPos;
         if (!(pPap->SeekPos(aRes.nStartPos)))
         {
-            aRes.nEndPos = LONG_MAX;
+            aRes.nEndPos = WW8_CP_MAX;
             pPap->SetDirty(true);
         }
         pPap->GetSprms(&aRes);
Index: source/filter/ww8/ww8par5.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8par5.cxx,v
retrieving revision 1.94
retrieving revision 1.94.2.1
diff -u -r1.94 -r1.94.2.1
--- source/filter/ww8/ww8par5.cxx	9 Feb 2006 13:47:46 -0000	1.94
+++ source/filter/ww8/ww8par5.cxx	22 Feb 2006 12:59:35 -0000	1.94.2.1
@@ -681,7 +681,7 @@
     return sParams;
 }
 
-short SwWW8ImplReader::GetTimeDatePara(String& rStr, ULONG& rFormat,
+short SwWW8ImplReader::GetTimeDatePara(String& rStr, sal_uInt32& rFormat,
     USHORT &rLang, int nWhichDefault, bool bHijri)
 {
     bool bRTL = false;
@@ -1007,7 +1007,8 @@
             aF.nSCode, aF.nLCode, eTextCharSet );
         pStrm->Seek( nOldPos );
 
-        if (aStr.Search('.')>=0 || aStr.Search('/')>=0) //#124725# field codes which contain '/' or '.' are not displayed in WinWord
+        //#124725# field codes which contain '/' or '.' are not displayed in WinWord
+        if (aStr.Search('.') != STRING_NOTFOUND || aStr.Search('/') != STRING_NOTFOUND)
 			return aF.nLen;
 		else
 			return aF.nLen - aF.nLRes - 1;  // so viele ueberlesen, das Resultfeld
Index: source/filter/ww8/ww8par6.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8par6.cxx,v
retrieving revision 1.166
retrieving revision 1.166.64.1
diff -u -r1.166 -r1.166.64.1
--- source/filter/ww8/ww8par6.cxx	26 Jan 2006 18:22:17 -0000	1.166
+++ source/filter/ww8/ww8par6.cxx	22 Feb 2006 12:59:36 -0000	1.166.64.1
@@ -985,7 +985,7 @@
             pWkb->Where() == nTxtPos)
     {
         void* pData;
-        long nTest;
+        WW8_CP nTest;
         pWkb->Get(nTest, pData);
         String sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( ((WW8_WKB*)pData)->nLinkId) ];
         mrReader.ConvertFFileName(sSectionName, sSectionName);
Index: source/filter/ww8/ww8scan.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8scan.cxx,v
retrieving revision 1.123
retrieving revision 1.123.2.1
diff -u -r1.123 -r1.123.2.1
--- source/filter/ww8/ww8scan.cxx	9 Feb 2006 13:48:02 -0000	1.123
+++ source/filter/ww8/ww8scan.cxx	22 Feb 2006 12:59:36 -0000	1.123.2.1
@@ -992,7 +992,7 @@
 
 WW8_CP WW8PLCFx_PCDAttrs::Where()
 {
-    return ( pPcd ) ? pPcd->Where() : LONG_MAX;
+    return ( pPcd ) ? pPcd->Where() : WW8_CP_MAX;
 }
 
 void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
@@ -1003,7 +1003,7 @@
     if ( !pPcdI || !pPcdI->Get(p->nStartPos, p->nEndPos, pData) )
     {
         // PLCF fully processed
-        p->nStartPos = p->nEndPos = LONG_MAX;
+        p->nStartPos = p->nEndPos = WW8_CP_MAX;
         p->pMemPos = 0;
         p->nSprmsLen = 0;
         return;
@@ -1018,7 +1018,7 @@
         if( nSprmIdx >= nGrpprls )
         {
             // Invalid Index
-            p->nStartPos = p->nEndPos = LONG_MAX;
+            p->nStartPos = p->nEndPos = WW8_CP_MAX;
             p->pMemPos = 0;
             p->nSprmsLen = 0;
             return;
@@ -1190,17 +1190,17 @@
 
 WW8_CP WW8PLCFx_PCD::Where()
 {
-    return pPcdI ? pPcdI->Where() : LONG_MAX;
+    return pPcdI ? pPcdI->Where() : WW8_CP_MAX;
 }
 
-long WW8PLCFx_PCD::GetNoSprms( long& rStart, long& rEnd, long& rLen )
+long WW8PLCFx_PCD::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
 {
     void* pData;
     rLen = 0;
 
     if ( !pPcdI || !pPcdI->Get(rStart, rEnd, pData) )
     {
-        rStart = rEnd = LONG_MAX;
+        rStart = rEnd = WW8_CP_MAX;
         return -1;
     }
     return pPcdI->GetIdx();
@@ -1223,7 +1223,7 @@
     if ( !pPcdI->Get(nCpStart, nCpEnd, pData) )
     {
         ASSERT( !this, "AktPieceStartCp2Fc() with false Cp found (1)" );
-        return LONG_MAX;
+        return WW8_FC_MAX;
     }
 
     ASSERT( nCp >= nCpStart && nCp < nCpEnd,
@@ -1243,11 +1243,11 @@
 }
 
 
-void WW8PLCFx_PCD::AktPieceFc2Cp( long& rStartPos, long& rEndPos,
+void WW8PLCFx_PCD::AktPieceFc2Cp( WW8_CP& rStartPos, WW8_CP& rEndPos,
     const WW8ScannerBase *pSBase )
 {
     //No point going anywhere with this
-    if ((rStartPos == LONG_MAX) && (rEndPos == LONG_MAX))
+    if ((rStartPos == WW8_CP_MAX) && (rEndPos == WW8_CP_MAX))
         return;
 
     rStartPos = pSBase->WW8Fc2Cp( rStartPos );
@@ -1261,7 +1261,7 @@
     if ( !pPcdI->Get( nCpStart, nCpEnd, pData ) )
     {
         ASSERT( !this, "AktPieceStartFc2Cp() - Fehler" );
-        return LONG_MAX;
+        return WW8_CP_MAX;
     }
     bool bIsUnicode = false;
     INT32 nFcStart  = SVBT32ToLong( ((WW8_PCD*)pData)->fc );
@@ -1501,8 +1501,8 @@
 
 WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
 {
-    WW8_CP nFallBackCpEnd = LONG_MAX;
-    if( nFcPos == LONG_MAX )
+    WW8_CP nFallBackCpEnd = WW8_CP_MAX;
+    if( nFcPos == WW8_FC_MAX )
         return nFallBackCpEnd;
 
     bool bIsUnicode = false;
@@ -1513,7 +1513,7 @@
         for (pPieceIter->SetIdx(0);
             pPieceIter->GetIdx() < pPieceIter->GetIMax();(*pPieceIter)++)
         {
-            long nCpStart, nCpEnd;
+            WW8_CP nCpStart, nCpEnd;
             void* pData;
             if( !pPieceIter->Get( nCpStart, nCpEnd, pData ) )
             {   // ausserhalb PLCFfpcd ?
@@ -1568,8 +1568,8 @@
 {
     if( pTestFlag )
         *pTestFlag = true;
-    if( LONG_MAX == nCpPos )
-        return LONG_MAX;
+    if( WW8_CP_MAX == nCpPos )
+        return WW8_CP_MAX;
 
     bool bIsUnicode;
     if( !pIsUnicode )
@@ -1578,7 +1578,7 @@
     if( pPieceIter )
     {   // Complex File
         if( pNextPieceCp )
-            *pNextPieceCp = LONG_MAX;
+            *pNextPieceCp = WW8_CP_MAX;
 
         if( !pPieceIter->SeekPos( nCpPos ) )
         {
@@ -1586,9 +1586,9 @@
                 *pTestFlag = false;
             else
                 ASSERT( !this, "Falscher CP an WW8Cp2Fc() uebergeben" );
-            return LONG_MAX;
+            return WW8_FC_MAX;
         }
-        long nCpStart, nCpEnd;
+        WW8_CP nCpStart, nCpEnd;
         void* pData;
         if( !pPieceIter->Get( nCpStart, nCpEnd, pData ) )
         {
@@ -1596,7 +1596,7 @@
                 *pTestFlag = false;
             else
                 ASSERT( !this, "PLCFfpcd-Get ging schief" );
-            return LONG_MAX;
+            return WW8_FC_MAX;
         }
         if( pNextPieceCp )
             *pNextPieceCp = nCpEnd;
@@ -1655,7 +1655,7 @@
     pStr->Seek( nClxPos );
     nLeft = nClxLen;
     pPieceGrpprls = new BYTE*[nGrpprl + 1];
-    memset( pPieceGrpprls, 0, ( nGrpprl + 1 ) * 4 );
+    memset( pPieceGrpprls, 0, ( nGrpprl + 1 ) * sizeof(BYTE *) );
     nPieceGrpprls = nGrpprl;
     INT16 nAktGrpprl = 0;                       // lies Grpprls ein
     while( 1 )
@@ -1866,7 +1866,7 @@
 static bool WW8SkipField(WW8PLCFspecial& rPLCF)
 {
     void* pData;
-    long nP;
+    WW8_CP nP;
 
     if (!rPLCF.Get(nP, pData))              // Ende des PLCFspecial ?
         return false;
@@ -2217,16 +2217,16 @@
     return false;
 }
 
-bool WW8PLCFspecial::Get(long& rPos, void*& rpValue) const
+bool WW8PLCFspecial::Get(WW8_CP& rPos, void*& rpValue) const
 {
     return GetData( nIdx, rPos, rpValue );
 }
 
-bool WW8PLCFspecial::GetData(long nInIdx, long& rPos, void*& rpValue) const
+bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const
 {
     if ( nInIdx >= nIMax )
     {
-        rPos = LONG_MAX;
+        rPos = WW8_CP_MAX;
         return false;
     }
     rPos = pPLCF_PosArray[nInIdx];
@@ -2366,11 +2366,11 @@
     return false;
 }
 
-bool WW8PLCF::Get(long& rStart, long& rEnd, void*& rpValue) const
+bool WW8PLCF::Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const
 {
     if ( nIdx >= nIMax )
     {
-        rStart = rEnd = LONG_MAX;
+        rStart = rEnd = WW8_CP_MAX;
         return false;
     }
     rStart = pPLCF_PosArray[ nIdx ];
@@ -2379,10 +2379,10 @@
     return true;
 }
 
-long WW8PLCF::Where() const
+INT32 WW8PLCF::Where() const
 {
     if ( nIdx >= nIMax )
-        return LONG_MAX;
+        return SAL_MAX_INT32;
 
     return pPLCF_PosArray[nIdx];
 }
@@ -2453,11 +2453,11 @@
     return false;
 }
 
-bool WW8PLCFpcd_Iter::Get(long& rStart, long& rEnd, void*& rpValue) const
+bool WW8PLCFpcd_Iter::Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const
 {
     if( nIdx >= rPLCF.nIMax )
     {
-        rStart = rEnd = LONG_MAX;
+        rStart = rEnd = WW8_CP_MAX;
         return false;
     }
     rStart = rPLCF.pPLCF_PosArray[nIdx];
@@ -2466,10 +2466,10 @@
     return true;
 }
 
-long WW8PLCFpcd_Iter::Where() const
+INT32 WW8PLCFpcd_Iter::Where() const
 {
     if ( nIdx >= rPLCF.nIMax )
-        return LONG_MAX;
+        return SAL_MAX_INT32;
 
     return rPLCF.pPLCF_PosArray[nIdx];
 }
@@ -2701,14 +2701,14 @@
     return false;
 }
 
-BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::Get(WW8_FC& rStart, WW8_FC& rEnd, long& rLen)
+BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::Get(WW8_FC& rStart, WW8_FC& rEnd, sal_Int32& rLen)
     const
 {
     rLen = 0;
 
     if (mnIdx >= mnIMax)
     {
-        rStart = LONG_MAX;
+        rStart = WW8_FC_MAX;
         return 0;
     }
 
@@ -2729,7 +2729,7 @@
     return false;
 }
 
-BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::GetLenAndIStdAndSprms(long& rLen) const
+BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::GetLenAndIStdAndSprms(sal_Int32& rLen) const
 {
     rLen = maEntries[mnIdx].mnLen;
     return maEntries[mnIdx].mpData;
@@ -2740,7 +2740,7 @@
     if (mnIdx >= mnIMax)
         return 0;
 
-    long nLen;
+    sal_Int32 nLen;
     BYTE* pSprms = GetLenAndIStdAndSprms( nLen );
 
     WW8SprmIter aIter(pSprms, nLen, maSprmParser);
@@ -2753,7 +2753,7 @@
     if (mnIdx >= mnIMax)
        return false;
 
-    long nLen;
+    sal_Int32 nLen;
     BYTE* pSprms = GetLenAndIStdAndSprms( nLen );
 
     WW8SprmIter aIter(pSprms, nLen, maSprmParser);
@@ -2771,17 +2771,17 @@
 void WW8PLCFx::GetSprms( WW8PLCFxDesc* p )
 {
     ASSERT( !this, "Falsches GetSprms gerufen" );
-    p->nStartPos = p->nEndPos = LONG_MAX;
+    p->nStartPos = p->nEndPos = WW8_CP_MAX;
     p->pMemPos = 0;
     p->nSprmsLen = 0;
     p->bRealLineEnd = false;
     return;
 }
 
-long WW8PLCFx::GetNoSprms( long& rStart, long& rEnd, long& rLen )
+long WW8PLCFx::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
 {
     ASSERT( !this, "Falsches GetNoSprms gerufen" );
-    rStart = rEnd = LONG_MAX;
+    rStart = rEnd = WW8_CP_MAX;
     rLen = 0;
     return 0;
 }
@@ -2810,7 +2810,7 @@
 //-----------------------------------------
 bool WW8PLCFx_Fc_FKP::NewFkp()
 {
-    long nPLCFStart, nPLCFEnd;
+    WW8_CP nPLCFStart, nPLCFEnd;
     void* pPage;
 
     static const int WW8FkpSizeTabVer2[ PLCF_END ] =
@@ -2947,7 +2947,7 @@
     bool bRet = pPLCF->SeekPos(nFcPos);
 
     // make FKP invalid?
-    long nPLCFStart, nPLCFEnd;
+    WW8_CP nPLCFStart, nPLCFEnd;
     void* pPage;
     if( pFkp && pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ) )
     {
@@ -2966,20 +2966,20 @@
     if( !pFkp )
     {
         if( !NewFkp() )
-            return LONG_MAX;
+            return WW8_FC_MAX;
     }
     WW8_FC nP = pFkp->Where();
-    if( nP != LONG_MAX )
+    if( nP != WW8_FC_MAX )
         return nP;
 
     pFkp = 0;                   // FKP beendet -> hole neuen
     return Where();                     // am einfachsten rekursiv
 }
 
-BYTE* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, long& rLen)
+BYTE* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, sal_Int32& rLen)
 {
     rLen = 0;                               // Default
-    rStart = rEnd = LONG_MAX;
+    rStart = rEnd = WW8_FC_MAX;
 
     if( !pFkp )     // Fkp not there ?
     {
@@ -2988,7 +2988,7 @@
     }
 
     BYTE* pPos = pFkp->Get( rStart, rEnd, rLen );
-    if( rStart == LONG_MAX )    //Not found
+    if( rStart == WW8_FC_MAX )    //Not found
         return 0;
     return pPos;
 }
@@ -3002,7 +3002,7 @@
     }
 
     (*pFkp)++;
-    if( pFkp->Where() == LONG_MAX )
+    if( pFkp->Where() == WW8_FC_MAX )
         NewFkp();
 
     return *this;
@@ -3207,7 +3207,7 @@
         {
             p->bRealLineEnd = (ePLCF == PAP);
 
-            if ( ((ePLCF == PAP ) || (ePLCF == CHP)) && (nOrigCp != LONG_MAX) )
+            if ( ((ePLCF == PAP ) || (ePLCF == CHP)) && (nOrigCp != WW8_CP_MAX) )
             {
                 bool bIsUnicode=false;
                 /*
@@ -3242,7 +3242,7 @@
                 FC of the piece, the end of the paragraph that contains the
                 character is at the FKP FC minus 1.
                 */
-                long nCpStart, nCpEnd;
+                WW8_CP nCpStart, nCpEnd;
                 void* pData;
                 pPieceIter->Get(nCpStart, nCpEnd, pData);
 
@@ -3356,11 +3356,11 @@
 
     if( GetPCDIdx() >= GetPCDIMax() )           // End of PLCF
     {
-        nAttrStart = nAttrEnd = LONG_MAX;
+        nAttrStart = nAttrEnd = WW8_CP_MAX;
         return *this;
     }
 
-    long nFkpLen;                               // Fkp-Eintrag
+    sal_Int32 nFkpLen;                               // Fkp-Eintrag
     // Fkp-Eintrag holen
     WW8PLCFx_Fc_FKP::GetSprmsAndPos(nAttrStart, nAttrEnd, nFkpLen);
 
@@ -3419,7 +3419,7 @@
     p->bRealLineEnd = false;
     if (!pPLCF->Get( p->nStartPos, p->nEndPos, pData ))
     {
-        p->nStartPos = p->nEndPos = LONG_MAX;       // PLCF fertig abgearbeitet
+        p->nStartPos = p->nEndPos = WW8_CP_MAX;       // PLCF fertig abgearbeitet
         p->pMemPos = 0;
         p->nSprmsLen = 0;
     }
@@ -3428,7 +3428,7 @@
         long nPo =  SVBT32ToLong( (BYTE*)pData+2 );
         if (nPo == -1L)
         {
-            p->nStartPos = p->nEndPos = LONG_MAX;       // Sepx empty
+            p->nStartPos = p->nEndPos = WW8_CP_MAX;   // Sepx empty
             p->pMemPos = 0;
             p->nSprmsLen = 0;
         }
@@ -3584,12 +3584,12 @@
 
 WW8_CP WW8PLCFx_SubDoc::Where()
 {
-    return ( pRef ) ? pRef->Where() : LONG_MAX;
+    return ( pRef ) ? pRef->Where() : WW8_CP_MAX;
 }
 
 void WW8PLCFx_SubDoc::GetSprms(WW8PLCFxDesc* p)
 {
-    p->nStartPos = p->nEndPos = LONG_MAX;
+    p->nStartPos = p->nEndPos = WW8_CP_MAX;
     p->pMemPos = 0;
     p->nSprmsLen = 0;
     p->bRealLineEnd = false;
@@ -3600,10 +3600,10 @@
     ULONG nNr = pRef->GetIdx();
 
     void *pData;
-    long nFoo;
+    WW8_CP nFoo;
     if (!pRef->Get(p->nStartPos, nFoo, pData))
     {
-        p->nEndPos = p->nStartPos = LONG_MAX;
+        p->nEndPos = p->nStartPos = WW8_CP_MAX;
         return;
     }
 
@@ -3616,7 +3616,7 @@
 
     if (!pTxt->Get(p->nCp2OrIdx, p->nSprmsLen, pData))
     {
-        p->nEndPos = p->nStartPos = LONG_MAX;
+        p->nEndPos = p->nStartPos = WW8_CP_MAX;
         p->nSprmsLen = 0;
         return;
     }
@@ -3702,13 +3702,13 @@
 
 WW8_CP WW8PLCFx_FLD::Where()
 {
-    return pPLCF ? pPLCF->Where() : LONG_MAX;
+    return pPLCF ? pPLCF->Where() : WW8_CP_MAX;
 }
 
 bool WW8PLCFx_FLD::StartPosIsFieldStart()
 {
     void* pData;
-    long nTest;
+    sal_Int32 nTest;
     if (
          (!pPLCF || !pPLCF->Get(nTest, pData) ||
          ((((BYTE*)pData)[0] & 0x1f) != 0x13))
@@ -3728,7 +3728,7 @@
         (*pPLCF)++;
 
         void* pData;
-        long nTest;
+        sal_Int32 nTest;
         if ( pPLCF->Get(nTest, pData) && ((((BYTE*)pData)[0] & 0x1f) == 0x15) )
             bRet = true;
 
@@ -3740,24 +3740,24 @@
 
 void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p)
 {
-    p->nStartPos = p->nEndPos = LONG_MAX;
+    p->nStartPos = p->nEndPos = WW8_CP_MAX;
     p->pMemPos = 0;
     p->nSprmsLen = 0;
     p->bRealLineEnd = false;
 
     if (!pPLCF)
     {
-        p->nStartPos = LONG_MAX;                    // Es gibt keine Felder
+        p->nStartPos = WW8_CP_MAX;                    // Es gibt keine Felder
         return;
     }
 
     long n = pPLCF->GetIdx();
 
-    long nP;
+    sal_Int32 nP;
     void *pData;
     if (!pPLCF->Get(nP, pData))             // Ende des PLCFspecial ?
     {
-        p->nStartPos = LONG_MAX;            // PLCF fertig abgearbeitet
+        p->nStartPos = WW8_CP_MAX;            // PLCF fertig abgearbeitet
         return;
     }
 
@@ -3766,7 +3766,7 @@
     (*pPLCF)++;
     if (!pPLCF->Get(nP, pData))             // Ende des PLCFspecial ?
     {
-        p->nStartPos = LONG_MAX;            // PLCF fertig abgearbeitet
+        p->nStartPos = WW8_CP_MAX;            // PLCF fertig abgearbeitet
         return;
     }
 
@@ -4008,15 +4008,15 @@
     return pBook[nIsEnd]->Where();
 }
 
-long WW8PLCFx_Book::GetNoSprms( long& rStart, long& rEnd, long& rLen )
+long WW8PLCFx_Book::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
 {
     void* pData;
-    rEnd = LONG_MAX;
+    rEnd = WW8_CP_MAX;
     rLen = 0;
 
     if (!pBook[0] || !pBook[1] || !nIMax || (pBook[nIsEnd]->GetIdx()) >= nIMax)
     {
-        rStart = rEnd = LONG_MAX;
+        rStart = rEnd = WW8_CP_MAX;
         return -1;
     }
 
@@ -4207,7 +4207,7 @@
 
     if ( (&rDesc == pPap) && rDesc.bRealLineEnd )
     {
-        if ( pPap->nEndPos != LONG_MAX )    // Para adjust
+        if ( pPap->nEndPos != WW8_CP_MAX )    // Para adjust
         {
             nLineEnd = pPap->nEndPos;// nLineEnd zeigt *hinter* das <CR>
             pPap->nEndPos--;        // Absatzende um 1 Zeichen verkuerzen
@@ -4233,10 +4233,10 @@
 
 void WW8PLCFxDesc::ReduceByOffset()
 {
-    ASSERT((LONG_MAX == nStartPos) || (nStartPos <= nEndPos),
+    ASSERT((WW8_CP_MAX == nStartPos) || (nStartPos <= nEndPos),
             "Attr-Anfang und -Ende ueber Kreuz" );
 
-    if( nStartPos != LONG_MAX )
+    if( nStartPos != WW8_CP_MAX )
     {
         /*
         ##516##,##517##
@@ -4249,7 +4249,7 @@
         else
             nStartPos -= nCpOfs;
     }
-    if( nEndPos   != LONG_MAX )
+    if( nEndPos != WW8_CP_MAX )
     {
         ASSERT(nCpOfs <= nEndPos,
             "oh oh, so much for the subdocument piece theory");
@@ -4272,7 +4272,7 @@
     rDesc.nCp2OrIdx = rDesc.pPLCFx->GetNoSprms(rDesc.nStartPos, rDesc.nEndPos,
         rDesc.nSprmsLen);
 
-    ASSERT((LONG_MAX == rDesc.nStartPos) || (rDesc.nStartPos <= rDesc.nEndPos),
+    ASSERT((WW8_CP_MAX == rDesc.nStartPos) || (rDesc.nStartPos <= rDesc.nEndPos),
             "Attr-Anfang und -Ende ueber Kreuz" );
 
     rDesc.ReduceByOffset();
@@ -4310,7 +4310,7 @@
 
     nLastWhereIdxCp = 0;
     memset( aD, 0, sizeof( aD ) );
-    nLineEnd = LONG_MAX;
+    nLineEnd = WW8_CP_MAX;
     nManType = nType;
     USHORT i;
 
@@ -4447,7 +4447,7 @@
         if ((p == pChp) || (p == pPap))
             p->nStartPos = p->nEndPos = nStartCp;
         else
-            p->nStartPos = p->nEndPos = LONG_MAX;
+            p->nStartPos = p->nEndPos = WW8_CP_MAX;
     }
 
     // initialisieren der Member-Vars High-Level
@@ -4456,7 +4456,7 @@
 
         if( !p->pPLCFx )
         {
-            p->nStartPos = p->nEndPos = LONG_MAX;
+            p->nStartPos = p->nEndPos = WW8_CP_MAX;
             continue;
         }
 
@@ -4471,7 +4471,7 @@
                 p->nSprmsLen = 0;
                 p->nStartPos = nTemp;
                 if (!(*p->pPLCFx).SeekPos(p->nStartPos))
-                    p->nEndPos = p->nStartPos = LONG_MAX;
+                    p->nEndPos = p->nStartPos = WW8_CP_MAX;
                 else
                     GetNewSprms( *p );
             }
@@ -4505,7 +4505,7 @@
         pD = &aD[i];
         if (pD != pPcdA)
         {
-            if( (pD->nEndPos < nNext) && (pD->nStartPos == LONG_MAX) )
+            if( (pD->nEndPos < nNext) && (pD->nStartPos == WW8_CP_MAX) )
             {
                 // sonst ist Anfang = Ende
                 nNext = pD->nEndPos;
@@ -4720,7 +4720,7 @@
                 p->nSprmsLen = 0;
         }
         if (p->nSprmsLen < maSprmParser.MinSprmLen())
-            p->nStartPos = LONG_MAX;    // es folgen Enden
+            p->nStartPos = WW8_CP_MAX;    // es folgen Enden
     }
     else
     {
@@ -4743,7 +4743,7 @@
                 */
                 if (!(*p->pPLCFx).SeekPos(p->nStartPos))
                 {
-                    p->nEndPos = LONG_MAX;
+                    p->nEndPos = WW8_CP_MAX;
                     p->pPLCFx->SetDirty(true);
                 }
                 if (!p->pPLCFx->GetDirty() || pPcd)
@@ -4774,7 +4774,7 @@
                 the pap and chps.
                 */
                 if (pPcd && ((p->nStartPos > pPcd->nStartPos) ||
-                    (pPcd->nStartPos == LONG_MAX)) &&
+                    (pPcd->nStartPos == WW8_CP_MAX)) &&
                     (pPcd->nEndPos != p->nStartPos))
                 {
                     pPcd->nEndPos = p->nStartPos;
@@ -5002,7 +5002,7 @@
             aD.nCpOfs = rSave.nCpOfs = nCpOfs;
             if (!(pPLCFx->SeekPos(aD.nStartPos)))
             {
-                aD.nEndPos = LONG_MAX;
+                aD.nEndPos = WW8_CP_MAX;
                 pPLCFx->SetDirty(true);
             }
             pPLCFx->GetSprms(&aD);
@@ -5026,7 +5026,7 @@
             nCpOfs = aD.nCpOfs = rSave.nCpOfs;
             if (!(pPLCFx->SeekPos(aD.nStartPos)))
             {
-                aD.nEndPos = LONG_MAX;
+                aD.nEndPos = WW8_CP_MAX;
                 pPLCFx->SetDirty(true);
             }
             pPLCFx->GetSprms(&aD);
Index: source/filter/ww8/ww8scan.hxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8scan.hxx,v
retrieving revision 1.76
retrieving revision 1.76.2.1
diff -u -r1.76 -r1.76.2.1
--- source/filter/ww8/ww8scan.hxx	9 Feb 2006 13:48:16 -0000	1.76
+++ source/filter/ww8/ww8scan.hxx	22 Feb 2006 12:59:36 -0000	1.76.2.1
@@ -199,10 +199,10 @@
 struct WW8FieldDesc
 {
     long nLen;              // Gesamtlaenge ( zum Text ueberlesen )
-    WW8_CP nSCode;           // Anfang Befehlscode
-    long nLCode;            // Laenge
+    WW8_CP nSCode;          // Anfang Befehlscode
+    WW8_CP nLCode;          // Laenge
     WW8_CP nSRes;           // Anfang Ergebnis
-    long nLRes;             // Laenge ( == 0, falls kein Ergebnis )
+    WW8_CP nLRes;           // Laenge ( == 0, falls kein Ergebnis )
     USHORT nId;             // WW-Id fuer Felder
     BYTE nOpt;              // WW-Flags ( z.B.: vom User geaendert )
     BYTE bCodeNest:1;       // Befehl rekursiv verwendet
@@ -244,18 +244,18 @@
     bool SeekPos(long nPos);            // geht ueber FC- bzw. CP-Wert
                                         // bzw. naechste groesseren Wert
     bool SeekPosExact(long nPos);
-    long Where() const 
-        { return ( nIdx >= nIMax ) ? LONG_MAX : pPLCF_PosArray[nIdx]; }
-    bool Get(long& rStart, void*& rpValue) const;
-    bool GetData(long nIdx, long& rPos, void*& rpValue) const;
+    INT32 Where() const 
+        { return ( nIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nIdx]; }
+    bool Get(WW8_CP& rStart, void*& rpValue) const;
+    bool GetData(long nIdx, WW8_CP& rPos, void*& rpValue) const;
 
     const void* GetData( long nInIdx ) const 
     {
         return ( nInIdx >= nIMax ) ? 0 
             : (const void*)&pPLCF_Contents[nInIdx * nStru]; 
     }
-    long GetPos( long nInIdx ) const
-        { return ( nInIdx >= nIMax ) ? LONG_MAX : pPLCF_PosArray[nInIdx]; }
+    INT32 GetPos( long nInIdx ) const
+        { return ( nInIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nInIdx]; }
 
     WW8PLCFspecial& operator ++( int ) { nIdx++; return *this; }
     WW8PLCFspecial& operator --( int ) { nIdx--; return *this; }
@@ -323,8 +323,8 @@
     void SetIdx( long nI ) { nIdx = nI; }
     long GetIMax() const { return nIMax; }
     bool SeekPos(long nPos);
-    long Where() const;
-    bool Get(long& rStart, long& rEnd, void*& rpValue) const;
+    INT32 Where() const;
+    bool Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const;
     WW8PLCF& operator ++( int ) { if( nIdx < nIMax ) nIdx++; return *this; }
 
     const void* GetData( long nInIdx ) const 
@@ -363,8 +363,8 @@
     void SetIdx( long nI ) { nIdx = nI; }
     long GetIMax() const { return rPLCF.nIMax; }
     bool SeekPos(long nPos);
-    long Where() const;
-    bool Get(long& rStart, long& rEnd, void*& rpValue) const;
+    INT32 Where() const;
+    bool Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const;
     WW8PLCFpcd_Iter& operator ++( int ) 
     { 
         if( nIdx < rPLCF.nIMax ) 
@@ -402,9 +402,9 @@
     virtual ULONG GetIdx2() const;
     virtual void SetIdx2( ULONG nIdx );
     virtual bool SeekPos(WW8_CP nCpPos) = 0;
-    virtual long Where() = 0;
+    virtual WW8_FC Where() = 0;
     virtual void GetSprms( WW8PLCFxDesc* p );
-    virtual long GetNoSprms( long& rStart, long&, long& rLen );
+    virtual long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen );
     virtual WW8PLCFx& operator ++( int ) = 0;
     virtual USHORT GetIstd() const { return 0xffff; }
     virtual void Save( WW8PLCFxSave1& rSave ) const;
@@ -435,7 +435,7 @@
     virtual ULONG GetIdx() const;
     virtual void SetIdx( ULONG nI );
     virtual bool SeekPos(WW8_CP nCpPos);
-    virtual long Where();
+    virtual WW8_FC Where();
     virtual void GetSprms( WW8PLCFxDesc* p );
     virtual WW8PLCFx& operator ++( int );
 
@@ -460,12 +460,12 @@
     virtual ULONG GetIdx() const;
     virtual void SetIdx( ULONG nI );
     virtual bool SeekPos(WW8_CP nCpPos);
-    virtual long Where();
-    virtual long GetNoSprms( long& rStart, long&, long& rLen );
+    virtual WW8_FC Where();
+    virtual long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen );
     virtual WW8PLCFx& operator ++( int );
     WW8_CP AktPieceStartFc2Cp( WW8_FC nStartPos );
     WW8_FC AktPieceStartCp2Fc( WW8_CP nCp );
-    void AktPieceFc2Cp(long& rStartPos, long& rEndPos, 
+    void AktPieceFc2Cp(WW8_CP& rStartPos, WW8_CP& rEndPos, 
         const WW8ScannerBase *pSBase);
     WW8PLCFpcd_Iter* GetPLCFIter() { return pPcdI; }
     void SetClipStart(WW8_CP nIn) { nClipStart = nIn; }
@@ -529,7 +529,7 @@
         bool SeekPos(WW8_FC nFc);
         WW8_FC Where() const 
         { 
-            return (mnIdx < mnIMax) ? maEntries[mnIdx].mnFC : LONG_MAX; 
+            return (mnIdx < mnIMax) ? maEntries[mnIdx].mnFC : WW8_FC_MAX; 
         }
         WW8Fkp& operator ++( int ) 
         { 
@@ -537,14 +537,14 @@
                 mnIdx++;
             return *this; 
         }
-        BYTE* Get( WW8_FC& rStart, WW8_FC& rEnd, long& rLen ) const;
+        BYTE* Get( WW8_FC& rStart, WW8_FC& rEnd, sal_Int32& rLen ) const;
         sal_uInt16 GetIstd() const { return maEntries[mnIdx].mnIStd; }
 
         /*
             liefert einen echten Pointer auf das Sprm vom Typ nId,
             falls ein solches im Fkp drin ist.
         */
-        BYTE* GetLenAndIStdAndSprms(long& rLen) const;
+        BYTE* GetLenAndIStdAndSprms(sal_Int32& rLen) const;
 
         /*
             ruft GetLenAndIStdAndSprms() auf...
@@ -593,7 +593,7 @@
     virtual void SetIdx( ULONG nIdx );
     virtual bool SeekPos(WW8_FC nFcPos);
     virtual WW8_FC Where();
-    BYTE* GetSprmsAndPos( WW8_FC& rStart, WW8_FC& rEnd, long& rLen );
+    BYTE* GetSprmsAndPos( WW8_FC& rStart, WW8_FC& rEnd, sal_Int32& rLen );
     virtual WW8PLCFx& operator ++( int );
     virtual USHORT GetIstd() const;
     void GetPCDSprms( WW8PLCFxDesc& rDesc );
@@ -656,7 +656,7 @@
     virtual void SetIdx( ULONG nIdx );
     long GetIMax() const { return ( pPLCF ) ? pPLCF->GetIMax() : 0; }
     virtual bool SeekPos(WW8_CP nCpPos);
-    virtual long Where();
+    virtual WW8_FC Where();
     virtual void GetSprms( WW8PLCFxDesc* p );
     virtual WW8PLCFx& operator ++( int );
     const BYTE* HasSprm( USHORT nId ) const;
@@ -684,7 +684,7 @@
     virtual ULONG GetIdx() const;
     virtual void SetIdx( ULONG nIdx );
     virtual bool SeekPos(WW8_CP nCpPos);
-    virtual long Where();
+    virtual WW8_FC Where();
 
     // liefert Reference Descriptoren
     const void* GetData( long nIdx = -1 ) const
@@ -714,7 +714,7 @@
     virtual ULONG GetIdx() const;
     virtual void SetIdx( ULONG nIdx );
     virtual bool SeekPos(WW8_CP nCpPos);
-    virtual long Where();
+    virtual WW8_FC Where();
     virtual void GetSprms(WW8PLCFxDesc* p);
     virtual WW8PLCFx& operator ++( int );
     bool StartPosIsFieldStart();
@@ -746,12 +746,12 @@
     virtual ULONG GetIdx2() const;
     virtual void SetIdx2( ULONG nIdx );
     virtual bool SeekPos(WW8_CP nCpPos);
-    virtual long Where();
-    virtual long GetNoSprms( long& rStart, long& rEnd, long& rLen );
+    virtual WW8_FC Where();
+    virtual long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen );
     virtual WW8PLCFx& operator ++( int );
     const String* GetName() const;
     WW8_CP GetStartPos() const
-        { return ( nIsEnd ) ? LONG_MAX : pBook[0]->Where(); }
+        { return ( nIsEnd ) ? WW8_CP_MAX : pBook[0]->Where(); }
     long GetLen() const;
     bool GetIsEnd() const { return nIsEnd ? true : false; }
     long GetHandle() const;
@@ -799,32 +799,32 @@
     const BYTE* pMemPos;// wo liegen die Sprm(s)
     long nOrigSprmsLen;
 
-    long nStartPos;
-    long nEndPos;
+    WW8_CP nStartPos;
+    WW8_CP nEndPos;
 
-    long nOrigStartPos;
-    long nOrigEndPos;   // The ending character position of a paragraph is
-                        // always one before the end reported in the FKP,
-                        // also a character run that ends on the same location
-                        // as the paragraph mark is adjusted to end just before
-                        // the paragraph mark so as to handle their close
-                        // first. The value being used to determing where the
-                        // properties end is in nEndPos, but the original
-                        // unadjusted end character position is important as
-                        // it can be used as the beginning cp of the next set
-                        // of properties
-
-    long nCp2OrIdx;     // wo liegen die NoSprm(s)
-    long nSprmsLen;     // wie viele Bytes fuer weitere Sprms / Laenge Fussnote
-    long nCpOfs;        // fuer Offset Header .. Footnote
-    bool bFirstSprm;    // fuer Erkennung erster Sprm einer Gruppe
-    bool bRealLineEnd;  // false bei Pap-Piece-Ende
+    WW8_CP nOrigStartPos;
+    WW8_CP nOrigEndPos;   // The ending character position of a paragraph is
+                          // always one before the end reported in the FKP,
+                          // also a character run that ends on the same location
+                          // as the paragraph mark is adjusted to end just before
+                          // the paragraph mark so as to handle their close
+                          // first. The value being used to determing where the
+                          // properties end is in nEndPos, but the original
+                          // unadjusted end character position is important as
+                          // it can be used as the beginning cp of the next set
+                          // of properties
+
+    WW8_CP nCp2OrIdx;     // wo liegen die NoSprm(s)
+    sal_Int32 nSprmsLen;  // wie viele Bytes fuer weitere Sprms / Laenge Fussnote
+    long nCpOfs;          // fuer Offset Header .. Footnote
+    bool bFirstSprm;      // fuer Erkennung erster Sprm einer Gruppe
+    bool bRealLineEnd;    // false bei Pap-Piece-Ende
     void Save( WW8PLCFxSave1& rSave ) const;
     void Restore( const WW8PLCFxSave1& rSave );
-    //With nStartPos set to LONG_MAX then in the case of a pap or chp
+    //With nStartPos set to WW8_CP_MAX then in the case of a pap or chp
     //GetSprms will not search for the sprms, but instead take the
     //existing ones.
-    WW8PLCFxDesc() : pIdStk(0), nStartPos(LONG_MAX) {}
+    WW8PLCFxDesc() : pIdStk(0), nStartPos(WW8_CP_MAX) {}
     void ReduceByOffset();
 };
 
@@ -839,7 +839,7 @@
     wwSprmParser maSprmParser;
     long nCpO;                      // Origin Cp -- the basis for nNewCp
 
-    long nLineEnd;                  // zeigt *hinter* das <CR>
+    WW8_CP nLineEnd;                // zeigt *hinter* das <CR>
     long nLastWhereIdxCp;           // last result of WhereIdx()
     USHORT nPLCF;                   // so viele PLCFe werden verwaltet
     short nManType;
@@ -875,7 +875,7 @@
         Where fragt, an welcher naechsten Position sich irgendein
         Attr aendert...
     */
-    long Where() const;
+    WW8_CP Where() const;
 
     bool Get(WW8PLCFManResult* pResult) const;
     WW8PLCFMan& operator ++( int );
Index: source/filter/ww8/ww8struc.hxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8struc.hxx,v
retrieving revision 1.33
retrieving revision 1.33.64.1
diff -u -r1.33 -r1.33.64.1
--- source/filter/ww8/ww8struc.hxx	26 Jan 2006 18:23:07 -0000	1.33
+++ source/filter/ww8/ww8struc.hxx	22 Feb 2006 12:59:36 -0000	1.33.64.1
@@ -129,6 +129,9 @@
 typedef sal_Int32 WW8_FC;
 typedef sal_Int32 WW8_CP;
 
+const WW8_FC WW8_FC_MAX = SAL_MAX_INT32;
+const WW8_CP WW8_CP_MAX = SAL_MAX_INT32;
+
 // STD: STyle Definition
 //   The STD contains the entire definition of a style.
 //   It has two parts, a fixed-length base (cbSTDBase bytes long)
Index: source/filter/xml/swxml.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/xml/swxml.cxx,v
retrieving revision 1.68
retrieving revision 1.68.28.1
diff -u -r1.68 -r1.68.28.1
--- source/filter/xml/swxml.cxx	3 Feb 2006 17:19:12 -0000	1.68
+++ source/filter/xml/swxml.cxx	22 Feb 2006 12:59:37 -0000	1.68.28.1
@@ -527,7 +527,7 @@
 }
 // <--
 
-sal_uInt32 XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, const String & rName )
+ULONG XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, const String & rName )
 {
 	// Get service factory
 	Reference< lang::XMultiServiceFactory > xServiceFactory =
@@ -821,7 +821,7 @@
 	}
 
 	rDoc.AddLink();	// prevent deletion
-	sal_uInt32 nRet = 0;
+	ULONG nRet = 0;
 
 	// save redline mode into import info property set
 	Any aAny;
Index: source/ui/config/fontcfg.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/config/fontcfg.cxx,v
retrieving revision 1.18
retrieving revision 1.18.42.1
diff -u -r1.18 -r1.18.42.1
--- source/ui/config/fontcfg.cxx	1 Feb 2006 13:48:27 -0000	1.18
+++ source/ui/config/fontcfg.cxx	20 Feb 2006 17:30:32 -0000	1.18.42.1
@@ -205,7 +205,7 @@
         else
         {
             if(nDefaultFontHeight[nProp - DEF_FONT_COUNT] > 0)
-                pValues[nProp] <<= TWIP_TO_MM100(nDefaultFontHeight[nProp - DEF_FONT_COUNT]);
+                pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(nDefaultFontHeight[nProp - DEF_FONT_COUNT]));
         }            
 	}
 	PutProperties(aNames, aValues);
Index: source/ui/config/usrpref.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/config/usrpref.cxx,v
retrieving revision 1.29
retrieving revision 1.29.238.1
diff -u -r1.29 -r1.29.238.1
--- source/ui/config/usrpref.cxx	9 Sep 2005 06:47:21 -0000	1.29
+++ source/ui/config/usrpref.cxx	20 Feb 2006 17:30:32 -0000	1.29.238.1
@@ -336,7 +336,7 @@
             case 11: pValues[nProp] <<= (sal_Int32)rParent.GetZoom(); break;// "Zoom/Value",
             case 12: pValues[nProp] <<= (sal_Int32)rParent.GetZoomType(); break;// "Zoom/Type",
             case 13: pValues[nProp] <<= (sal_Int32)rParent.GetMetric(); break;// "Other/MeasureUnit",
-            case 14: pValues[nProp] <<= TWIP_TO_MM100(rParent.GetDefTab()); break;// "Other/TabStop",
+            case 14: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
             case 15: bSet = rParent.IsVRulerRight(); break;// "Window/IsVerticalRulerRight",
         }
         if(nProp < 8 || nProp == 10)
Index: source/ui/envelp/envimg.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/envelp/envimg.cxx,v
retrieving revision 1.9
retrieving revision 1.9.234.1
diff -u -r1.9 -r1.9.234.1
--- source/ui/envelp/envimg.cxx	9 Sep 2005 07:25:26 -0000	1.9
+++ source/ui/envelp/envimg.cxx	20 Feb 2006 17:30:32 -0000	1.9.234.1
@@ -308,16 +308,16 @@
 			case  0: pValues[nProp] <<= aEnvItem.aAddrText; break;// "Inscription/Addressee",
 			case  1: pValues[nProp] <<= aEnvItem.aSendText; break;// "Inscription/Sender",
 			case  2: pValues[nProp].setValue(&aEnvItem.bSend, rType);break;// "Inscription/UseSender",
-			case  3: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lAddrFromLeft) ; break;// "Format/AddresseeFromLeft",
-			case  4: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lAddrFromTop)  ; break;// "Format/AddresseeFromTop",
-			case  5: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lSendFromLeft) ; break;// "Format/SenderFromLeft",
-			case  6: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lSendFromTop)  ; break;// "Format/SenderFromTop",
-			case  7: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lWidth)  ; break;// "Format/Width",
-			case  8: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lHeight) ; break;// "Format/Height",
+			case  3: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lAddrFromLeft)) ; break;// "Format/AddresseeFromLeft",
+			case  4: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lAddrFromTop))  ; break;// "Format/AddresseeFromTop",
+			case  5: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lSendFromLeft)) ; break;// "Format/SenderFromLeft",
+			case  6: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lSendFromTop))  ; break;// "Format/SenderFromTop",
+			case  7: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lWidth))  ; break;// "Format/Width",
+			case  8: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lHeight)) ; break;// "Format/Height",
 			case  9: pValues[nProp] <<= sal_Int32(aEnvItem.eAlign); break;// "Print/Alignment",
 			case 10: pValues[nProp].setValue(&aEnvItem.bPrintFromAbove, rType); break;// "Print/FromAbove",
-			case 11: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lShiftRight);break; // "Print/Right",
-			case 12: pValues[nProp] <<= TWIP_TO_MM100(aEnvItem.lShiftDown); break;// "Print/Down"
+			case 11: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lShiftRight));break; // "Print/Right",
+			case 12: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lShiftDown)); break;// "Print/Down"
 		}
 	}
 	PutProperties(aNames, aValues);
Index: source/ui/envelp/labimg.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/envelp/labimg.cxx,v
retrieving revision 1.7
retrieving revision 1.7.238.1
diff -u -r1.7 -r1.7.238.1
--- source/ui/envelp/labimg.cxx	9 Sep 2005 07:29:53 -0000	1.7
+++ source/ui/envelp/labimg.cxx	20 Feb 2006 17:30:32 -0000	1.7.238.1
@@ -447,12 +447,12 @@
 			case  2: pValues[nProp] <<= aItem.aType;			break;// "Medium/Type",
 			case  3: pValues[nProp] <<= aItem.nCols; 			break;// "Format/Column",
 			case  4: pValues[nProp] <<= aItem.nRows; 			break;// "Format/Row",
-			case  5: pValues[nProp] <<= TWIP_TO_MM100(aItem.lHDist);break;// "Format/HorizontalDistance",
-			case  6: pValues[nProp] <<= TWIP_TO_MM100(aItem.lVDist);break;// "Format/VerticalDistance",
-			case  7: pValues[nProp] <<= TWIP_TO_MM100(aItem.lWidth);			break;// "Format/Width",
-			case  8: pValues[nProp] <<= TWIP_TO_MM100(aItem.lHeight);			break;// "Format/Height",
-			case  9: pValues[nProp] <<= TWIP_TO_MM100(aItem.lLeft);			break;// "Format/LeftMargin",
-			case 10: pValues[nProp] <<= TWIP_TO_MM100(aItem.lUpper);			break;// "Format/TopMargin",
+			case  5: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHDist));break;// "Format/HorizontalDistance",
+			case  6: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lVDist));break;// "Format/VerticalDistance",
+			case  7: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lWidth));			break;// "Format/Width",
+			case  8: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHeight));			break;// "Format/Height",
+			case  9: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lLeft));			break;// "Format/LeftMargin",
+			case 10: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lUpper));			break;// "Format/TopMargin",
 			case 11: pValues[nProp].setValue(&aItem.bSynchron, rType); break;// "Option/Synchronize",
 			case 12: pValues[nProp].setValue(&aItem.bPage, rType); break;// "Option/Page",
 			case 13: pValues[nProp] <<= aItem.nCol; 	break;// "Option/Column",
