Index: ProjectEditor/Search.cpp
===================================================================
--- ProjectEditor/Search.cpp	(revision 24)
+++ ProjectEditor/Search.cpp	(revision 80)
@@ -4,5 +4,5 @@
 int FindPosCounter;
 
-char *CompareSuper(HWND hDlg,char *buffer,char *szFind,BOOL IsBigSmall,BOOL IsRegExp,int *pLength){
+char *CompareSuper(HWND hDlg,char *buffer,char *szFind,BOOL IsBigSmall,bool isWordUnit,BOOL IsRegExp,int *pLength ){
 	char *pTemp;
 
@@ -11,9 +11,9 @@
 	if(IsRegExp){
 		//正規表現を有効にしながら検索
-		pTemp=obj_RegExp.compare(hDlg,buffer,szFind,IsBigSmall,pLength);
+		pTemp=obj_RegExp.compare(hDlg,buffer,szFind,IsBigSmall, isWordUnit, pLength);
 	}
 	else{
 		//通常の検索
-		pTemp=ComparisonString(buffer,szFind,IsBigSmall);
+		pTemp=ComparisonString(buffer,szFind,IsBigSmall?true:false, isWordUnit );
 
 		*pLength=lstrlen(szFind);
@@ -23,5 +23,5 @@
 }
 
-void SetSearchData(HWND hDlg,char *str,_int8 IsBigSmall){
+void SetSearchData(HWND hDlg,char *str,_int8 IsBigSmall, bool isWordUnit){
 	extern HANDLE hHeap;
 	extern MDIINFO MdiInfo[MAX_WNDNUM];
@@ -46,5 +46,5 @@
 	i3=1;
 	while(1){
-		FindStr=CompareSuper(hDlg,buffer+i,str,IsBigSmall,pobj_nv->bRegExp,&length);
+		FindStr=CompareSuper(hDlg,buffer+i,str,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length);
 		if(FindStr==(char *)-1){
 			//エラー
@@ -136,5 +136,5 @@
 	return 0;
 }
-BOOL StartSearch(HWND hDlg,char *FindString,_int8 IsBigSmall,BOOL IsShowMessage){
+BOOL StartSearch(HWND hDlg,char *FindString,_int8 IsBigSmall, bool isWordUnit, BOOL IsShowMessage){
 	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
@@ -155,5 +155,5 @@
 	int length;
 
-	i=(int)CompareSuper(hDlg,pBuf+i,FindString,IsBigSmall,pobj_nv->bRegExp,&length);
+	i=(int)CompareSuper(hDlg,pBuf+i,FindString,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length);
 	if(i==-1){
 		//エラー
@@ -173,5 +173,5 @@
 		if(!IsShowMessage) return 0;
 
-		i=(int)CompareSuper(hDlg,pBuf,FindString,IsBigSmall,pobj_nv->bRegExp,&length);
+		i=(int)CompareSuper(hDlg,pBuf,FindString,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length);
 		if(i==-1){
 			//エラー
@@ -223,4 +223,9 @@
 			//大文字・小文字
 			if(pobj_nv->bFindStrBigSmall) SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_SETCHECK,BST_CHECKED,0);
+
+			// 単語単位
+			if( pobj_nv->isWordUnit ){
+				SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_SETCHECK, BST_CHECKED, 0 );
+			}
 
 			//正規表現
@@ -263,9 +268,13 @@
 					else pobj_nv->bFindStrBigSmall=0;
 
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
 					//正規表現
 					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
 					else pobj_nv->bRegExp=0;
 
-					StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall,1);
+					StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 1);
 					return 1;
 				case IDC_FINDALL:
@@ -278,4 +287,8 @@
 					else pobj_nv->bFindStrBigSmall=0;
 
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
 					//正規表現
 					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
@@ -287,5 +300,5 @@
 					FindPosCounter=sizeof(long);
 					pFindPos=(long *)HeapAlloc(hHeap,0,FindPosCounter);
-					SetSearchData(FindAllDlg,temporary,pobj_nv->bFindStrBigSmall);
+					SetSearchData(FindAllDlg,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit );
 				case IDCANCEL:
 					EndDialog(hwnd,0);
@@ -311,4 +324,9 @@
 			if(pobj_nv->bFindStrBigSmall) SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_SETCHECK,BST_CHECKED,0);
 
+			// 単語単位
+			if( pobj_nv->isWordUnit ){
+				SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_SETCHECK, BST_CHECKED, 0 );
+			}
+
 			//正規表現
 			if(pobj_nv->bRegExp) SendDlgItemMessage(hwnd,IDC_REGEXP,BM_SETCHECK,BST_CHECKED,0);
@@ -356,4 +374,8 @@
 					else pobj_nv->bFindStrBigSmall=0;
 
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
 					//正規表現
 					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
@@ -364,5 +386,5 @@
 					AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary);
 
-					StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall,1);
+					StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 1);
 					return 1;
 				case IDC_PERMUTATIONNEXT:
@@ -374,4 +396,8 @@
 					if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1;
 					else pobj_nv->bFindStrBigSmall=0;
+
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
 
 					//正規表現
@@ -399,5 +425,5 @@
 
 					int length;
-					i=(int)CompareSuper(hwnd,pTemp,temporary,pobj_nv->bFindStrBigSmall,pobj_nv->bRegExp,&length);
+					i=(int)CompareSuper(hwnd,pTemp,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, pobj_nv->bRegExp,&length);
 					if(i==-1){
 						HeapDefaultFree(pTemp);
@@ -441,4 +467,8 @@
 					else pobj_nv->bFindStrBigSmall=0;
 
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
 					//正規表現
 					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
@@ -462,5 +492,5 @@
 					TextEdit_SetSel(WndNum,0,0,TRUE);
 
-					while(StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall,0)){
+					while(StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 0)){
 						if(pobj_nv->bRegExp){
 							//選択されている文字列を取得
