Index: sw/inc/IDocumentBookmarkAccess.hxx
===================================================================
RCS file: /cvs/sw/sw/inc/IDocumentBookmarkAccess.hxx,v
retrieving revision 1.3
diff -u -r1.3 IDocumentBookmarkAccess.hxx
--- sw/inc/IDocumentBookmarkAccess.hxx	11 Oct 2006 08:41:22 -0000	1.3
+++ sw/inc/IDocumentBookmarkAccess.hxx	31 Jul 2007 20:53:59 -0000
@@ -45,6 +45,7 @@
 class SwPaM;
 class KeyCode;
 class String;
+class SwPosition;
 
  /** Provides access to the bookmarks of a document.
  */
@@ -147,7 +148,10 @@
        the bookmark.
     */
     virtual SwBookmark& getBookmark(  /*[in]*/sal_uInt16 nPos, /*[in]*/bool bBkmrk) = 0;
-    
+
+    virtual SwBookmark* getFieldBookmarkFor(const SwPosition &pos) const = 0;    
+    virtual SwBookmark* getNextFieldBookmarkFor(const SwPosition &pos) const = 0;    
+    virtual SwBookmark* getPrevFieldBookmarkFor(const SwPosition &pos) const = 0;    
 protected:
     virtual ~IDocumentBookmarkAccess() {};
  };
Index: sw/inc/IDocumentSettingAccess.hxx
===================================================================
RCS file: /cvs/sw/sw/inc/IDocumentSettingAccess.hxx,v
retrieving revision 1.6
diff -u -r1.6 IDocumentSettingAccess.hxx
--- sw/inc/IDocumentSettingAccess.hxx	20 Jun 2007 10:10:38 -0000	1.6
+++ sw/inc/IDocumentSettingAccess.hxx	31 Jul 2007 20:53:59 -0000
@@ -87,6 +87,7 @@
 
          UNIX_FORCE_ZERO_EXT_LEADING,
          USE_OLD_PRINTER_METRICS,
+	 PROTECT_FORM,
          // COMPATIBILITY FLAGS END
 
          BROWSE_MODE,
Index: sw/inc/crsrsh.hxx
===================================================================
RCS file: /cvs/sw/sw/inc/crsrsh.hxx,v
retrieving revision 1.37
diff -u -r1.37 crsrsh.hxx
--- sw/inc/crsrsh.hxx	27 Jun 2007 13:13:02 -0000	1.37
+++ sw/inc/crsrsh.hxx	31 Jul 2007 20:54:00 -0000
@@ -619,6 +619,12 @@
 		// werden, es wird dann bei gleichen Namen nur durchnumeriert.
 	void MakeUniqueBookmarkName( String& rNm );
 
+        bool IsFormProtected();
+        SwBookmark* IsInFieldBookmark();
+        SwBookmark* GetNextFieldBookmark();
+        SwBookmark* GetPrevFieldBookmark();
+        bool GotoFieldBookmark(SwBookmark *pBkmk);
+
 	// aktualisiere den Crsrs, d.H. setze ihn wieder in den Content.
 	// Das sollte nur aufgerufen werden, wenn der Cursor z.B. beim
 	// Loeschen von Rahmen irgendwohin gesetzt wurde. Die Position
Index: sw/inc/doc.hxx
===================================================================
RCS file: /cvs/sw/sw/inc/doc.hxx,v
retrieving revision 1.140
diff -u -r1.140 doc.hxx
--- sw/inc/doc.hxx	18 Jul 2007 12:54:37 -0000	1.140
+++ sw/inc/doc.hxx	31 Jul 2007 20:54:02 -0000
@@ -612,7 +612,7 @@
     bool mbClipAsCharacterAnchoredWriterFlyFrames   : 1;   // OD 2006-04-13 #b6402800#
     bool mbUnixForceZeroExtLeading                  : 1;   // FME 2006-10-09 #i60945#
     bool mbOldPrinterMetrics                        : 1;   // FME 2007-05-14 #147385#
-
+    bool mbProtectForm                              : 1;
     //
     // COMPATIBILITY FLAGS END
     //
@@ -778,6 +778,10 @@
     virtual void makeUniqueBookmarkName( /*[in/out]*/String& rName );
     virtual sal_uInt16 getBookmarkCount( /*[in]*/ bool bBkmrk ) const;
     virtual SwBookmark& getBookmark( /*[in]*/sal_uInt16 nPos, /*[in]*/bool bBkmrk );
+    SwBookmark* getFieldBookmarkFor(const SwPosition &pos) const;
+    SwBookmark* getNextFieldBookmarkFor(const SwPosition &pos) const;
+    SwBookmark* getPrevFieldBookmarkFor(const SwPosition &pos) const;
+
 
     /** IDocumentRedlineAccess
     */
Index: sw/inc/hintids.hxx
===================================================================
RCS file: /cvs/sw/sw/inc/hintids.hxx,v
retrieving revision 1.34
diff -u -r1.34 hintids.hxx
--- sw/inc/hintids.hxx	18 Jul 2007 13:29:01 -0000	1.34
+++ sw/inc/hintids.hxx	31 Jul 2007 20:54:02 -0000
@@ -52,6 +52,12 @@
 #define CH_TXTATR_INWORD		((sal_Unicode)0x02)
 #define CH_TXTATR_TAB           ((sal_Unicode)'\t')
 #define CH_TXTATR_NEWLINE       ((sal_Unicode)'\n')
