Index: trunk/ab5.0/abdev/abdev/Caret.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Caret.cpp	(revision 625)
+++ trunk/ab5.0/abdev/abdev/Caret.cpp	(revision 629)
@@ -124,10 +124,10 @@
 
 	pCharRange->cpMin=GetBufferIndexFromCaretPos(
-		MdiInfo[WndNum].pMdiTextEdit->buffer,
-		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
-
-	if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y){
+		MdiInfo[WndNum]->pMdiTextEdit->buffer,
+		MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+		MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
+
+	if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+		MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y){
 		//選択されていないとき
 		pCharRange->cpMax=pCharRange->cpMin;
@@ -135,7 +135,7 @@
 	else{
 		pCharRange->cpMax=GetBufferIndexFromCaretPos(
-			MdiInfo[WndNum].pMdiTextEdit->buffer,
-			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x,
-			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y);
+			MdiInfo[WndNum]->pMdiTextEdit->buffer,
+			MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x,
+			MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y);
 	}
 
@@ -150,5 +150,5 @@
 
 	memcpy(buffer,
-		MdiInfo[WndNum].pMdiTextEdit->buffer+pCharRange->cpMin,
+		MdiInfo[WndNum]->pMdiTextEdit->buffer+pCharRange->cpMin,
 		pCharRange->cpMax-pCharRange->cpMin);
 	buffer[pCharRange->cpMax-pCharRange->cpMin]=0;
@@ -158,5 +158,5 @@
 
 	HWND hEdit;
-	hEdit=MdiInfo[WndNum].pMdiTextEdit->hEdit;
+	hEdit=MdiInfo[WndNum]->pMdiTextEdit->hEdit;
 
 	//垂直スクロールバーの位置
@@ -175,5 +175,5 @@
 
 	HWND hEdit;
-	hEdit=GetWindow(MdiInfo[WndNum].hwnd,GW_CHILD);
+	hEdit=GetWindow(MdiInfo[WndNum]->hwnd,GW_CHILD);
 
 	//垂直スクロールバーの位置
@@ -192,15 +192,15 @@
 
 	GetCaretPosFromBufferIndex(
-		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		MdiInfo[WndNum]->pMdiTextEdit->buffer,
 		StartIndex,
-		&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+		&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 
 	GetCaretPosFromBufferIndex(
-		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		MdiInfo[WndNum]->pMdiTextEdit->buffer,
 		EndIndex,
-		&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+		&MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos);
 
 	HWND hEdit;
-	hEdit=GetWindow(MdiInfo[WndNum].hwnd,GW_CHILD);
+	hEdit=GetWindow(MdiInfo[WndNum]->hwnd,GW_CHILD);
 
 	if(!TextEdit_ScrollCaret(WndNum,0,bShowCenter))
@@ -218,10 +218,10 @@
 	int iStartPos;
 	iStartPos=code_pos;
-	while(MdiInfo[WndNum].pMdiTextEdit->buffer[iStartPos]!='\n'&&iStartPos>0) iStartPos--;
-	if(MdiInfo[WndNum].pMdiTextEdit->buffer[iStartPos]=='\n') iStartPos++;
+	while(MdiInfo[WndNum]->pMdiTextEdit->buffer[iStartPos]!='\n'&&iStartPos>0) iStartPos--;
+	if(MdiInfo[WndNum]->pMdiTextEdit->buffer[iStartPos]=='\n') iStartPos++;
 
 	int iEndPos;
 	iEndPos=code_pos;
-	while(MdiInfo[WndNum].pMdiTextEdit->buffer[iEndPos]!='\r'&&MdiInfo[WndNum].pMdiTextEdit->buffer[iEndPos]!='\0') iEndPos++;
+	while(MdiInfo[WndNum]->pMdiTextEdit->buffer[iEndPos]!='\r'&&MdiInfo[WndNum]->pMdiTextEdit->buffer[iEndPos]!='\0') iEndPos++;
 
 	TextEdit_SetSel(WndNum,iStartPos,iEndPos,bShowCenter);
@@ -234,15 +234,15 @@
 	GetCaretPos(&OldPos);
 
-	x=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
-	y=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
+	x=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x;
+	y=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y;
 	GetScrollBaseCaretPos(WndNum,&x,&y);
 
 	//エディタ画面左端のコントロールタブ
 	int iControlTabSpace;
-	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum]->pMdiTextEdit->iWidth_ControlTabSpace;
 
 	//コントロールタブ上にカーソルがきたときに、非表示にする
