Commits

Anonymous committed 8ab06f9

INTEGRATION: CWS swenhancedfields2 (1.155.26); FILE MERGED
2008/08/04 14:16:46 b_michaelsen 1.155.26.3: RESYNC: (1.155-1.162); FILE MERGED
2008/04/24 07:03:59 ama 1.155.26.2: #i33737#: Enhanced fields
2008/04/23 14:29:22 ama 1.155.26.1: #i33737#: Enhanced fields

Comments (0)

Files changed (1)

sw/source/ui/docvw/edtwin.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: edtwin.cxx,v $
- * $Revision: 1.163 $
+ * $Revision: 1.164 $
  *
  * This file is part of OpenOffice.org.
  *
 #include <vos/mutex.hxx>
 #include <vcl/svapp.hxx>
 
+#include <bookmrk.hxx>
+#include <doc.hxx>
+
 #include "PostItMgr.hxx"
 #include "postit.hxx"
 
                        KS_Fly_Change, KS_Draw_Change,
                        KS_SpecialInsert,
                        KS_EnterCharCell,
+                       KS_GotoNextFieldBookmark,
+                       KS_GotoPrevFieldBookmark,
                        KS_Ende };
 
+
+
 	SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys
 										   : KS_CheckKey,
 				eNextKeyState = KS_Ende;
 					}
                 case KEY_TAB:
 				{
+
 #ifdef SW_CRSR_TIMER
 					BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE );
 #endif
-					if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
+					if (rSh.IsFormProtected() || rSh.IsInFieldBookmark()!=NULL || rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) {
+					    eKeyState=KS_GotoNextFieldBookmark; 
+					}
+					else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
 						!rSh.HasReadonlySel() )
                     {
                         // --> OD 2007-10-02 #b660435#
 #ifdef SW_CRSR_TIMER
 					BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE );
 #endif
-					if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
-						!rSh.HasReadonlySel() )
+					if (rSh.IsFormProtected() || rSh.IsInFieldBookmark()!=NULL || rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) {
+					    eKeyState=KS_GotoPrevFieldBookmark; 
+					}
+					else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
+						 !rSh.HasReadonlySel() )
                     {
                         // --> OD 2007-10-02 #b660435#
 //                        if (rSh.IsFirstOfNumRule()) // #i23725#
 			aCh = '\t';
 			// kein break!
 		case KS_InsChar:
-		if( !rSh.HasReadonlySel() )
+		if (rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) {
+		    SwFieldBookmark *fieldBM=rSh.IsInFormFieldBookmark(); //$flr refactor!!!
+   		    ASSERT(fieldBM!=NULL, "Where is my FieldBookmark??");
+		    if (fieldBM!=NULL) {
+			fieldBM->SetChecked(!fieldBM->IsChecked());
+			SwDocShell* pDocSh = rView.GetDocShell();
+			SwDoc *pDoc=pDocSh->GetDoc();
+			ASSERT(fieldBM->GetOtherBookmarkPos()!=NULL, "where is the otherpos?");
+			if (fieldBM->GetOtherBookmarkPos()!=NULL) {
+			    SwPaM aPaM(fieldBM->GetBookmarkPos(), *fieldBM->GetOtherBookmarkPos());
+			    if (0) {
+				rSh.StartAllAction();  //$flr TODO: understand why this not works
+				pDoc->SetModified(aPaM);
+				rSh.EndAllAction();
+			    } else {
+				rSh.CalcLayout(); // workaround
+			    }
+			}
+			
+		    }
+//		    rSh.Overwrite(String('X'));
+		    eKeyState = KS_Ende;
+		} else if( !rSh.HasReadonlySel() )
 		{
 			BOOL bIsNormalChar = GetAppCharClass().isLetterNumeric(
 														String( aCh ), 0 );
                 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:
                 // --> OD 2008-06-16 #i90078#
                 rSh.ChangeIndentOfAllListLevels(-360);