+#define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x04)
+#define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05)
+#define CH_TXT_ATR_SUBST_FIELDSTART ("[")
+#define CH_TXT_ATR_SUBST_FIELDEND ("]")
+
+#define FIELD_BOOKMARK_PREFIX "__"
 
 /*
  * Hier kommen erst mal die enums fuer die Hints
Index: sw/source/core/crsr/crbm.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/crsr/crbm.cxx,v
retrieving revision 1.5
diff -u -r1.5 crbm.cxx
--- sw/source/core/crsr/crbm.cxx	16 Sep 2006 20:44:51 -0000	1.5
+++ sw/source/core/crsr/crbm.cxx	31 Jul 2007 20:54:02 -0000
@@ -47,6 +47,7 @@
 #include "callnk.hxx"
 #include "swcrsr.hxx"
 #include <IDocumentBookmarkAccess.hxx>
+#include <IDocumentSettingAccess.hxx>
 
 /*
  * Methoden der SwCrsrShell fuer Bookmark
@@ -154,6 +155,59 @@
 	return TRUE;
 }
 
+bool SwCrsrShell::IsFormProtected() {
+    return getIDocumentSettingAccess()->get(IDocumentSettingAccess::PROTECT_FORM);
+}
+
+SwBookmark* SwCrsrShell::IsInFieldBookmark() {
+// Refactor
+    SwPosition pos(*GetCrsr()->GetPoint());
+    return getIDocumentBookmarkAccess()->getFieldBookmarkFor(pos);
+}
+
+SwBookmark* SwCrsrShell::GetNextFieldBookmark() {
+    SwPosition pos(*GetCrsr()->GetPoint());
+    return getIDocumentBookmarkAccess()->getNextFieldBookmarkFor(pos);
+}
+
+SwBookmark* SwCrsrShell::GetPrevFieldBookmark() {
+    SwPosition pos(*GetCrsr()->GetPoint());
+    return getIDocumentBookmarkAccess()->getPrevFieldBookmarkFor(pos);
+}
+
+bool SwCrsrShell::GotoFieldBookmark(SwBookmark *pBkmk) 
+{
+        if(pBkmk==NULL)
+	    return false;
+	// Crsr-Moves ueberwachen, evt. Link callen
+	bool bRet = true;
+	SwCallLink aLk( *this );
+	SwCursor* pCrsr = GetSwCrsr();
+	SwCrsrSaveState aSaveState( *pCrsr );
+	
+	*pCrsr->GetPoint() = pBkmk->GetPos();
+	if( pBkmk->GetOtherPos() )
+	{
+		pCrsr->SetMark();
+		*pCrsr->GetMark() = *pBkmk->GetOtherPos();
+		if( *pCrsr->GetMark() > *pCrsr->GetPoint() )
+			pCrsr->Exchange();
+	}
+	pCrsr->GetPoint()->nContent--;
+	pCrsr->GetMark()->nContent++;
+
+
+	if( pCrsr->IsSelOvr( SELOVER_CHECKNODESSECTION | SELOVER_TOGGLE ) )
+	{
+		pCrsr->DeleteMark();
+		pCrsr->RestoreSavePos();
+		bRet = false;
+	}
+	else
+	    UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
+
+	return bRet;
+}
 
 FASTBOOL SwCrsrShell::GoPrevBookmark()
 {
Index: sw/source/core/crsr/pam.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/crsr/pam.cxx,v
retrieving revision 1.19
diff -u -r1.19 pam.cxx
--- sw/source/core/crsr/pam.cxx	16 Sep 2006 20:46:49 -0000	1.19
+++ sw/source/core/crsr/pam.cxx	31 Jul 2007 20:54:03 -0000
@@ -101,6 +101,10 @@
 #include <ndtxt.hxx> // #111827#
 #endif
 
+#ifndef _BOOKMRK_HXX
+#include <bookmrk.hxx>
+#endif
+
 // fuer den dummen ?MSC-? Compiler
 inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd )
 {
@@ -811,6 +815,29 @@
 			}
 		}
 	}
+	if (!bRet) {
+	    const SwDoc *pDoc=GetDoc();
+	    SwBookmark *pA=(pDoc&&pPoint?pDoc->getFieldBookmarkFor(*pPoint):NULL);
+	    /* debugging stuff, will remove later
+	    if (pA) {
+		rtl::OUString s(pA->GetName());
+		rtl::OString aOString = ::rtl::OUStringToOString (s, RTL_TEXTENCODING_UTF8);
+		printf("IN BOOKMARK(A): %s\n", aOString.getStr());
+	    }
+	    */
+	    SwBookmark *pB=(pDoc&&pMark?pDoc->getFieldBookmarkFor(*pMark):pA);
+            /* debugging stuff, will remove later
+	    if (pB) {
+		rtl::OUString s(pB->GetName());
+		rtl::OString aOString = ::rtl::OUStringToOString (s, RTL_TEXTENCODING_UTF8);
+		printf("IN BOOKMARK(B): %s\n", aOString.getStr());
+	    }
+	    */
+	    bRet = (pA!=pB);
+	    bool bProtectForm=pDoc->get(IDocumentSettingAccess::PROTECT_FORM );
+	    if (bProtectForm)
+		bRet|=(pA==NULL || pB==NULL);
+	}
 	return bRet;
 }
 
Index: sw/source/core/doc/doc.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/doc/doc.cxx,v
retrieving revision 1.58
diff -u -r1.58 doc.cxx
--- sw/source/core/doc/doc.cxx	17 Jul 2007 13:05:50 -0000	1.58
+++ sw/source/core/doc/doc.cxx	31 Jul 2007 20:54:04 -0000
@@ -298,6 +298,7 @@
         // <--
         case UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
         case USE_OLD_PRINTER_METRICS: return mbOldPrinterMetrics;
+	case PROTECT_FORM: return mbProtectForm;
          // COMPATIBILITY FLAGS END
 
         case BROWSE_MODE: return mbBrowseMode;