-	if(OldPos.x>=iControlTabSpace&&x<0) HideCaret(MdiInfo[WndNum].pMdiTextEdit->hEdit);
-	else if(OldPos.x<iControlTabSpace&&x>=0) ShowCaret(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+	if(OldPos.x>=iControlTabSpace&&x<0) HideCaret(MdiInfo[WndNum]->pMdiTextEdit->hEdit);
+	else if(OldPos.x<iControlTabSpace&&x>=0) ShowCaret(MdiInfo[WndNum]->pMdiTextEdit->hEdit);
 
 	SetCaretPos(
@@ -256,14 +256,14 @@
 	// Web検索文字列
 	//////////////////////////////////////////////
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
 		int start,end;
-		if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y){
+		if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y){
 			//文字列を選択中でないとき
 
 			int sw=0;
 			if(bInputAndReset){
-				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x>1){
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x-=2;
+				if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x>1){
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x-=2;
 					sw=1;
 				}
@@ -271,29 +271,29 @@
 
 			TextEdit_GetWordCaret(
-				MdiInfo[WndNum].pMdiTextEdit->hEdit,
+				MdiInfo[WndNum]->pMdiTextEdit->hEdit,
 				WndNum,
-				&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos,
+				&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos,
 				&start,&end,
 				WORDCARET_BEFORE);
 
-			if(sw) MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+=2;
+			if(sw) MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x+=2;
 
 			//半角文字列を選択時の全角とのズレを修正
 			POINT pos;
-			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,start,&pos);
-			start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
-			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,end,&pos);
-			end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum]->pMdiTextEdit->buffer,start,&pos);
+			start=GetBufferIndexFromCaretPos(MdiInfo[WndNum]->pMdiTextEdit->buffer,pos.x,pos.y);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum]->pMdiTextEdit->buffer,end,&pos);
+			end=GetBufferIndexFromCaretPos(MdiInfo[WndNum]->pMdiTextEdit->buffer,pos.x,pos.y);
 		}
 		else{
 			//文字列を選択中のとき
 			start=GetBufferIndexFromCaretPos(
-				MdiInfo[WndNum].pMdiTextEdit->buffer,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+				MdiInfo[WndNum]->pMdiTextEdit->buffer,
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
 			end=GetBufferIndexFromCaretPos(
-				MdiInfo[WndNum].pMdiTextEdit->buffer,
-				MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x,
-				MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y);
+				MdiInfo[WndNum]->pMdiTextEdit->buffer,
+				MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x,
+				MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y);
 		}
 
@@ -310,5 +310,5 @@
 		if(length<0) length=0;
 		pTemp=(char *)HeapAlloc(hHeap,0,length+1024);
-		memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+start,length);
+		memcpy(pTemp,MdiInfo[WndNum]->pMdiTextEdit->buffer+start,length);
 		pTemp[length]=0;
 
@@ -340,5 +340,5 @@
 	extern METHODCHECKINFO MethodCheckInfo;
 	if(MethodCheckInfo.hWnd){
-		if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC)
+		if(MdiInfo[WndNum]->DocType==WNDTYPE_BASIC)
 			ShowParameterHint(WndNum);
 	}
@@ -354,7 +354,7 @@
 		char *pTemp,temporary[VN_SIZE];
 
-		i=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+		i=GetBufferIndexFromCaretPos(MdiInfo[WndNum]->pMdiTextEdit->buffer,
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
 
 		if(i<ComplementWndInfo.iPos||ComplementWndInfo.iPos+ComplementWndInfo.iLength<i){
@@ -379,5 +379,5 @@
 			pTemp=(char *)HeapAlloc(hHeap,0,ComplementWndInfo.iLength+1);
 			memcpy(pTemp,
-				MdiInfo[WndNum].pMdiTextEdit->buffer+ComplementWndInfo.iPos,
+				MdiInfo[WndNum]->pMdiTextEdit->buffer+ComplementWndInfo.iPos,
 				ComplementWndInfo.iLength);
 			pTemp[ComplementWndInfo.iLength]=0;
@@ -432,5 +432,5 @@
 			pTemp=(char *)HeapAlloc(hHeap,0,ComplementWndInfo.iLength+1);
 			memcpy(pTemp,
-				MdiInfo[WndNum].pMdiTextEdit->buffer+ComplementWndInfo.iPos,
+				MdiInfo[WndNum]->pMdiTextEdit->buffer+ComplementWndInfo.iPos,
 				ComplementWndInfo.iLength);
 			pTemp[ComplementWndInfo.iLength]=0;
@@ -462,8 +462,8 @@
 
 	HWND hEdit;
-	hEdit=MdiInfo[WndNum].pMdiTextEdit->hEdit;
-
-	x=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
-	y=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
+	hEdit=MdiInfo[WndNum]->pMdiTextEdit->hEdit;
+
+	x=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x;
+	y=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y;
 	GetScrollBaseCaretPos(WndNum,&x,&y);
 
@@ -537,5 +537,5 @@
 	if(loose_y<0) loose_y=0;
 
-	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 	// 行の確認
@@ -659,5 +659,5 @@
 
 	POINT *pCaretPos;
-	pCaretPos=&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+	pCaretPos=&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 
 	if(pCaretPos->x==0&&pCaretPos->y==0){
@@ -666,5 +666,5 @@
 	}
 
-	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 	i=GetBufferIndexFromCaretPos(pBuf,
@@ -711,5 +711,5 @@
 	char *pBuf;
 
-	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 	i=GetBufferIndexFromCaretPos(pBuf,
@@ -768,11 +768,11 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	pCaretPos->y--;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
@@ -784,11 +784,11 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	pCaretPos->y++;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
@@ -805,16 +805,16 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	SCROLLINFO si;
 	si.cbSize=sizeof(SCROLLINFO);
 	si.fMask=SIF_PAGE;
-	GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
+	GetScrollInfo(MdiInfo[WndNum]->pMdiTextEdit->hEdit,SB_VERT,&si);
 	pCaretPos->y-=si.nPage;
 	if(pCaretPos->y<0) pCaretPos->y=0;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
@@ -826,15 +826,15 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	SCROLLINFO si;
 	si.cbSize=sizeof(SCROLLINFO);
 	si.fMask=SIF_PAGE;
-	GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
+	GetScrollInfo(MdiInfo[WndNum]->pMdiTextEdit->hEdit,SB_VERT,&si);
 	pCaretPos->y+=si.nPage;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
