From: <bl...@us...> - 2003-05-10 11:46:25
|
Update of /cvsroot/cpptool/rfta/src/rftavc6addin In directory sc8-pr-cvs1:/tmp/cvs-serv21742/src/rftavc6addin Modified Files: TextDocumentHelper.cpp TextDocumentHelper.h VCLineBasedTextDocument.cpp Log Message: *modified 'getSelectionRange' implementation making it more undo friendly. Index: TextDocumentHelper.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/TextDocumentHelper.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextDocumentHelper.cpp 9 Jan 2003 19:44:51 -0000 1.3 --- TextDocumentHelper.cpp 10 May 2003 11:46:22 -0000 1.4 *************** *** 52,53 **** --- 52,71 ---- return tabSize; } + + + bool + TextDocumentHelper::redo() const + { + VARIANT_BOOL success; + _document->Redo( &success ); + return success != 0; + } + + + bool + TextDocumentHelper::undo() const + { + VARIANT_BOOL success; + _document->Undo( &success ); + return success != 0; + } Index: TextDocumentHelper.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/TextDocumentHelper.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextDocumentHelper.h 9 Jan 2003 19:44:51 -0000 1.3 --- TextDocumentHelper.h 10 May 2003 11:46:22 -0000 1.4 *************** *** 30,33 **** --- 30,37 ---- int getTabSize() const; + bool undo() const; + + bool redo() const; + private: CComPtr<ITextDocument> _document; Index: VCLineBasedTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/VCLineBasedTextDocument.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VCLineBasedTextDocument.cpp 9 Jan 2003 19:44:51 -0000 1.4 --- VCLineBasedTextDocument.cpp 10 May 2003 11:46:22 -0000 1.5 *************** *** 68,72 **** helper_.selection().currentColumn() -1 ); ! helper_.selection().setText( text.c_str() ); selectionEnd = Location( selectionStart, text ); --- 68,76 ---- helper_.selection().currentColumn() -1 ); ! if ( !text.empty() ) ! { ! if ( !helper_.undo() ) ! helper_.selection().setText( text.c_str() ); ! } selectionEnd = Location( selectionStart, text ); |