@@ -410,6 +411,9 @@
         case USE_OLD_PRINTER_METRICS:            
             mbOldPrinterMetrics = value;
             break;
+	case PROTECT_FORM:
+	    mbProtectForm = value;
+	    break;
 
          // COMPATIBILITY FLAGS END
 
Index: sw/source/core/doc/docbm.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/doc/docbm.cxx,v
retrieving revision 1.20
diff -u -r1.20 docbm.cxx
--- sw/source/core/doc/docbm.cxx	16 Sep 2006 20:50:01 -0000	1.20
+++ sw/source/core/doc/docbm.cxx	31 Jul 2007 20:54:05 -0000
@@ -100,7 +100,13 @@
 #ifndef _NDTXT_HXX
 #include "ndtxt.hxx" // for lcl_FixPosition
 #endif
+#ifndef _SWUNDO_HXX
+#include "swundo.hxx"
+#endif
+
+#include "hintids.hxx"
 
+static bool _checkFieldBookmarkSanity(const SwDoc *pDoc);
 
 SV_IMPL_OP_PTRARR_SORT(SwBookmarks, SwBookmarkPtr)
 
@@ -156,7 +162,23 @@
                                  /*[in]*/IDocumentBookmarkAccess::BookmarkType eMark )
 {
 	SwBookmark *pBM;
-	if( MARK == eMark )
+	if (rName.CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))==0) {
+	    pBM = new SwBookmark(*rPaM.GetPoint(), rCode, rName, rShortName);
+	    if( rPaM.HasMark() )
+		pBM->pPos2 = new SwPosition( *rPaM.GetMark() );
+	    else
+		pBM->pPos2 = new SwPosition( *pBM->pPos1 );
+
+	    lcl_FixPosition( *pBM->pPos1 );
+	    lcl_FixPosition( *pBM->pPos2 );
+	    if (*pBM->pPos2<*pBM->pPos1) {
+		SwPosition *_pos=pBM->pPos1;
+		pBM->pPos1=pBM->pPos2;
+		pBM->pPos2=_pos;
+	    }
+	    ASSERT(*PBM->pPos1<=*pBM->pPos2, "");
+	}
+	else if( MARK == eMark )
 		pBM = new SwMark( *rPaM.GetPoint(), rCode, rName, rShortName );
 	else if( BOOKMARK == eMark || HIDDEN_BOOKMARK == eMark)
 	{
@@ -171,10 +193,29 @@
 			pBM->pPos2 = new SwPosition( *rPaM.GetMark() );
 	}
 
-    // fix bookmark positions if they are invalid
-    lcl_FixPosition( *pBM->pPos1 );
-    if( pBM->pPos2 != NULL )
-        lcl_FixPosition( *pBM->pPos2 );
+	if (pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))==0) {
+	    StartUndo(UIUNDO_REPLACE, NULL);
+	    ASSERT(*PBM->pPos1<=*pBM->pPos2, "Bookmark positions not normalized!!!!");
+	    const SwTxtNode* pStartTxtNode=this->GetNodes()[pBM->GetPos().nNode]->GetTxtNode();
+	    const SwTxtNode* pEndTxtNode=this->GetNodes()[pBM->GetOtherPos()->nNode]->GetTxtNode();
+	    sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(pBM->GetPos().nContent.GetIndex());
+	    sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(pBM->GetOtherPos()->nContent.GetIndex()-1);
+	    if (ch_start!=CH_TXT_ATR_FIELDSTART) {
+		const SwPaM rBg(*pBM->pPos1);
+		Insert(rBg, CH_TXT_ATR_FIELDSTART);
+		pBM->pPos1->nContent--;
+	    }
+	    if (ch_end!=CH_TXT_ATR_FIELDEND) {
+		const SwPaM rBg(*pBM->pPos2);
+		Insert(rBg, CH_TXT_ATR_FIELDEND);
+	    }
+
+	} else {
+	    // fix bookmark positions if they are invalid
+	    lcl_FixPosition( *pBM->pPos1 );
+	    if( pBM->pPos2 != NULL )
+		lcl_FixPosition( *pBM->pPos2 );
+	}
 
 	if( !pBookmarkTbl->Insert( pBM ) )
 		delete pBM, pBM = 0;
@@ -194,9 +233,97 @@
 			    SetModified();
 	    }
 	}
+	if (pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))==0) {
+	    EndUndo(UIUNDO_REPLACE, NULL);
+	}
 	return pBM;
 }
 
