Changeset 24 in dev for ProjectEditor/TextEditor_UndoRedo.cpp
- Timestamp:
- Dec 30, 2006, 10:18:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/TextEditor_UndoRedo.cpp
r3 r24 9 9 if(MdiInfo[WndNum].IndentStr) CancelBeforeAutoIndent(WndNum); 10 10 11 pUndoState=MdiInfo[WndNum]. edit_undo;11 pUndoState=MdiInfo[WndNum].pMdiTextEdit->pTextEditUndoState; 12 12 i=pUndoState->NowPos-1; 13 13 if(i==-1) i=MAX_UNDONUM-1; … … 19 19 20 20 //選択範囲をセット 21 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,21 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 22 22 pUndoState->Range[pUndoState->NowPos].cpMin, 23 &MdiInfo[WndNum].p mti->StartCaretPos);24 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,23 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 24 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 25 25 pUndoState->Range[pUndoState->NowPos].cpMax, 26 &MdiInfo[WndNum].p mti->EndCaretPos);26 &MdiInfo[WndNum].pMdiTextEdit->EndCaretPos); 27 27 28 28 switch(pUndoState->Command[pUndoState->NowPos]){ … … 41 41 //元に戻す、やり直しメニューをリセット 42 42 ResetState_UndoMenu(); 43 44 //変更を通知 45 MdiInfo[WndNum].pMdiTextEdit->NofityUndoRedoToModify(); 43 46 } 44 47 void TextEdit_RedoCommand(int WndNum){ … … 46 49 TEXTEDIT_UNDOSTATE *pUndoState; 47 50 48 pUndoState=MdiInfo[WndNum]. edit_undo;51 pUndoState=MdiInfo[WndNum].pMdiTextEdit->pTextEditUndoState; 49 52 if(!pUndoState->Command[pUndoState->NowPos]){ 50 53 MessageBeep(0); … … 56 59 case TEXTEDIT_UNDO_PASTE: 57 60 //選択範囲をセット 58 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,61 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 59 62 pUndoState->Range[pUndoState->NowPos].cpMin, 60 &MdiInfo[WndNum].p mti->StartCaretPos);61 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,63 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 64 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 62 65 pUndoState->Range[pUndoState->NowPos].cpMin, 63 &MdiInfo[WndNum].p mti->EndCaretPos);66 &MdiInfo[WndNum].pMdiTextEdit->EndCaretPos); 64 67 65 68 TextEdit_Replace(WndNum,pUndoState->KeyStr[pUndoState->NowPos],1); … … 67 70 case TEXTEDIT_UNDO_SELKEY: 68 71 //選択範囲をセット 69 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,72 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 70 73 pUndoState->DelRange[pUndoState->NowPos].cpMin, 71 &MdiInfo[WndNum].p mti->StartCaretPos);72 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,74 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 75 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 73 76 pUndoState->DelRange[pUndoState->NowPos].cpMax, 74 &MdiInfo[WndNum].p mti->EndCaretPos);77 &MdiInfo[WndNum].pMdiTextEdit->EndCaretPos); 75 78 76 79 TextEdit_Replace(WndNum,pUndoState->KeyStr[pUndoState->NowPos],1); … … 86 89 //元に戻す、やり直しメニューをリセット 87 90 ResetState_UndoMenu(); 91 92 //変更を通知 93 MdiInfo[WndNum].pMdiTextEdit->NofityUndoRedoToModify(); 88 94 } 89 95 … … 102 108 TEXTEDIT_UNDOSTATE *pUndoState; 103 109 104 pUndoState=MdiInfo[WndNum]. edit_undo;110 pUndoState=MdiInfo[WndNum].pMdiTextEdit->pTextEditUndoState; 105 111 106 112 //Redoされた場合の不要なデータを削除する … … 108 114 if(i==MAX_UNDONUM) i=0; 109 115 if(pUndoState->Command[i]==0) break; 110 TextEdit_DeleteUndoData( WndNum,i);116 TextEdit_DeleteUndoData(pUndoState,i); 111 117 } 112 118 … … 141 147 if(pUndoState->Command[pUndoState->NowPos]){ 142 148 //一番古い情報を切り捨てる 143 TextEdit_DeleteUndoData( WndNum,pUndoState->NowPos);149 TextEdit_DeleteUndoData(pUndoState,pUndoState->NowPos); 144 150 } 145 151 … … 148 154 } 149 155 150 void TextEdit_DeleteUndoData(int WndNum,int pos){ 151 extern MDIINFO MdiInfo[MAX_WNDNUM]; 152 TEXTEDIT_UNDOSTATE *pUndoState; 153 154 pUndoState=MdiInfo[WndNum].edit_undo; 156 void TextEdit_DeleteUndoData(TEXTEDIT_UNDOSTATE *pUndoState,int pos){ 155 157 if(pUndoState->KeyStr[pos]) HeapDefaultFree(pUndoState->KeyStr[pos]); 156 158 if(pUndoState->DelStr[pos]) HeapDefaultFree(pUndoState->DelStr[pos]);
Note:
See TracChangeset
for help on using the changeset viewer.