12c12
< #define __HTMLCMD__ "1.22"
---
> #define __HTMLCMD__ "1.22+ynp5" //�šY.Nakamura
817c817
< 		dialogTxstr(hd,"ÃÞÌ«ÙÄHTML(&D):",15,szDefaultHtml,15);
---
> 		dialogTxstr(hd,"ÃÞÌ«ÙÄHTML(&D):",15,szDefaultHtml,30);
1172c1172
< void pathSetAbsolute(TX *text,mchar *szfilename);
---
> int pathSetAbsolute(TX *text,mchar *szfilename); //�šY.Nakamura •Ô‚è’l•Ï�X
1459a1460,1485
> //�šY.Nakamura�iM.Shibata‚³‚ñ’ñ‹Ÿ�j
> BOOL getDefaultHtmlFile(mchar *szbuff, mchar *szdir, mchar *szfilelist)
> {
> 	// szfilelist‚ÉƒZƒ~ƒRƒ�ƒ“‹æ�Ø‚è‚ÅŽw’è‚³‚ê‚Ä‚¢‚éƒtƒ@ƒCƒ‹–¼‚ðszdir‚©‚ç’T
> 	// ‚µ�o‚µ�A�Å�‰‚ÉŒ©‚Â‚©‚Á‚½ƒtƒ@ƒCƒ‹‚Ìƒtƒ‹ƒpƒX‚ðszbuff‚ÉŠi”[‚·‚é�Bƒtƒ@
> 	// ƒCƒ‹‚ªŒ©‚Â‚©‚Á‚½‚©‚Ç‚¤‚©‚ð•Ô‚·�Bszbuff‚É‚Íƒtƒ‹ƒpƒX‚ðŠi”[‚·‚é‚Ì‚É�\
> 	// •ª‚ÈƒTƒCƒY‚ª•K—v�B
> 	mchar szfilename[CCHPATHNAME];
> 	mchar *p = szfilelist;
> 	mchar *q;
> 	while (*p) {
> 		q = strchr(p, ';');
> 		if (!q) q = p + strlen(p);
> 		strcpylen(szfilename, p, q - p);
> 		if (*szfilename) {
> 			pathSetMode(szfilename, szdir, NULL, PATH_ABSOLUTEDRIVE);
> 			if (fileIsExist(szfilename)) {
> 				strcpy(szbuff, szfilename);
> 				return TRUE;
> 			}
> 		}
> 		p = q + 1;
> 	}
> 	return FALSE;
> }
> 
3087,3088c3113,3116
< 
< void pathSetAbsolute(TX *text,mchar *szfilename)
---
> //�šY.Nakamura ’è�”’Ç‰Á
> #define PATH_FOLDER	0 
> #define PATH_FILE	1
> int pathSetAbsolute(TX *text,mchar *szfilename) //�šY.Nakamura •Ô‚è’l•Ï�X
3090a3119
> 	//�šY.Nakamura •Ô‚è’l•Ï�X szfilename‚É�Ý’è‚³‚ê‚½ƒpƒX‚ÌŽí—Þ‚ð•Ô‚·
3122,3123c3151,3156
< 	if (szfilename[strlen(szfilename)-1]==0x5c && szDefaultHtml[0]) {
< 		strcat(szfilename,szDefaultHtml);
---
> 	//�šY.Nakamura getDefaultHtmlFileŽg—pƒo�[ƒWƒ‡ƒ“‚É‰ü‘¢
> 	if (szfilename[strlen(szfilename)-1]==0x5c) {
> 		//getDefaultHtmlFile‚ªFALSE��szfilename‚ÍƒtƒHƒ‹ƒ_
> 		if(!getDefaultHtmlFile(szfilename, szfilename, szDefaultHtml)){
> 			return PATH_FOLDER;
> 		}
3124a3158
> 	return PATH_FILE;
3126,3127d3159
< 
< 
4015c4047,4049
< BOOL GetKc(mchar *sz)
---
> //BOOL GetKc(mchar *sz)
> #define KC_ERROR -1//�šY.Nakamura •s�³‚È�A‚ ‚é‚¢‚Í‘Î‰žŠO‚Ì•¶ŽšƒR�[ƒhŽw’è
> int GetKc(mchar *sz) //�šY.Nakamura “à•”“I‚É‚Í“¯‚¶‚¾‚¯‚Çˆê‰ž
4019a4054
> 	return KC_ERROR; //�šY.Nakamura
4356c4391,4392
< 			kcSave = GetKc(buff);
---
> 			int kcTemp = GetKc(buff); //�šY.Nakamura
> 			if(kcTemp != KC_ERROR) kcSave = kcTemp; //�šY.Nakamura
4649c4685,4686
< 		pathSetMode(szfilename,text->szfilename,NULL,PATH_ABSOLUTEDRIVE);
---
> //		pathSetMode(szfilename,text->szfilename,NULL,PATH_ABSOLUTEDRIVE);
> 		pathSetAbsolute(text,szfilename); //�šY.Nakamura pathSetMode‚©‚çpathSetAbsolute‚É•Ï�X
4686,4693c4723,4730
< 		case 99: return txIdmExec(text,IDM_HTML_BROWSER);
< 		case 1: return SearchLink(text,"contents",1);
< 		case 2: return SearchLink(text,"next",1);
< 		case 3: return SearchLink(text,"prev",1);
< 		case 4: return SearchLink(text,"appendix",1);
< 		case 5: return SearchLink(text,"glossary",1);
< 		case 6: return SearchLink(text,"index",1);
< 		case 7: return SearchLink(text,"stylesheet",1);
---
> 		case 99: txIdmExec(text,IDM_HTML_BROWSER); break;
> 		case 1: SearchLink(text,"contents",1); break;
> 		case 2: SearchLink(text,"next",1); break;
> 		case 3: SearchLink(text,"prev",1); break;
> 		case 4: SearchLink(text,"appendix",1); break;
> 		case 5: SearchLink(text,"glossary",1); break;
> 		case 6: SearchLink(text,"index",1); break;
> 		case 7: SearchLink(text,"stylesheet",1); break;
4695d4731
< 	
4889c4925,4926
< 				if (!text->fDispURL) shellExecute(szfilename, "open");
---
> 				shellExecute(szfilename, "open"); //�šY.Nakamura fDispURL‚ªTRUE‚Å‚àƒvƒ‰ƒOƒCƒ“‘¤‚Å�ˆ—�
> 				                                  //‚±‚ê‚É‚æ‚èhref‘®�«“à‚ÌŽÀ‘ÌŽQ�Æ‚ðŠÜ‚ÞURI‚É‚à�³‚µ‚­ƒWƒƒƒ“ƒv‚Å‚«‚é
4893c4930,4931
< 				if (!text->fDispURL) shellExecute(szfilename, "open");
---
> 				regularStr(szfilename,CCHPATHNAME,"&#64;","@",0); //�šY.Nakamura @‚ð�”’l•¶ŽšŽQ�Æ‚Å•\‹L‚µ‚Ä‚¢‚é‚Îˆ¤‚É‘Î‰ž
> 				shellExecute(szfilename, "open"); //�šY.Nakamura fDispURL‚ªTRUE‚Å‚àƒvƒ‰ƒOƒCƒ“‘¤‚Å�ˆ—�
4902a4941
> 			BOOL fOpenText = FALSE; //�šY.Nakamura ƒŠƒ“ƒN�æƒeƒLƒXƒg‚ðŠJ‚¢‚½‚©‚Ç‚¤‚©
4904c4943,4946
< 				pathSetAbsolute(text,szfilename);
---
> 				//�šY.Nakamura pathSetAbsolute‚ÅƒtƒHƒ‹ƒ_‚©‚Ç‚¤‚©‚ð’²‚×‚é‚æ‚¤‚É‚µ‚½‚Ì‚ÅŠÈ—ª‰»
> 				if(pathSetAbsolute(text,szfilename) == PATH_FOLDER){ //ƒtƒHƒ‹ƒ_‚È‚çShellExecute
> 					shellExecute(szfilename, "open"); return TRUE;
> 				}
4906,4912c4948,4958
< 					if (stristr(szDefaultHtml, pathGetFileName(szfilename))) {
< 						pathSetFileName(szfilename, "");
< 						shellExecute(szfilename, "open");
< 						return TRUE;
< 					} else {
< 						information("%s\n‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ�B",szfilename); return TRUE;
< 					}
---
> 					information("%s\n‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ�B",szfilename); return TRUE;
> 				}
> 				//�šY.Nakamura Šg’£Žq‚ª�uƒoƒCƒiƒŠƒtƒ@ƒCƒ‹‚ÌŠg’£Žq�v‚È‚çshellExecute
> 				mchar szExtBinary[128];
> 				strcpy(szExtBinary,sh->cszExtBinary); //ƒoƒCƒiƒŠƒtƒ@ƒCƒ‹‚ÌŠg’£Žq‚ð•¡ŽÊ
> 				regularStr(szExtBinary,128,";","|",0);
> 				mchar szfindbuff[128 + 4];
> 				sprintf(szfindbuff,"^(%s)$",szExtBinary);
> 				if(re(szExtBinary,pathGetExt(szfilename))){
> 					shellExecute(szfilename, "open");
> 					return TRUE;
4914a4961
> 				fOpenText = TRUE;
4927a4975
> 			return fOpenText;
5047c5095
< 	wndImeSetOpen(hwnd,0);
---
> 	wndImeSetOpen(text->hwndtext,0); //�šY.Nakamura hwnd�¨text->hwndtext‚É�C�³
5061c5109,5113
< 		dialogChoiceString(hd,"*”z’u(&A)",10,szAlign,CCHWORD,15,"","center","right","left",NULL);
---
> 		//�šY.Nakamura �u”z’u�v‚ð•\Ž¦‚·‚é‚Ì‚ÍTransitional‚Ì‚Ý
> 		text::doctype = GetCurDoctype(text);
> 		if(text::doctype == DOCTYPE_X10TRANSITIONAL || text::doctype == DOCTYPE_40TRANSITIONAL){
> 			dialogChoiceString(hd,"*”z’u(&A)",10,szAlign,CCHWORD,15,"","center","right","left",NULL);
> 		}
5206a5259
> 	BOOL fLocal = TRUE; //�šY.Nakamura ƒ��[ƒJƒ‹ƒtƒ@ƒCƒ‹‚ÌŽQ�Æ‚©‚Ç‚¤‚©
5219a5273
> 			fLocal = FALSE; //�šY.Nakamura
5236a5291
> 						txConfigGet(text2); //�šY.Nakamura — ƒeƒLƒXƒg‚Åfilekind‚ð”½‰f‚³‚¹‚é
5239c5294
< 							textclose(text2);
---
> //							textclose(text2); �šY.Nakamura�iƒRƒ�ƒ“ƒg‰»�j
5241a5297
> 						textclose(text2); //�šY.Nakamura ‚±‚Á‚¿‚¶‚á‚È‚¢‚ÆHTML‚¶‚á‚È‚©‚Á‚½�ê�‡‚É•Â‚¶‚ç‚ê‚È‚¢
5244a5301,5316
> 				if(fLocal){ //�šY.Nakamura ƒ��[ƒJƒ‹ƒtƒ@ƒCƒ‹‚ÌŽQ�ÆŽž‚Ì‚Ý
> 					//�šY.Nakamura ƒtƒ@ƒCƒ‹–¼‚ªszDefaultHtml‚¾‚Á‚½‚ç�í�œ
> 					mchar szfindbuff[CCHPATHNAME+1];//�šY.Nakamura
> 					mchar szDefaultHtmlTemp[CCHTXSTR];
> 					strcpy(szDefaultHtmlTemp,szDefaultHtml); //ƒfƒtƒHƒ‹ƒgHTML‚ð•¡ŽÊ
> 					regularStr(szDefaultHtmlTemp,CCHTXSTR,";","|",0);
> 					sprintf(szfindbuff,"(%s)(#[\\w\\-:\\.]+)?$",szDefaultHtmlTemp); //�šY.Nakamura
> 					regularStr(szfilename,CCHPATHNAME,szfindbuff,"$2",0);//�šY.Nakamura ƒtƒ‰ƒOƒ�ƒ“ƒgŽ¯•ÊŽqˆÈŠO‚Ì––”ö‚ªszDefaultHtml‚È‚ç�í�œ
> 					if(strcmp(szfilename,"") == 0) strcat(szfilename,"./");//�šY.Nakamura ƒtƒ@ƒCƒ‹–¼‚ª‹ó‚É‚È‚Á‚Ä‚µ‚Ü‚Á‚½‚ç./‚ð�Ý’è
> 					else if(re(szfilename,"^#")){ //�šY.Nakamura ƒtƒ‰ƒOƒ�ƒ“ƒgŽ¯•ÊŽq‚¾‚¯‚È‚ç./‚ð’Ç‰Á
> 						mchar szbuff[CCHPATHNAME];
> 						strcpy(szbuff,szfilename);
> 						strcpy(szfilename,"./");
> 						strcat(szfilename,szbuff);
> 					}
> 				}
5290a5363,5413
> #if 1 //�šY.Nakamura‰ü‘¢ƒo�[ƒWƒ‡ƒ“�i�u1Œ…–Ú�E—¼•û‚ðƒwƒbƒh�v’Ç‰Á�j
> permanent int p_table_width = 5;
> permanent int p_table_height = 5;
> #define TABLEHEAD_NONE 0 //ƒwƒbƒh‚È‚µ
> #define TABLEHEAD_ROW 1 //1�s–Ú‚ªƒwƒbƒh
> #define TABLEHEAD_COL 2 //1Œ…–Ú‚ªƒwƒbƒh
> #define TABLEHEAD_BOTH 3 //1�s–Ú�A1Œ…–Ú—¼•û‚ªƒwƒbƒh
> permanent int p_table_head = TABLEHEAD_NONE;
> //permanent int p_table_type = 0;
> permanent BOOL p_table_form;//ƒe�[ƒuƒ‹‚ÌƒJƒ‰ƒ€“WŠJ
> void uiInsertTableHtml (TX *text)
> {
> 	HDIALOG hd = dialog("•\‚Ì‘}“ü - HTML");
> 	dialogSetH(hd);
> 	dialogControlUpdown(hd,1,10);
> 	dialogInteger(hd,"Œ…�”‚Æ�s�”(&T):",11,&p_table_width,5);
> 	dialogControlUpdown(hd,1,50);
> 	dialogInteger(hd,"x",2,&p_table_height,5);
> 	dialogLF(hd);
> 	dialogChoice(hd,"Í¯ÄÞ(&H)",6,&p_table_head,8,"‚È‚µ","1�s–Ú","1Œ…–Ú","—¼•û",NULL);
> 	dialogCheck(hd,"¶×Ñ“WŠJ(&F)",&p_table_form);
> 	dialogSetV(hd);
> 	dialogLF(hd);
> 	if (dialogOpenOff(text,hd)) {
> 		txSetUndispEx(text);
> 		txInsert(text,"<table>\n");
> 		for (int i=0;i<p_table_height;i++) {
> 			txInsert(text,"<tr>");
> 			if (p_table_form) txInsert(text,"\n");
> 			for (int j=0;j<p_table_width;j++) {
> 				if (p_table_form) {
> 					if((p_table_head == TABLEHEAD_ROW && i == 0) || (p_table_head == TABLEHEAD_COL && j == 0) || (p_table_head == TABLEHEAD_BOTH && (i==0 || j==0))){
> 						txInsert(text,"\t<th></th>\n");
> 					}else{
> 						txInsert(text,"\t<td></td>\n");
> 					}
> 				} else {
> 					if((p_table_head == TABLEHEAD_ROW && i == 0) || (p_table_head == TABLEHEAD_COL && j == 0) || (p_table_head == TABLEHEAD_BOTH && (i==0 || j==0))){
> 						txInsert(text,(j == p_table_width -1) ? "<th></th>" : "<th></th>\t"); //�Å�IƒJƒ‰ƒ€‚Å‚Í\t‚ð‘}“ü‚µ‚È‚¢
> 					}else{
> 						txInsert(text,(j == p_table_width -1) ? "<td></td>" : "<td></td>\t");
> 					}
> 				}
> 			}
> 			txInsert(text, "</tr>\n");
> 		}
> 		txInsert(text,"</table>\n");
> 		txSetDispEx(text);
> 	}
> }
> #else //�šY.Nakamura ‚±‚±‚©‚çƒIƒŠƒWƒiƒ‹ƒo�[ƒWƒ‡ƒ“
5314c5437
< 			if (p_table_form) txInsert(text,"\n"); else txInsert(text,(i) ? "<td>" : "<th>");
---
> 			if (p_table_form) txInsert(text,"\n"); else txInsert(text,(i == 0 && p_table_head) ? "<th>" : "<td>"); //�šY.Nakamura �u1�s–Ú‚Íƒwƒbƒh�v‚ÌON/OFF‚ÉŠÖ‚í‚ç‚¸ƒwƒbƒh‚É‚È‚Á‚Ä‚¢‚½‚Ì‚ð�C�³ ˆÈ‰º“¯
5318c5441
< 					txInsert(text,(i) ? "\t<td></td>\n" : "\t<th></th>\n");
---
> 					txInsert(text,(i == 0 && p_table_head) ? "\t<th></th>\n" : "\t<td></td>\n"); //�šY.Nakamura
5320c5443
< 					txInsert(text,(i) ? "</td>\t<td>" : "</th>\t<th>");
---
> 					txInsert(text,(i == 0 && p_table_head) ? "</th>\t<th>" : "</td>\t<td>"); //�šY.Nakamura
5327c5450
< 				txInsert(text, (i) ? "</td></tr>\n" : "</th></tr>\n");
---
> 				txInsert(text, (i == 0 && p_table_head) ? "</th></tr>\n" : "</td></tr>\n"); //�šY.Nakamura
5335a5459
> #endif
8178c8302,8306
< 		else temp= textopenKcAuto(szdist);
---
> 		//�šY.Nakamura DOCTYPE‚ðŽæ“¾�i— ƒeƒLƒXƒg‚Ö‚Ì�V‹K’Ç‰ÁŽž�AXHTML‚©‚Ç‚¤‚©‚ð”»’è�j
> 		else{
> 			temp= textopenKcAuto(szdist);
> 			temp::doctype = GetCurDoctype(temp); 
> 		}
9540,9542c9668,9676
< 				if (!stricmp(szFirstHtml, pathGetFileName(szfilename))) pathSetFileName(szfilename,szDefaultHtml);
< 				else if (stricmp(szDefaultHtml, pathGetFileName(szfilename))) pathSetFileName(szfilename,szFirstHtml);
< 				
---
> 				//�šY.Nakamura szDefaultHtml‚ÌŽd—l•Ï�X‚É‘Î‰ž
> 				pathSetFileName(szfilename,szFirstHtml);
> 				if(!fileIsExist(szfilename)){
> 					mchar szdir[CCHPATHNAME];
> 					strcpy(szdir,szfilename);
> 					pathSetFileName(szdir,"");
> 					pathSetDir(szdir);
> 					getDefaultHtmlFile(szfilename, szdir, szDefaultHtml);
> 				}
9545d9678
< 
9579,9582c9712,9713
< 				if (!stricmp(szDefaultHtml, pathGetFileName(szfilename))) {
< 					pathSetFileName(szfilename,"");
< 					pathFormDir(szfilename);
< 				}
---
> 				pathSetFileName(szfilename,"");
> 				pathFormDir(szfilename);
9658,9659c9789,9793
< 			GetHeaderStr(text,"meta>[^>]*http-equiv=\"Content-Type\"","content",sz,CCHWORD,0,0);
< 			text->kcSave = GetKc(sz);
---
> 			//�šY.Nakamura GetHeaderStr‚ªTRUE�i•¶Žš—ñ‚ªŽæ“¾‚Å‚«‚½�j‚ÅGetKc‚Ì•Ô‚è’l‚ª—LŒø‚È�ê�‡‚Ì‚ÝkcSave‚ðƒZƒbƒg�AContent-Type‚ª""‚ÅˆÍ‚Ü‚ê‚Ä‚È‚¢�ê�‡‚É‘Î‰ž
> 			if(GetHeaderStr(text,"meta>[^>]*http-equiv=\"?Content-Type\"?","content",sz,CCHWORD,0,0)){
> 				int kcTemp = GetKc(sz);
> 				if(kcTemp != KC_ERROR) text->kcSave = kcTemp;
> 			}