+SwBookmark* SwDoc::getFieldBookmarkFor(const SwPosition &pos) const {
+//@TODO make impl recursive
+    int nCount=pBookmarkTbl->Count();
+    while(--nCount>=0) {
+	SwBookmark *pBM=(*pBookmarkTbl)[nCount];
+	if (pBM->GetOtherPos()!=NULL 
+	    && pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))==0
+	    && pBM->GetPos()<pos 
+	    && pos < *(pBM->GetOtherPos())) {
+	    return pBM;
+	}
+    }
+    return NULL;
+}
+
+SwBookmark* SwDoc::getNextFieldBookmarkFor(const SwPosition &pos) const {
+    int i=0;
+    int nCount=pBookmarkTbl->Count();
+    SwBookmark *pBM=NULL;
+    while(i<nCount
+	  && ((pBM=(*pBookmarkTbl)[i])==NULL
+	  || pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))!=0
+	  || pos >= pBM->GetPos() )) i++;
+
+    if (i<nCount) {
+	return pBM;
+    } else {
+	i=0; 
+	while(i<nCount && (
+	     (pBM=(*pBookmarkTbl)[i])==NULL
+	     ||  pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))!=0)) i++;
+	return (i<nCount?pBM:NULL);
+    }
+}
+
+SwBookmark* SwDoc::getPrevFieldBookmarkFor(const SwPosition &pos) const {
+    int nCount=pBookmarkTbl->Count();
+    int i=nCount-1;
+    SwBookmark *pBM=NULL;
+    while(i>=0
+	  && ((pBM=(*pBookmarkTbl)[i])==NULL
+	  || pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))!=0
+	  || pBM->GetOtherPos()==NULL
+	  || pos <= *pBM->GetOtherPos() )) i--;
+
+    if (i>=0) {
+	return pBM;
+    } else {
+	i=nCount-1; 
+	while(i>=0 && (
+	     (pBM=(*pBookmarkTbl)[i])==NULL
+	     ||  pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))!=0)) i++;
+	return (i>=0?pBM:NULL);
+    }
+}
+
+/*
+bool SwDoc::isValidSelectionWrtFieldBookmarks(const SwPosition &posA, const SwPostion &posB) {
+//@TODO optimize this
+    SwBookmark *pA=getFieldBookmarkFor(posA);
+    SwBookmark *pB=getFieldBookmarkFor(posB);
+    return pA==pB;    
+}
+*/
+
+// not finished yet, still neet to add this check
+bool _checkFieldBookmarkSanity(const SwDoc *pDoc) {
+    int nCount=pDoc->getBookmarks().Count();
+    while(--nCount>=0) {
+	SwBookmark *pBM=pDoc->getBookmarks()[nCount];
+	if (pBM->GetName().CompareToAscii(FIELD_BOOKMARK_PREFIX, strlen(FIELD_BOOKMARK_PREFIX))==0) {
+	    {
+		rtl::OUString s(pBM->GetName());
+		rtl::OString aOString = ::rtl::OUStringToOString (s, RTL_TEXTENCODING_UTF8);
+		const SwTxtNode* pStartTxtNode=pDoc->GetNodes()[pBM->GetPos().nNode]->GetTxtNode();
+		const SwTxtNode* pEndTxtNode=pDoc->GetNodes()[pBM->GetOtherPos()->nNode]->GetTxtNode();
+		sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(pBM->GetPos().nContent.GetIndex());
+		sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(pBM->GetOtherPos()->nContent.GetIndex()-1);
+		printf("CHECK(%s %p[%i/'%c'] %p[%i/'%c']);\n", aOString.getStr(), pStartTxtNode, ch_start, ch_start, pEndTxtNode, ch_end, ch_end);
+	    }	    
+	}
+    }
+    return true;
+}
+
 void SwDoc::deleteBookmark( /*[in]*/sal_uInt16 nPos )
 {
 	SwBookmark *pBM = (*pBookmarkTbl)[nPos];
@@ -701,7 +829,7 @@
 		}
 
 		if( pBkmk->GetOtherPos() && pBkmk->GetOtherPos()->nNode.GetIndex() ==
-			nNode && pBkmk->GetOtherPos()->nContent.GetIndex() < nCntnt )
+			nNode && pBkmk->GetOtherPos()->nContent.GetIndex() <= nCntnt )
 		{
 			aSave.SetContent( pBkmk->GetOtherPos()->nContent.GetIndex() );
 			aSave.IncType();
Index: sw/source/core/doc/docnew.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/doc/docnew.cxx,v
retrieving revision 1.77
diff -u -r1.77 docnew.cxx
--- sw/source/core/doc/docnew.cxx	18 Jul 2007 13:29:46 -0000	1.77
+++ sw/source/core/doc/docnew.cxx	31 Jul 2007 20:54:06 -0000
@@ -413,6 +413,7 @@
     mbClipAsCharacterAnchoredWriterFlyFrames= false;        // hidden
     mbUnixForceZeroExtLeading               = false;        // hidden
     mbOldPrinterMetrics                     = false;        // hidden
+    mbProtectForm                           = false;        // hidden
 
     //
     // COMPATIBILITY FLAGS END
Index: sw/source/core/text/inftxt.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/inftxt.cxx,v
retrieving revision 1.110
diff -u -r1.110 inftxt.cxx
--- sw/source/core/text/inftxt.cxx	27 Jun 2007 13:19:34 -0000	1.110
+++ sw/source/core/text/inftxt.cxx	31 Jul 2007 20:54:07 -0000
@@ -157,6 +157,9 @@
 #endif
 // <--
 
+#include <doc.hxx>
+#include <pam.hxx>
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::linguistic2;
 using namespace ::com::sun::star::uno;
@@ -1188,6 +1191,40 @@
 {
 	ASSERT( pFnt->GetBackColor(), "DrawBackBrush: Lost Color" );
 
+    {
+	SwRect aIntersect;
+	CalcRect( rPor, &aIntersect, 0 );
+	SwTxtNode *pNd = pFrm->GetTxtNode();
+	SwBookmark *pBM=NULL;	
+	if ( aIntersect.HasArea() )
+	{
+	    if (pNd) {
+		const SwDoc *doc=pNd->GetDoc();
+		if (doc!=NULL) {
+		    SwIndex aIndex( pNd, GetIdx() );
+		    SwPosition aPosition(*pNd, aIndex);
+		    pBM=doc->getFieldBookmarkFor(aPosition);
+//		printf("pBM=%p Idx=%i\n", pBM, GetIdx());
+		}
+	    }
+	    bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt().GetChar(GetIdx()));
+	    if (OnWin() && (pBM!=NULL || bIsStartMark)) {
+		OutputDevice* pOut = (OutputDevice*)GetOut();
+		pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+		pOut->SetLineColor( Color(220, 233, 245));
+		pOut->SetFillColor( Color(220, 233, 245));
+		pOut->DrawRect( aIntersect.SVRect() );
+		pOut->Pop();
+	    }
+	}
+
+    }
+
+
+
+    if( !pFnt->GetBackColor() )
+	return;
+
     SwRect aIntersect;
     CalcRect( rPor, 0, &aIntersect );
 
@@ -1247,7 +1284,7 @@
 				break;
 			}
 		}
