From: <td...@us...> - 2003-11-18 04:09:57
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv21625 Modified Files: ChangeLog.txt FindDialog.cpp FindReplace.cpp FindReplace.h ToDo.txt Log Message: - Fixed regular expression in replace patterns [#798478] - Added option in replace to remove transform backslash expressions. Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ChangeLog.txt 27 Aug 2003 06:32:42 -0000 1.28 --- ChangeLog.txt 18 Nov 2003 04:09:50 -0000 1.29 *************** *** 33,36 **** --- 33,38 ---- 26) Fixed regular expression not working with find and find replace [#787886] 27) Added folding support to html files + 28) Fixed regular expression in replace patterns [#798478] + 29) Added option in replace to remove transform backslash expressions. Beta 1.0 Index: FindDialog.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindDialog.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FindDialog.cpp 27 Aug 2003 06:32:42 -0000 1.10 --- FindDialog.cpp 18 Nov 2003 04:09:50 -0000 1.11 *************** *** 58,63 **** if (!strText.IsEmpty ()) { ! SaveToRegistry ! (); if(m_up.GetCheck()) --- 58,62 ---- if (!strText.IsEmpty ()) { ! SaveToRegistry(); if(m_up.GetCheck()) *************** *** 171,176 **** } ! void CFindDialog::SaveToRegistry ! () { CString tempStr; --- 170,174 ---- } ! void CFindDialog::SaveToRegistry() { CString tempStr; *************** *** 202,207 **** void CFindDialog::OnCancel() { ! SaveToRegistry ! (); CDialog::OnCancel(); } --- 200,204 ---- void CFindDialog::OnCancel() { ! SaveToRegistry(); CDialog::OnCancel(); } Index: FindReplace.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindReplace.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FindReplace.cpp 1 Sep 2003 11:27:34 -0000 1.6 --- FindReplace.cpp 18 Nov 2003 04:09:50 -0000 1.7 *************** *** 32,35 **** --- 32,36 ---- CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFindReplace) + DDX_Control(pDX, IDC_CHECK4, m_check4); DDX_Control(pDX, ID_FINDNEXT, m_find); DDX_Control(pDX, IDREPLACE, m_repl); *************** *** 41,45 **** DDX_Control(pDX, IDC_COMBO3, m_replacecombo); DDX_Control(pDX, IDC_COMBO1, m_findcombo); ! //}}AFX_DATA_MAP } --- 42,46 ---- DDX_Control(pDX, IDC_COMBO3, m_replacecombo); DDX_Control(pDX, IDC_COMBO1, m_findcombo); ! //}}AFX_DATA_MAP } *************** *** 64,68 **** if (!strText.IsEmpty ()) { ! //SaveToRegistry(); m_scintilla->SetTargetStart(m_scintilla->GetCurrentPos()); m_scintilla->SetTargetEnd(m_scintilla->GetLength()); --- 65,69 ---- if (!strText.IsEmpty ()) { ! SaveToRegistry(); m_scintilla->SetTargetStart(m_scintilla->GetCurrentPos()); m_scintilla->SetTargetEnd(m_scintilla->GetLength()); *************** *** 100,109 **** { CDialog::OnInitDialog(); m_down.SetCheck(1); ! m_findcombo.SetFocus(); return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CFindReplace::OnReplace() { --- 101,202 ---- { CDialog::OnInitDialog(); + + char tempStr[1024]; + CStringArray tempArr; + CString comboStr = m_reg.GetProfileString(SEC_GREP,_T("FindCombo"),tempStr,""); + tempArr.RemoveAll(); + msc.ReturnDelimitedArray(comboStr,_T("|"),tempArr); + int y = tempArr.GetSize(); + + for(int i=0;i<y;i++) + { + m_findcombo.AddString(tempArr.GetAt(i)); + } + + comboStr = m_reg.GetProfileString(SEC_GREP,_T("ReplaceCombo"),tempStr,""); + tempArr.RemoveAll(); + msc.ReturnDelimitedArray(comboStr,_T("|"),tempArr); + y = tempArr.GetSize(); + + for(i=0;i<y;i++) + { + m_replacecombo.AddString(tempArr.GetAt(i)); + } + + comboStr = m_reg.GetProfileString(SEC_GREP,_T("LastFind"),tempStr,""); + m_findcombo.SetWindowText(comboStr); + + m_check1.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck1"),0 )); + m_check2.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck2"),0 )); + m_check3.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck3"),0 )); + m_check4.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck4"),0 )); + m_down.SetCheck(1); ! ! if(!inifind.IsEmpty()) ! { ! m_findcombo.SetWindowText(inifind); ! } ! ! DWORD dwSel; ! ! // Set the selection to be all characters after the current selection. ! if ((dwSel=m_findcombo.GetEditSel()) != CB_ERR) ! { ! m_findcombo.SetEditSel(HIWORD(dwSel), -1); ! } ! m_findcombo.SetFocus(); ! return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } + LPCSTR RemoveBackslash(LPCSTR str) + { + CString tstr = str; + CString retstr; + int tstr_len = tstr.GetLength(); + for(int i=0;i<tstr_len;i++) + { + if(tstr[i]=='\\') + { + if(i<tstr_len) + { + i++; + switch(tstr[i]) + { + case 'a': + retstr+='\a'; + break; + case 't': + retstr+='\t'; + break; + case 'b': + retstr+='\b'; + break; + case 'f': + retstr+='\f'; + break; + case 'n': + retstr+='\n'; + break; + case 'r': + retstr+='\r'; + break; + case 'v': + retstr+='\v'; + break; + + default: + retstr+='\\'; + retstr+=tstr[i]; + } + } + + }else retstr += tstr[i]; + } + return retstr; + } + void CFindReplace::OnReplace() { *************** *** 116,120 **** return; } ! m_scintilla->ReplaceSel(str); OnFindnext(); --- 209,225 ---- return; } ! ! if(m_check4.GetCheck()) ! { ! str = RemoveBackslash(str); ! } ! ! if(m_check3.GetCheck()) ! { ! m_scintilla->ReplaceTargetRE(str.GetLength(),str); ! }else m_scintilla->ReplaceTarget(str.GetLength(),str); ! ! if(m_replacecombo.FindStringExact(0,str)==CB_ERR) ! m_replacecombo.AddString(str); OnFindnext(); *************** *** 166,174 **** { if(m_findcombo.FindStringExact(0,strText)==CB_ERR) m_findcombo.AddString(strText); long stpos = m_scintilla->GetTargetStart(); long endpos = m_scintilla->GetTargetEnd(); m_scintilla->SetSel(stpos,endpos); ! m_scintilla->ReplaceSel(str); int tint = endpos - stpos; newpos+= tint -str.GetLength(); --- 271,295 ---- { if(m_findcombo.FindStringExact(0,strText)==CB_ERR) + { m_findcombo.AddString(strText); + SaveToRegistry(); + } long stpos = m_scintilla->GetTargetStart(); long endpos = m_scintilla->GetTargetEnd(); m_scintilla->SetSel(stpos,endpos); ! ! if(m_check4.GetCheck()) ! { ! str = RemoveBackslash(str); ! } ! ! ! if(m_check3.GetCheck()) ! { ! m_scintilla->ReplaceTargetRE(str.GetLength(),str); ! }else m_scintilla->ReplaceTarget(str.GetLength(),str); ! if(m_replacecombo.FindStringExact(0,str)==CB_ERR) ! m_replacecombo.AddString(str); ! int tint = endpos - stpos; newpos+= tint -str.GetLength(); *************** *** 187,189 **** --- 308,351 ---- OnReplaceall(); replaceinsel = FALSE; + } + + void CFindReplace::SaveToRegistry() + { + CString tempStr; + m_findcombo.GetWindowText(tempStr); + m_reg.WriteProfileString(SEC_GREP,_T("LastFind"),tempStr); + + tempStr.Empty(); + int y=m_findcombo.GetCount(); + if(y>11) + y=11; + CString lbStr; + for(int i=0;i<y;i++) + { + m_findcombo.GetLBText(i,lbStr); + tempStr+= lbStr+_T("|"); + } + + m_reg.WriteProfileString(SEC_GREP,_T("FindCombo"),tempStr); + + y=m_replacecombo.GetCount(); + if(y>11) + y=11; + lbStr.Empty(); + tempStr.Empty(); + for(int ii=0;ii<y;ii++) + { + m_findcombo.GetLBText(ii,lbStr); + tempStr+= lbStr+_T("|"); + } + + m_reg.WriteProfileString(SEC_GREP,_T("ReplaceCombo"),tempStr); + + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck1"),m_check1.GetCheck()); + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck2"),m_check2.GetCheck()); + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck3"),m_check3.GetCheck()); + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck4"),m_check4.GetCheck()); + + m_findcombo.GetWindowText(tempStr); + m_reg.WriteProfileString(SEC_GREP,_T("LastFind"),tempStr); } Index: FindReplace.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindReplace.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FindReplace.h 8 May 2003 12:00:56 -0000 1.3 --- FindReplace.h 18 Nov 2003 04:09:50 -0000 1.4 *************** *** 9,13 **** #include "scintillaif.h" ! ///////////////////////////////////////////////////////////////////////////// // CFindReplace dialog --- 9,14 ---- #include "scintillaif.h" ! #include "RegProfile.h" ! #include "Misc.h" ///////////////////////////////////////////////////////////////////////////// // CFindReplace dialog *************** *** 21,25 **** // Dialog Data //{{AFX_DATA(CFindReplace) ! enum { IDD = IDD_FIND_REPLACE }; CButton m_find; CButton m_repl; --- 22,27 ---- // Dialog Data //{{AFX_DATA(CFindReplace) ! enum { IDD = IDD_FIND_REPLACE }; ! CButton m_check4; CButton m_find; CButton m_repl; *************** *** 31,35 **** CComboBox m_replacecombo; CComboBox m_findcombo; ! //}}AFX_DATA --- 33,37 ---- CComboBox m_replacecombo; CComboBox m_findcombo; ! //}}AFX_DATA *************** *** 43,48 **** --- 45,54 ---- protected: CScintilla * m_scintilla; + CRegProfile m_reg; + CMisc msc; + CString inifind; // Implementation protected: + void SaveToRegistry(); // Generated message map functions Index: ToDo.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ToDo.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ToDo.txt 18 Jul 2003 04:18:13 -0000 1.17 --- ToDo.txt 18 Nov 2003 04:09:50 -0000 1.18 *************** *** 14,18 **** 2) A Very good plugin architecture... possibly with events and configurable menu items 3) Error handling facilities.. Marking errors, warnings and taking to a line on clicking error ! --- 14,18 ---- 2) A Very good plugin architecture... possibly with events and configurable menu items 3) Error handling facilities.. Marking errors, warnings and taking to a line on clicking error ! 4) Save find replace options and contents in registry. *************** *** 123,126 **** --- 123,139 ---- Bug Fixes ========= + + [ 799649 ] crash on lines > 2510 chars. During an enter after 2510 chars... + + [ 799171 ] file modif checking doesn't handle file deletion properly + When an opened file is deleted from outside AE, AE + notifies a change (whereas it should notify a deletion) + several times (whereas it should do it once only) + proposing to reload it (whereas it should propose to + close it) ! + + [ 798524 ] Auto indentation setting error + + - There is a problem with the "Auto Indentation Style" |