Bool32 ed_CorrectSpeller(int32_t version) { int32_t n, i; CSTR_line line; n=CSTR_GetMaxNumber (); for(i=0;i<n;i++) { line = CSTR_GetLineHandle (i, version); if( line ) { ed_cstr_string(line); break; // debug } } return TRUE; }
///////////////////////////////////////////////////////////////////////////////////////// // DESC: Запись контейнера CSTR на диск // ARGS: filename - имя файла // RETS: TRUE - успешно // FALSE - ошибка ///////////////////////////////////////////////////////////////////////////////////////// CSTR_FUNC(Bool32) CSTR_SaveCont(char *filename) { int32_t i, j, count; Bool32 lineFlg; FILE *out; CSTR_rast rst; CSTR_attr attr; CSTR_line linx; CGRAPH_FileData fData; if(!(out = fopen(filename, "wb"))) { wLowRC = CGRAPH_ERR_OPEN; return FALSE; } fData.FileVer = FILE_VER; fData.MaxLineVer = LINE_VER; count = CSTR_GetMaxNumber(); fwrite(IDtext, sizeof(IDtext), 1, out); fwrite(&fData, sizeof(fData), 1, out); fwrite(&count, sizeof(count), 1, out); for(i = 1; i <= count; i++) { for(j = 0; j < fData.MaxLineVer; j++) { fwrite(&i, sizeof(i), 1, out); //Номер строки fwrite(&j, sizeof(i), 1, out); //Версия if(!(linx = CSTR_GetLineHandle(i, j))) { lineFlg = FALSE; fwrite(&lineFlg, sizeof(lineFlg), 1, out); continue; } else { lineFlg = TRUE; fwrite(&lineFlg, sizeof(lineFlg), 1, out); } if(!(rst = CSTR_GetFirstRaster(linx))) { wLowRC = CGRAPH_ERR_PARAM; fclose(out); return FALSE; } if(!(CSTR_GetLineAttr(linx, &attr))) { wLowRC = CGRAPH_ERR_PARAM; fclose(out); return FALSE; } if(!CGRAPH_SaveCSTR(rst->next, &attr, out)) { fclose(out); return FALSE; } if(!CGRAPH_SaveLoop(rst->next, &attr, out)) { fclose(out); return FALSE; } } } fclose(out); return TRUE; }
RPSTR_FUNC(Bool32) RPSTR_CorrectSpell(int32_t version) { int32_t n, i, rf=-1; CSTR_line line; //char snapstr[256]; CSTR_rast rb=(CSTR_rast)0, re=(CSTR_rast)0; Bool32 disable_new_dict=FALSE, disable_check_word=FALSE; //CSTR_attr lattr; exit_enable = FALSE; snap_enable=TRUE; skip_line=FALSE; n=CSTR_GetMaxNumber (); // 12.06.2002 E.P. if (is_turkish_language(language)) disable_new_dict = TRUE; LDPUMA_StartLoop( hSnapSpell, n ); for(i=1;i<=n;i++) { LDPUMA_LoopNext( hSnapSpell ); line = CSTR_GetLineHandle (i, version); if( !line ) continue; skip_line=FALSE; if (!correct_line_spell(line, &re, &rb, i, disable_new_dict, disable_check_word, &rf)) return FALSE; /* вынесено в функцию correct_line_spell CSTR_GetLineAttr(line,&lattr); // if( !(lattr.Flags & CSTR_STR_CapDrop) ) if( !LDPUMA_SkipEx(hSnapSpell,TRUE,TRUE,1) && snap_enable ) { sprintf(snapstr,"before spelling line %d",i); Snap_Console(snapstr); LDPUMA_RasterText("before spelling"); LDPUMA_CSTR_Monitor(hSnapSpell,line,0,myMonitorProc); if( exit_enable ) { LDPUMA_DestroyRasterWnd(); return FALSE; } } if( !rpstr_correct_spell(line,&rb,&re,&rf,i,disable_new_dict, disable_check_word) ) { sprintf("speller error : %s ",sp_err); Snap_Console(snapstr); LDPUMA_DestroyRasterWnd(); return FALSE; } if( !skip_line && !LDPUMA_SkipEx(hSnapSpell,TRUE,TRUE,1) && snap_enable ) { sprintf(snapstr,"after spelling line %d",i); Snap_Console(snapstr); LDPUMA_RasterText("after spelling"); LDPUMA_CSTR_Monitor(hSnapSpell,line,0,myMonitorProc); } if( exit_enable ) { LDPUMA_DestroyRasterWnd(); return FALSE; } */ } if( re ) { CSTR_rast_attr attr; CSTR_GetAttr(re,&attr); attr.flg_spell |= CSTR_fa_spell_nocarrying; CSTR_SetAttr(re,&attr); } if( !LDPUMA_SkipEx(hSnapSpell,TRUE,TRUE,1) ) LDPUMA_DestroyRasterWnd(); return TRUE; }