-		if ( bDraw )
+//		if ( bDraw )
 			DrawBackground( rPor );
 	}
 }
Index: sw/source/core/text/inftxt.hxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/inftxt.hxx,v
retrieving revision 1.53
diff -u -r1.53 inftxt.hxx
--- sw/source/core/text/inftxt.hxx	29 Jan 2007 16:56:15 -0000	1.53
+++ sw/source/core/text/inftxt.hxx	31 Jul 2007 20:54:08 -0000
@@ -456,7 +456,7 @@
 	void DrawBackground( const SwLinePortion &rPor ) const;
 	void DrawViewOpt( const SwLinePortion &rPor, const MSHORT nWhich ) const;
 	inline void DrawBackBrush( const SwLinePortion &rPor ) const
-		{ if( pFnt->GetBackColor() ) _DrawBackBrush( rPor ); }
+	{ /*if( pFnt->GetBackColor() )*/ _DrawBackBrush( rPor ); }
 
 	inline void NotifyURL( const SwLinePortion &rPor ) const
 		{ if( URLNotify() ) _NotifyURL( rPor ); }
Index: sw/source/core/text/itratr.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/itratr.cxx,v
retrieving revision 1.37
diff -u -r1.37 itratr.cxx
--- sw/source/core/text/itratr.cxx	10 May 2007 16:01:48 -0000	1.37
+++ sw/source/core/text/itratr.cxx	31 Jul 2007 20:54:09 -0000
@@ -417,6 +417,17 @@
 			if ( nNextEnd<nNext ) nNext = nNextEnd; // Wer ist naeher?
 		}
 	}
+	if (m_pTxtNode!=NULL) {
+	    //TODO maybe use hints like FieldHints for this instead of looking at the text...
+	    int l=(nNext<m_pTxtNode->Len()?nNext:m_pTxtNode->Len());
+	    int p=nPos;
+	    const sal_Unicode *txt=m_pTxtNode->GetTxt().GetBuffer();
+	    while(p<l && txt[p]!=CH_TXT_ATR_FIELDSTART && txt[p]!=CH_TXT_ATR_FIELDEND) p++;
+	    if ((p<l && p>nPos) || nNext<=p)
+		nNext=p;
+	    else
+		nNext=p+1;
+	}	
     if( pRedln )
 		return pRedln->GetNextRedln( nNext );
 	return nNext;
Index: sw/source/core/text/itratr.hxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/itratr.hxx,v
retrieving revision 1.18
diff -u -r1.18 itratr.hxx
--- sw/source/core/text/itratr.hxx	14 Aug 2006 16:38:20 -0000	1.18
+++ sw/source/core/text/itratr.hxx	31 Jul 2007 20:54:09 -0000
@@ -82,18 +82,20 @@
 	inline void SetFnt( SwFont* pNew ) { pFnt = pNew; }
 	const void* aMagicNo[ SW_SCRIPTS ];
 	MSHORT aFntIdx[ SW_SCRIPTS ];
+    const SwTxtNode* m_pTxtNode;
 
 protected:
 	void Chg( SwTxtAttr *pHt );
 	void Rst( SwTxtAttr *pHt );
     void CtorInit( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm = 0 );
-    inline SwAttrIter()
-		: pFnt(0), pLastOut(0),	nChgCnt(0), nPropFont(0), pShell(0), pRedln(0){}
+
+    inline SwAttrIter(SwTxtNode* pTxtNode)
+		: pFnt(0), pLastOut(0),	nChgCnt(0), nPropFont(0), pShell(0), pRedln(0), m_pTxtNode(pTxtNode){}
 
 public:
 	// Konstruktor, Destruktor
     inline SwAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf )
-		: pFnt(0), pLastOut(0), nChgCnt(0), nPropFont(0), pShell(0), pRedln(0)
+	: pFnt(0), pLastOut(0), nChgCnt(0), nPropFont(0), pShell(0), pRedln(0), m_pTxtNode(&rTxtNode)
         { CtorInit( rTxtNode, rScrInf ); }
 
 	virtual ~SwAttrIter();
Index: sw/source/core/text/itrform2.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/itrform2.cxx,v
retrieving revision 1.99
diff -u -r1.99 itrform2.cxx
--- sw/source/core/text/itrform2.cxx	23 Jan 2007 08:31:48 -0000	1.99
+++ sw/source/core/text/itrform2.cxx	31 Jul 2007 20:54:10 -0000
@@ -894,13 +894,19 @@
 			// Wenn pCurr keine Breite hat, kann sie trotzdem schon Inhalt haben,
 			// z.B. bei nicht darstellbaren Zeichen.
 			if( !rInf.X() && !pCurr->GetPortion() && !pCurr->GetLen() &&
-				!GetFnt()->IsURL() )
-				pPor = pCurr;
-			else
+			    !GetFnt()->IsURL() ) {
+			    pPor = pCurr;
+			 } else
 			{
+			    if (rInf.GetLen()>0 && rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FIELDSTART) {
+				pPor = new SwFieldMarkPortion();
+			    } else if (rInf.GetLen()>0 && rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FIELDEND) {
+				pPor = new SwFieldMarkPortion();
+			    } else {
 				pPor = new SwTxtPortion;
-				if( GetFnt()->IsURL() )
-					pPor->SetWhichPor( POR_URL );
+			    }   
+			    if( GetFnt()->IsURL() )
+				pPor->SetWhichPor( POR_URL );
 			}
 		}
 	}
