From: Leon W. <moo...@us...> - 2005-10-17 17:36:53
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6048 Modified Files: ScintillaEx.cpp ScintillaEx.h Log Message: Fixed bookmark handling, so Find->BookmarkAll works. Index: ScintillaEx.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ScintillaEx.cpp 16 Oct 2005 12:23:22 -0000 1.27 --- ScintillaEx.cpp 17 Oct 2005 17:36:45 -0000 1.28 *************** *** 50,53 **** --- 50,54 ---- m_bSaveConvertTabToSpaces = false; m_bSaveTrimTrailingSpaces = false; + m_iBookmarkCount = 0; m_lastPosCallTip = 0; m_Api = NULL; *************** *** 464,468 **** bool CScintillaEx::HasBookmarks(void) { ! return !dqBookmarks.empty(); } --- 465,469 ---- bool CScintillaEx::HasBookmarks(void) { ! return m_iBookmarkCount != 0; } *************** *** 473,504 **** { MarkerDelete( lLine, SC_BOOKMARK ); // Check if all the handles are still valid. - if( !dqBookmarks.empty() ) - { - std::deque<int>::iterator pos; - pos = dqBookmarks.begin(); - while( pos < dqBookmarks.end() ) - { - if( -1 == MarkerLineFromHandle( *pos ) ) - { - pos = dqBookmarks.erase( pos ); - } - else - { - ++ pos; - } - } - } } else { ! dqBookmarks.push_back( MarkerAdd( lLine, SC_BOOKMARK ) ); } } ! void CScintillaEx::ClearBookmarks() { ! MarkerDeleteAll( SC_BOOKMARK ); ! dqBookmarks.clear(); } --- 474,502 ---- { MarkerDelete( lLine, SC_BOOKMARK ); + m_iBookmarkCount --; // Check if all the handles are still valid. } else { ! m_iBookmarkCount ++; } } ! int CScintillaEx::MarkerAdd(int line, int markerNumber) { ! m_iBookmarkCount ++; ! return (int)SPerform(SCI_MARKERADD, (long)line, (long)markerNumber); ! } ! ! void CScintillaEx::MarkerDelete(int line, int markerNumber) ! { ! m_iBookmarkCount --; ! SPerform(SCI_MARKERDELETE, (long)line, (long)markerNumber); ! } ! ! void CScintillaEx::MarkerDeleteAll(int markerNumber) ! { ! m_iBookmarkCount = 0; ! SPerform(SCI_MARKERDELETEALL, (long)markerNumber, 0); } Index: ScintillaEx.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ScintillaEx.h 16 Oct 2005 12:23:23 -0000 1.19 --- ScintillaEx.h 17 Oct 2005 17:36:45 -0000 1.20 *************** *** 125,129 **** bool HasBookmarks(void); void ToggleBookmark(long lLine); ! void ClearBookmarks(void); void FirstBookmark(void); void LastBookmark(void); --- 125,140 ---- bool HasBookmarks(void); void ToggleBookmark(long lLine); ! /** ! * Add a marker to a line, returning an ID which can be used to find or delete the marker. ! */ ! int MarkerAdd(int line, int markerNumber); ! /** ! * Delete a marker from a line. ! */ ! void MarkerDelete(int line, int markerNumber); ! /** ! * Delete all markers with a particular number from all lines. ! */ ! void MarkerDeleteAll(int markerNumber); void FirstBookmark(void); void LastBookmark(void); *************** *** 201,206 **** CStringArray m_saBlockComment; ! /// The deque to store the bookmark handles ! std::deque<int> dqBookmarks; public: CString SelectionURL(int pos); --- 212,217 ---- CStringArray m_saBlockComment; ! /// Bookmark reference counter ! int m_iBookmarkCount; public: CString SelectionURL(int pos); |