Index: sw/source/core/text/itrform2.hxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/itrform2.hxx,v
retrieving revision 1.16
diff -u -r1.16 itrform2.hxx
--- sw/source/core/text/itrform2.hxx	14 Aug 2006 16:39:01 -0000	1.16
+++ sw/source/core/text/itrform2.hxx	31 Jul 2007 20:54:10 -0000
@@ -144,7 +144,7 @@
 	sal_Bool CalcOnceMore();
 
 	void CtorInit( SwTxtFrm *pFrm, SwTxtFormatInfo *pInf );
-	inline SwTxtFormatter( SwTxtFrm *pFrm, SwTxtFormatInfo *pInf )
+    inline SwTxtFormatter( SwTxtFrm *pFrm, SwTxtFormatInfo *pInf ) : SwTxtPainter(pFrm!=NULL?pFrm->GetTxtNode():NULL)
 		   { CtorInit( pFrm, pInf ); }
 	~SwTxtFormatter();
 
Index: sw/source/core/text/itrpaint.hxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/itrpaint.hxx,v
retrieving revision 1.8
diff -u -r1.8 itrpaint.hxx
--- sw/source/core/text/itrpaint.hxx	14 Aug 2006 16:39:25 -0000	1.8
+++ sw/source/core/text/itrpaint.hxx	31 Jul 2007 20:54:10 -0000
@@ -52,9 +52,11 @@
                                 long nAdjustBaseLine = 0 );
 protected:
 	void CtorInit( SwTxtFrm *pFrm, SwTxtPaintInfo *pInf );
-	inline SwTxtPainter() { }
+	inline SwTxtPainter(SwTxtNode* pTxtNode) : SwTxtCursor(pTxtNode) { }
+
 public:
-	inline SwTxtPainter( SwTxtFrm *pFrm, SwTxtPaintInfo *pInf )
+    inline SwTxtPainter( SwTxtFrm *pFrm, SwTxtPaintInfo *pInf ) : SwTxtCursor(
+	pFrm!=NULL?pFrm->GetTxtNode():NULL)
 		   { CtorInit( pFrm, pInf ); }
 	void DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
 					   const sal_Bool bUnderSz );
Index: sw/source/core/text/itrtxt.hxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/itrtxt.hxx,v
retrieving revision 1.18
diff -u -r1.18 itrtxt.hxx
--- sw/source/core/text/itrtxt.hxx	14 Aug 2006 16:39:49 -0000	1.18
+++ sw/source/core/text/itrtxt.hxx	31 Jul 2007 20:54:11 -0000
@@ -73,10 +73,10 @@
 	// Zuruecksetzen in die erste Zeile.
 	void Init();
 	void CtorInit( SwTxtFrm *pFrm, SwTxtInfo *pInf );
-	inline SwTxtIter() { }
+	inline SwTxtIter(SwTxtNode* pTxtNode) : SwAttrIter(pTxtNode) { }
 
 public:
-	inline SwTxtIter( SwTxtFrm *pFrm, SwTxtInfo *pInf )
+    inline SwTxtIter( SwTxtFrm *pFrm, SwTxtInfo *pInf ) : SwAttrIter(pFrm!=NULL?pFrm->GetTxtNode():NULL)
 		   { CtorInit( pFrm, pInf ); }
 	inline const SwLineLayout *GetCurr() const { return pCurr; } // niemals 0!
 	inline const SwLineLayout *GetNext() const { return pCurr->GetNext(); }
@@ -159,9 +159,9 @@
 	inline void SetDropLeft( const KSHORT nNew ) { nDropLeft = nNew; }
 
 	void CtorInit( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf );
-	inline SwTxtMargin() { }
+        inline SwTxtMargin(SwTxtNode* pTxtNode) : SwTxtIter(pTxtNode) { }
 public:
-	inline SwTxtMargin( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf )
+    inline SwTxtMargin( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf ) : SwTxtIter(pFrm!=NULL?pFrm->GetTxtNode():NULL)
 		   { CtorInit( pFrm, pInf ); }
 	inline SwTwips GetLeftMargin() const;
 	inline SwTwips Left() const;
@@ -223,13 +223,13 @@
 								  const SwRect &rCurrRect );
 
 protected:
-	inline SwTxtAdjuster() { }
+	inline SwTxtAdjuster(SwTxtNode* pTxtNode) : SwTxtMargin(pTxtNode) { }
 	// spannt beim Blocksatz die Glues auf.
 	void CalcNewBlock( SwLineLayout *pCurr, const SwLinePortion *pStopAt,
 		SwTwips nReal = 0 );
     SwTwips CalcKanaAdj( SwLineLayout *pCurr );
 public:
-	inline SwTxtAdjuster( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf )
+    inline SwTxtAdjuster( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf ) : SwTxtMargin(pFrm!=NULL?pFrm->GetTxtNode():NULL)
 		   { SwTxtMargin::CtorInit( pFrm, pInf ); }
 
 	// wird von SwTxtFormatter wegen UpdatePos ueberladen
@@ -262,9 +262,9 @@
 	void _GetCharRect(SwRect *, const xub_StrLen, SwCrsrMoveState* );
 protected:
 	void CtorInit( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf );
-	inline SwTxtCursor() { }
+	inline SwTxtCursor(SwTxtNode* pTxtNode) : SwTxtAdjuster(pTxtNode) { }
 public:
-	inline SwTxtCursor( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf )
+    inline SwTxtCursor( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf ) : SwTxtAdjuster(pFrm!=NULL?pFrm->GetTxtNode():NULL)
 		   { CtorInit( pFrm, pInf ); }
 	sal_Bool GetCharRect(SwRect *, const xub_StrLen, SwCrsrMoveState* = 0,
 		const long nMax = 0 );
Index: sw/source/core/text/portxt.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/portxt.cxx,v
retrieving revision 1.47
diff -u -r1.47 portxt.cxx
--- sw/source/core/text/portxt.cxx	12 Jul 2007 10:43:24 -0000	1.47
+++ sw/source/core/text/portxt.cxx	31 Jul 2007 20:54:11 -0000
@@ -596,7 +596,17 @@
 
 void SwTxtPortion::Paint( const SwTxtPaintInfo &rInf ) const
 {
-	if( GetLen() )
+	if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetTxt().GetChar(rInf.GetIdx())) {
+	    rInf.DrawBackBrush( *this );
+	    const XubString aTxt = XubString::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDEND);
+	    rInf.DrawText( aTxt, *this, 0, aTxt.Len(), false );	  
+	}
+	else if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDSTART==rInf.GetTxt().GetChar(rInf.GetIdx())) {
+	    rInf.DrawBackBrush( *this );
+	    const XubString aTxt = XubString::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDSTART);
+	    rInf.DrawText( aTxt, *this, 0, aTxt.Len(), false );	  
+	}
+	else if( GetLen() )
 	{
         rInf.DrawBackBrush( *this );
 
@@ -780,3 +790,8 @@
     rPH.Text( GetLen(), GetWhichPor() );
 }
 
+
+void SwFieldMarkPortion::Paint( const SwTxtPaintInfo &rInf ) const
+{
+    SwTxtPortion::Paint(rInf);
+}
Index: sw/source/core/text/portxt.hxx
===================================================================
RCS file: /cvs/sw/sw/source/core/text/portxt.hxx,v
retrieving revision 1.9
diff -u -r1.9 portxt.hxx
--- sw/source/core/text/portxt.hxx	14 Aug 2006 16:42:42 -0000	1.9
+++ sw/source/core/text/portxt.hxx	31 Jul 2007 20:54:11 -0000
@@ -103,8 +103,19 @@
 	DECL_FIXEDMEMPOOL_NEWDEL(SwHolePortion)
 };
 
+class SwFieldMarkPortion : public SwTxtPortion {
+public:
+    inline SwFieldMarkPortion() : SwTxtPortion() {
+	Width(100);
+    }
+    virtual void Paint( const SwTxtPaintInfo &rInf ) const;
+};
+
 CLASSIO( SwTxtPortion )
 CLASSIO( SwHolePortion )
 
 
+
+
+
 #endif
Index: sw/source/core/txtnode/swfont.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/txtnode/swfont.cxx,v
retrieving revision 1.56
diff -u -r1.56 swfont.cxx
--- sw/source/core/txtnode/swfont.cxx	14 Mar 2007 08:07:23 -0000	1.56
+++ sw/source/core/txtnode/swfont.cxx	31 Jul 2007 20:54:12 -0000
@@ -869,6 +869,32 @@
 		}
 	}
 
+
+	if (1==rInf.GetLen() && CH_TXT_ATR_FIELDSTART==rInf.GetText().GetChar(rInf.GetIdx())) {
+	    xub_StrLen nOldIdx(rInf.GetIdx());
+	    xub_StrLen nOldLen(rInf.GetLen());
+	    String aNewText=String::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDSTART);
+	    rInf.SetText( aNewText );
+	    rInf.SetIdx( 0 );
+	    rInf.SetLen( aNewText.Len() );
+	    aTxtSize = pLastFont->GetTextSize( rInf );	    
+	    rInf.SetIdx( nOldIdx );
+	    rInf.SetLen( nOldLen );
+	}
+	else
+	if (1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetText().GetChar(rInf.GetIdx())) {
+	    xub_StrLen nOldIdx(rInf.GetIdx());
+	    xub_StrLen nOldLen(rInf.GetLen());
+	    String aNewText=String::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDEND);
+	    rInf.SetText( aNewText );
+	    rInf.SetIdx( 0 );
+	    rInf.SetLen( aNewText.Len() );
+	    aTxtSize = pLastFont->GetTextSize( rInf );	    
+	    rInf.SetIdx( nOldIdx );
+	    rInf.SetLen( nOldLen );	
+	}
+
+
 	return aTxtSize;
 }
 
Index: sw/source/ui/inc/wrtsh.hxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/inc/wrtsh.hxx,v
retrieving revision 1.38
diff -u -r1.38 wrtsh.hxx
--- sw/source/ui/inc/wrtsh.hxx	5 Jul 2007 13:13:40 -0000	1.38
+++ sw/source/ui/inc/wrtsh.hxx	31 Jul 2007 20:54:16 -0000
@@ -399,6 +399,8 @@
 	FASTBOOL GoNextBookmark(); // TRUE, wenn's noch eine gab
 	FASTBOOL GoPrevBookmark();
 
+        bool GotoFieldBookmark(SwBookmark *pBkmk);
+
 	// jump to the next / previous hyperlink - inside text and also
 	// on graphics
 	FASTBOOL SelectNextPrevHyperlink( BOOL bNext = TRUE );
Index: sw/source/ui/uno/SwXDocumentSettings.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/uno/SwXDocumentSettings.cxx,v
retrieving revision 1.56
diff -u -r1.56 SwXDocumentSettings.cxx
--- sw/source/ui/uno/SwXDocumentSettings.cxx	17 Jul 2007 13:12:39 -0000	1.56
+++ sw/source/ui/uno/SwXDocumentSettings.cxx	31 Jul 2007 20:54:17 -0000
@@ -159,7 +159,8 @@
     HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
     HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES,
     HANDLE_UNIX_FORCE_ZERO_EXT_LEADING,
-    HANDLE_USE_OLD_PRINTER_METRICS
+    HANDLE_USE_OLD_PRINTER_METRICS,
+    HANDLE_PROTECT_FORM
 };
 
 MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -209,6 +210,7 @@
         { RTL_CONSTASCII_STRINGPARAM("ClipAsCharacterAnchoredWriterFlyFrames"), HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES, CPPUTYPE_BOOLEAN, 0, 0},
         { RTL_CONSTASCII_STRINGPARAM("UnxForceZeroExtLeading"), HANDLE_UNIX_FORCE_ZERO_EXT_LEADING, CPPUTYPE_BOOLEAN, 0, 0},
         { RTL_CONSTASCII_STRINGPARAM("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, CPPUTYPE_BOOLEAN, 0, 0},
+        { RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0},
 
 /*
  * As OS said, we don't have a view when we need to set this, so I have to
@@ -683,6 +685,12 @@
             mpDoc->set(IDocumentSettingAccess::USE_OLD_PRINTER_METRICS, bTmp);
         }
         break;
+        case HANDLE_PROTECT_FORM:
+        {
+            sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+            mpDoc->set(IDocumentSettingAccess::PROTECT_FORM, bTmp);
+        }
+        break;
 
         default:
 			throw UnknownPropertyException();
@@ -977,6 +985,12 @@
             rValue.setValue( &bTmp, ::getBooleanCppuType() );
         }
         break;
+        case HANDLE_PROTECT_FORM:
+        {
+            sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::PROTECT_FORM);
+            rValue.setValue( &bTmp, ::getBooleanCppuType() );
+        }
+        break;
 
         default:
 			throw UnknownPropertyException();
Index: sw/source/ui/wrtsh/wrtsh3.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/wrtsh/wrtsh3.cxx,v
retrieving revision 1.12
diff -u -r1.12 wrtsh3.cxx
--- sw/source/ui/wrtsh/wrtsh3.cxx	16 Sep 2006 23:40:25 -0000	1.12
+++ sw/source/ui/wrtsh/wrtsh3.cxx	31 Jul 2007 20:54:17 -0000
@@ -116,6 +116,24 @@
 }
 
 
+bool SwWrtShell::GotoFieldBookmark(SwBookmark *pBkmk)
+{
+   (this->*fnKillSel)( 0, sal_False );
+
+    bool bRet = SwCrsrShell::GotoFieldBookmark(pBkmk);
+    if( bRet && IsSelFrmMode() )
+    {
+        UnSelectFrm();
+        LeaveSelFrmMode();
+    }
+    if( IsSelection() )
+    {
+        fnKillSel = &SwWrtShell::ResetSelect;
+        fnSetCrsr = &SwWrtShell::SetCrsrKillSel;
+    }
+    return bRet;
+}
+
 /*--------------------------------------------------------------------
     Beschreibung: FontWork-Slots invalidieren
  --------------------------------------------------------------------*/
Index: sw/source/ui/docvw/edtwin.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/docvw/edtwin.cxx,v
retrieving revision 1.143
diff -u -r1.143 edtwin.cxx
--- sw/source/ui/docvw/edtwin.cxx	12 Jul 2007 10:50:27 -0000	1.143
+++ sw/source/ui/docvw/edtwin.cxx	1 Aug 2007 10:51:14 -0000
@@ -1559,6 +1559,10 @@
                        KS_Fly_Change, KS_Draw_Change,
                        KS_SpecialInsert,
                        KS_EnterCharCell,
+
+		       KS_GotoNextFieldBookmark,
+		       KS_GotoPrevFieldBookmark,
+
                        KS_Ende };
 
 	SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys
@@ -1980,7 +1984,10 @@
 #ifdef SW_CRSR_TIMER
 					BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE );
 #endif
-					if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
+					if (rSh.IsFormProtected() || rSh.IsInFieldBookmark()!=NULL) {
+					    eKeyState=KS_GotoNextFieldBookmark; 
+					}
+					else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
 						!rSh.HasReadonlySel() )
                     {
                         if (rSh.IsFirstOfNumRule()) // #i23725#
@@ -2025,8 +2032,11 @@
 #ifdef SW_CRSR_TIMER
 					BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE );
 #endif
-					if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
-						!rSh.HasReadonlySel() )
+					if (rSh.IsFormProtected() || rSh.IsInFieldBookmark()!=NULL) {
+					    eKeyState=KS_GotoPrevFieldBookmark; 
+					}
+					else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
+						 !rSh.HasReadonlySel() )
                     {
                         if (rSh.IsFirstOfNumRule()) // #i23725#
                             eKeyState = KS_NumIndentDec;
@@ -2378,6 +2388,24 @@
                 nKS_NUMINDENTINC_Count = 2;
                 break;
 
+	    case KS_GotoNextFieldBookmark:	    
+	    {
+		SwBookmark *pBM=rSh.GetNextFieldBookmark();
+		if (pBM!=NULL) {
+		    rSh.GotoFieldBookmark(pBM);
+		}
+	    }
+	        break;
+
+	    case KS_GotoPrevFieldBookmark:	    
+	    {
+		SwBookmark *pBM=rSh.GetPrevFieldBookmark();
+		if (pBM!=NULL) {
+		    rSh.GotoFieldBookmark(pBM);
+		}
+	    }
+	        break;
+
             case KS_NumIndentDec:
                 rSh.NumIndent(-360);
                 break;
