You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(26) |
Mar
(97) |
Apr
(224) |
May
(226) |
Jun
|
Jul
(3) |
Aug
(22) |
Sep
(48) |
Oct
|
Nov
|
Dec
(38) |
2004 |
Jan
(28) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(37) |
Jul
|
Aug
(73) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <bl...@us...> - 2003-05-25 18:04:18
|
Update of /cvsroot/cpptool/rfta/bin In directory sc8-pr-cvs1:/tmp/cvs-serv6642/bin Modified Files: lister.py Log Message: * quoted the filenames when passing them to astdump. Index: lister.py =================================================================== RCS file: /cvsroot/cpptool/rfta/bin/lister.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lister.py 25 May 2003 17:16:48 -0000 1.5 --- lister.py 25 May 2003 18:04:15 -0000 1.6 *************** *** 163,167 **** print "Generating AST for ", source_path, " in ", output_path, Path(output_path).ensure_dir_exists() ! exit_code = os.spawnl( os.P_WAIT, "astdump", "astdump", source_path, output_path ) status = self.convertParseExitCode(exit_code) self.parse_result[ source_path ] = ParseResult( status, source_path, output_path ) --- 163,167 ---- print "Generating AST for ", source_path, " in ", output_path, Path(output_path).ensure_dir_exists() ! exit_code = os.spawnl( os.P_WAIT, "astdump", "astdump", '"'+source_path+'"', '"'+output_path+'"' ) status = self.convertParseExitCode(exit_code) self.parse_result[ source_path ] = ParseResult( status, source_path, output_path ) |
From: <bl...@us...> - 2003-05-25 17:27:44
|
Update of /cvsroot/cpptool/rfta/bug In directory sc8-pr-cvs1:/tmp/cvs-serv26685/bug Modified Files: List.txt Log Message: * added some bugs to the list Index: List.txt =================================================================== RCS file: /cvsroot/cpptool/rfta/bug/List.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** List.txt 16 May 2003 10:01:46 -0000 1.10 --- List.txt 25 May 2003 17:27:40 -0000 1.11 *************** *** 83,84 **** --- 83,194 ---- => range extends to the end of the compound statement --- + Bad struct parsing: ogre/ogremain/include/ogredynlib.h.html#AST + struct HINSTANCE__; + typedef struct HINSTANCE__* hInstance; + => in parser Parser::readUntilNextOf + (short context: "typedef struct HINSTANCE__* hInstance; ") + --- + Failed to parse enumeration: ogre/ogremain/include/ogreroot.h.html + enum ResourceType + { + /// All resource types + RESTYPE_ALL, + /// Textures + RESTYPE_TEXTURES, + /// Models + RESTYPE_MODELS, + + }; + => probably the trailing comma. + --- + Failed to parser __asm keyword: ogre/ogremain/include/asm_math.h.html + __asm + { + mov eax, 0be6eb508h + mov dword ptr[esp-12],03fc00000h + sub eax, dword ptr[esp + 4] + sub dword ptr[esp+4], 800000h + ... + } + => add skip rules for this keyword. + --- + Failed to parser operator implementation: ogre/ogremain/src/ogreanimationstate.cpp.html + bool AnimationState::operator==(const AnimationState& rhs) const + { ... } + in parser Parser::readUntilNextSemiColonSkippingOverCurlyBraces + (short context: "bool AnimationState::operator==(const AnimationS") + in parser DeclarationParser::parseCommonDeclaration + (short context: "bool AnimationState::operator==(const AnimationS") + in parser DeclarationParser::parse + (short context: "bool AnimationState::operator==(const AnimationS") + --- + Using symbol not supported: ravl-0.7\core\base\assert.cc.html + using std::cerr; + => in parser Parser::expectKeyword + (short context: "using std::cerr; static bool ") + in parser UsingNamespaceParser::parse + (short context: "using std::cerr; static bool ") + --- + Failed to parse complex constructor declaration: ravl-0.7/core/base/callmethodrefs.hh.html + CallMethodRef1C(ObjT &nobj,RetT (ObjT::*nfunc)(DataT &), const DataT &dat = DataT()) + : CallFunc1C<DataT,RetT>(*new CallMethodRef1BodyC<ObjT,DataT,RetT>(nobj,nfunc,dat)) + {} + => in parser Parser::readUntilNextSemiColonSkippingOverCurlyBraces + (short context: "CallMethodRef1C(ObjT &nobj,RetT (ObjT::*nfunc)(D") + in parser DeclarationParser::parseCommonDeclaration + (short context: "CallMethodRef1C(ObjT &nobj,RetT (ObjT::*nfunc)(D") + --- + + Failed to parse inline function declaration: ravl-0.7/core/base/deepcopy.hh.html + inline + IntT StdDeepCopy(const IntT &val,UIntT levels = ((UIntT) -1)) { + return val; + } + => in parser Parser::readUntilNextSemiColonSkippingOverCurlyBraces + (short context: "inline IntT StdDeepCopy(const IntT &val,UIntT ") + in parser DeclarationParser::parseCommonDeclaration + (short context: "inline IntT StdDeepCopy(const IntT &val,UIntT ") + --- + Failed to parse operator = method declaration: ravl-0.7/core/base/empty.hh.html + EmptyC operator=(const EmptyC &) + { return EmptyC(); } + => in parser Parser::readUntilNextSemiColonSkippingOverCurlyBraces + (short context: "EmptyC operator=(const EmptyC &) { return ") + in parser DeclarationParser::parseCommonDeclaration + (short context: "EmptyC operator=(const EmptyC &) { return ") + --- + Failed to parse friend function declaration: ravl-0.7/core/base/rchandlev.hh.htm + friend istream &operator>> <BodyT>(istream &strm,RCHandleVC<BodyT> &obj); + => in parser Parser::expect + (short context: "friend istream &operator>> <BodyT>(istream &strm") + in parser DeclarationDetailsParser::parseDeclarators + (short context: "friend istream &operator>> <BodyT>(istream &strm") + --- + Failed to parse virtual function with implementation: ravl-0.7/core/base/fdstreambuf.hh.html + virtual int_type overflow(int_type c = traits_type::eof()) { + //cerr << "basic_fdbuf::overflow() Called. Ptrs:" << (void *) pbase() << " " << (void *) pptr() << " " << (void *) epptr() << "\n"; + sync(); + if(c != traits_type::eof()) + (*(_M_out_cur++)) = c; + return c; + } + => in parser Parser::readUntilNextSemiColonSkippingOverCurlyBraces + (short context: "virtual int_type overflow(int_type c = traits_ty") + in parser DeclarationParser::parseCommonDeclaration + (short context: "virtual int_type overflow(int_type c = traits_ty") + --- + Failed to parse forward template declaration: ravl-0.7/core/base/testcalls.cc.html + template class CallFunc0C<int>; + --- + Failed to parse template operator += implementation: ravl-0.7/core/container/array/array3d.hh.html + + template<class DataT> + const Array3dC<DataT> & Array3dC<DataT>::operator+=(const Array3dC<DataT> & arr) { + for(BufferAccess3dIter2C<DataT,DataT> it(*this,Range2(),Range3(), + arr,arr.Range2(),arr.Range3());it;it++) + it.Data1() += it.Data2(); + return *this; + } + --- + + |
From: <bl...@us...> - 2003-05-25 17:16:51
|
Update of /cvsroot/cpptool/rfta/bin In directory sc8-pr-cvs1:/tmp/cvs-serv23097/bin Modified Files: lister.py Log Message: * added filtering, only c/c++ source files are 'astdumped'. Index: lister.py =================================================================== RCS file: /cvsroot/cpptool/rfta/bin/lister.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lister.py 4 May 2003 06:54:33 -0000 1.4 --- lister.py 25 May 2003 17:16:48 -0000 1.5 *************** *** 46,49 **** --- 46,52 ---- os.makedirs( directory ) + def extension( self ): + return os.path.splitext( self )[1] + class Tag: def __init__( self, name, content = None ): *************** *** 225,228 **** --- 228,235 ---- + def isSourceFile( path ): + ext = Path( path ).extension() + return ext in [ '.cpp', '.c', '.h', '.hpp', '.cc', '.CC', '.Cpp', '.hh', '.cxx'] + def listFilesIgnoreCVSDir( generator, dirName, fileNames ): if ( fileNames.count( 'CVS' ) > 0 ): *************** *** 230,234 **** for file in fileNames: file_path = os.path.join( dirName, file ) ! if os.path.isfile( file_path ): generator.generate( file_path ) --- 237,241 ---- for file in fileNames: file_path = os.path.join( dirName, file ) ! if os.path.isfile( file_path ) and isSourceFile( file_path ): generator.generate( file_path ) |
From: <bl...@us...> - 2003-05-25 07:50:04
|
Update of /cvsroot/cpptool/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv9557 Modified Files: AUTHORS Log Message: * added Andre Baresel to the list of the AUTHORS Index: AUTHORS =================================================================== RCS file: /cvsroot/cpptool/rfta/AUTHORS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AUTHORS 25 Oct 2002 15:43:21 -0000 1.2 --- AUTHORS 25 May 2003 07:49:59 -0000 1.3 *************** *** 1,2 **** ! Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/ ! Sven Reichard <rei...@ma...> (Linux port) --- 1 ---- ! Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/Sven Reichard <rei...@ma...> (Linux port)Andre Baresel \ No newline at end of file |
From: <bl...@us...> - 2003-05-19 21:43:39
|
Update of /cvsroot/cpptool/rfta/doc/images In directory sc8-pr-cvs1:/tmp/cvs-serv2270/images Added Files: vc7-menu.gif vc7-toolbar.gif vc7-undo-combobox.gif Log Message: * adding some docs for vc7 add-in --- NEW FILE: vc7-menu.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vc7-toolbar.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vc7-undo-combobox.gif --- (This appears to be a binary file; contents omitted.) |
From: <bl...@us...> - 2003-05-19 21:43:38
|
Update of /cvsroot/cpptool/rfta/doc In directory sc8-pr-cvs1:/tmp/cvs-serv2270 Added Files: rfta_screenshots.html Log Message: * adding some docs for vc7 add-in --- NEW FILE: rfta_screenshots.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>C++ Refactoring Assistant screen shots</title> </head> <body> C++ Refactoring Assistant Visual Studio .NET 2002 user interface<br> <br> The refactoring actions can be accessed either from the menu:<br> <img src="images/vc7-menu.gif" title="" alt="vc7 menu" style="width: 543px; height: 123px;"><br> <br> or from the toolbar:<br> <br> <img src="file:///C:/prg/vc/Rfta/doc/images/vc7-toolbar.gif" title="" alt="VC7 toolbar" style="width: 90px; height: 26px;"><br> <br> There are no predefined keyboard binding at the time, but you can easily add them using the Tools/Customize... menu (commands begins with 'RFTA'). All refactorings can be undo in a single undo step like any commands:<br> <br> <img src="images/vc7-undo-combobox.gif" title="" alt="" style="width: 223px; height: 125px;"><br> <br> <br> Rename Locale Variable Refactoring<br> <br> <br> </body> </html> |
From: <bl...@us...> - 2003-05-19 21:42:38
|
Update of /cvsroot/cpptool/rfta/doc/images In directory sc8-pr-cvs1:/tmp/cvs-serv1321/images Log Message: Directory /cvsroot/cpptool/rfta/doc/images added to the repository |
From: <bl...@us...> - 2003-05-18 18:32:42
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin In directory sc8-pr-cvs1:/tmp/cvs-serv10170/src/rftavc7addin Modified Files: Connect.cpp Connect.h Log Message: * changed menu name * renamed command bar creation method Index: Connect.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/Connect.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Connect.cpp 18 May 2003 09:19:10 -0000 1.8 --- Connect.cpp 18 May 2003 18:32:38 -0000 1.9 *************** *** 51,56 **** AFX_MANAGE_STATE(AfxGetStaticModuleState()); - _asm int 3; // comment this out to force an assertion when loading the add-in. - HRESULT hr = S_OK; pApplication->QueryInterface(__uuidof(EnvDTE::_DTE), (LPVOID*)&m_pDTE); --- 51,54 ---- *************** *** 59,62 **** --- 57,62 ---- return S_OK; + // _asm int 3; // comment this out to force an assertion when loading the add-in. + try { *************** *** 100,110 **** IDB_REDUCELOCALEVARIABLESCOPE ); */ ! CComPtr<Office::CommandBar> pToolBar = ensureToolBarExist( *pCommands, ! L"C++ Refactoring Assistant", ! EnvDTE::vsCommandBarTypeToolbar ); ! CComPtr<Office::CommandBar> pMenuBar = ensureToolBarExist( *pCommands, ! L"Refactoring", ! EnvDTE::vsCommandBarTypeMenu ); int index = 1; --- 100,110 ---- IDB_REDUCELOCALEVARIABLESCOPE ); */ ! CComPtr<Office::CommandBar> pToolBar = ensureCommandBarExist( *pCommands, ! L"C++ Refactoring Assistant", ! EnvDTE::vsCommandBarTypeToolbar ); ! CComPtr<Office::CommandBar> pMenuBar = ensureCommandBarExist( *pCommands, ! L"C++ Refactoring", ! EnvDTE::vsCommandBarTypeMenu ); int index = 1; *************** *** 149,162 **** CComPtr<Office::CommandBar> ! CConnect::ensureToolBarExist( EnvDTE::Commands &commands, const CComBSTR &toolBarName, EnvDTE::vsCommandBarType commandBarType ) { ! CComQIPtr<Office::CommandBar> pToolbar; CComPtr<Office::_CommandBars> pCommandBars; VERIFY_COM( m_pDTE->get_CommandBars( &pCommandBars ) ); ! HRESULT hr = pCommandBars->get_Item( CComVariant( toolBarName ), &pToolbar ); if ( SUCCEEDED(hr) ) // the toolbar already exist, make it visible ! pToolbar->put_Visible(VARIANT_TRUE); else // the toolbar has not been created yet { --- 149,162 ---- CComPtr<Office::CommandBar> ! CConnect::ensureCommandBarExist( EnvDTE::Commands &commands, const CComBSTR &toolBarName, EnvDTE::vsCommandBarType commandBarType ) { ! CComQIPtr<Office::CommandBar> pCommandBar; CComPtr<Office::_CommandBars> pCommandBars; VERIFY_COM( m_pDTE->get_CommandBars( &pCommandBars ) ); ! HRESULT hr = pCommandBars->get_Item( CComVariant( toolBarName ), &pCommandBar ); if ( SUCCEEDED(hr) ) // the toolbar already exist, make it visible ! pCommandBar->put_Visible(VARIANT_TRUE); else // the toolbar has not been created yet { *************** *** 171,181 **** 4, &pDisp ) ); ! pToolbar = pDisp; // returned object is not a Office::CommandBar ! if ( pToolbar == NULL ) throw IDTCallError( E_FAIL ); ! pToolbar->put_Visible(VARIANT_TRUE); } ! return pToolbar; } --- 171,181 ---- 4, &pDisp ) ); ! pCommandBar = pDisp; // returned object is not a Office::CommandBar ! if ( pCommandBar == NULL ) throw IDTCallError( E_FAIL ); ! pCommandBar->put_Visible(VARIANT_TRUE); } ! return pCommandBar; } Index: Connect.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/Connect.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Connect.h 14 May 2003 18:55:50 -0000 1.3 --- Connect.h 18 May 2003 18:32:39 -0000 1.4 *************** *** 82,88 **** int commandBitmapID ); ! CComPtr<Office::CommandBar> ensureToolBarExist( EnvDTE::Commands &commands, ! const CComBSTR &toolBarName, ! EnvDTE::vsCommandBarType commandBarType ); void associateCommand( const CComPtr<EnvDTE::Command> &pCommand, --- 82,88 ---- int commandBitmapID ); ! CComPtr<Office::CommandBar> ensureCommandBarExist( EnvDTE::Commands &commands, ! const CComBSTR &toolBarName, ! EnvDTE::vsCommandBarType commandBarType ); void associateCommand( const CComPtr<EnvDTE::Command> &pCommand, |
From: <bl...@us...> - 2003-05-18 09:19:13
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin/exploration In directory sc8-pr-cvs1:/tmp/cvs-serv15790/src/rftavc7addin/exploration Modified Files: MacroTest.cpp Log Message: * added error check on all COM call,with error detail message in debug build. Index: MacroTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/exploration/MacroTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MacroTest.cpp 11 May 2003 17:53:10 -0000 1.1 --- MacroTest.cpp 18 May 2003 09:19:10 -0000 1.2 *************** *** 1,2 **** --- 1,10 ---- + void do() + { + int x; + + x = 123; + + } + 0123456789 abcdefghij |
From: <bl...@us...> - 2003-05-18 09:19:13
|
Update of /cvsroot/cpptool/rfta/src/rftavc6addin In directory sc8-pr-cvs1:/tmp/cvs-serv15790/src/rftavc6addin Modified Files: Commands.cpp Log Message: * added error check on all COM call,with error detail message in debug build. Index: Commands.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/Commands.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Commands.cpp 30 Dec 2002 10:43:26 -0000 1.5 --- Commands.cpp 18 May 2003 09:19:10 -0000 1.6 *************** *** 251,255 **** STDMETHODIMP CCommands::RftaSplitLocaleVariable() { ! AFX_MANAGE_STATE(AfxGetStaticModuleState()) TextDocumentHelper documentHelper = ApplicationHelper::activeTextDocument(); --- 251,255 ---- STDMETHODIMP CCommands::RftaSplitLocaleVariable() { ! AFX_MANAGE_STATE(AfxGetStaticModuleState()); TextDocumentHelper documentHelper = ApplicationHelper::activeTextDocument(); |
Update of /cvsroot/cpptool/rfta/src/rftavc7addin In directory sc8-pr-cvs1:/tmp/cvs-serv15790/src/rftavc7addin Modified Files: CommandGroup.cpp CommandGroup.h Connect.cpp stdafx.h TextDocumentHelper.cpp TextSelectionHelper.cpp VC7TextDocument.cpp Log Message: * added error check on all COM call,with error detail message in debug build. Index: CommandGroup.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/CommandGroup.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CommandGroup.cpp 15 May 2003 07:31:43 -0000 1.1 --- CommandGroup.cpp 18 May 2003 09:19:10 -0000 1.2 *************** *** 4,15 **** CommandGroup::CommandGroup( const CString &commandName, CComPtr<EnvDTE::_DTE> application ) { ! application->get_UndoContext( &undoContext_ ); VARIANT_BOOL wasOpen; ! undoContext_->get_IsOpen( &wasOpen ); wasOpen_ = wasOpen != 0; if ( !wasOpen_ ) ! undoContext_->Open( CComBSTR( commandName ), VARIANT_FALSE ); } --- 4,16 ---- CommandGroup::CommandGroup( const CString &commandName, CComPtr<EnvDTE::_DTE> application ) + : validated_( false ) { ! VERIFY_COM( application->get_UndoContext( &undoContext_ ) ); VARIANT_BOOL wasOpen; ! VERIFY_COM( undoContext_->get_IsOpen( &wasOpen ) ); wasOpen_ = wasOpen != 0; if ( !wasOpen_ ) ! VERIFY_COM( undoContext_->Open( CComBSTR( commandName ), VARIANT_FALSE ) ); } *************** *** 17,21 **** CommandGroup::~CommandGroup() { ! cancel(); } --- 18,23 ---- CommandGroup::~CommandGroup() { ! if ( !validated_ ) ! cancel(); } *************** *** 24,29 **** CommandGroup::validate() { if ( !wasOpen_ ) ! undoContext_->Close(); wasOpen_ = false; } --- 26,33 ---- CommandGroup::validate() { + validated_ = true; + if ( !wasOpen_ ) ! VERIFY_COM( undoContext_->Close() ); wasOpen_ = false; } *************** *** 33,36 **** CommandGroup::cancel() { ! undoContext_->SetAborted(); } --- 37,40 ---- CommandGroup::cancel() { ! VERIFY_COM( undoContext_->SetAborted() ); } Index: CommandGroup.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/CommandGroup.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CommandGroup.h 15 May 2003 07:31:43 -0000 1.1 --- CommandGroup.h 18 May 2003 09:19:10 -0000 1.2 *************** *** 16,19 **** --- 16,20 ---- CComPtr<EnvDTE::UndoContext> undoContext_; bool wasOpen_; + bool validated_; }; Index: Connect.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/Connect.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Connect.cpp 15 May 2003 19:14:12 -0000 1.7 --- Connect.cpp 18 May 2003 09:19:10 -0000 1.8 *************** *** 24,73 **** // by right clicking the project in the Solution Explorer, then choosing install. - #include <stdexcept> - - class IDTCallError : public std::runtime_error - { - public: - IDTCallError( HRESULT hr ) - : std::runtime_error( "IDT call failed" ) - , hresult_( hr ) - { - } ! HRESULT hresult_; ! }; ! ! ! /* ! ! ! void GetLastErrorDescription(CComBSTR& bstr) { CComPtr<IErrorInfo> pErrorInfo; ! if (GetErrorInfo(0, &pErrorInfo) == S_OK) ! pErrorInfo->GetDescription(&bstr); ! } ! ! #define VERIFY_OK(f) \ ! { \ ! HRESULT hr = (f); \ ! if (hr != S_OK) \ ! { \ ! if (FAILED(hr)) \ ! { \ ! CComBSTR bstr; \ ! GetLastErrorDescription(bstr); \ ! _RPTF2(_CRT_ASSERT, "Object call returned %lx\n\n%S", hr, (BSTR) bstr); \ ! } \ ! else \ ! _RPTF1(_CRT_ASSERT, "Object call returned %lx", hr); \ ! } \ ! } ! */ ! ! inline void checkIDTCall( HRESULT hresult ) ! { ! if ( !SUCCEEDED( hresult ) ) ! throw IDTCallError( hresult ); } --- 24,35 ---- // by right clicking the project in the Solution Explorer, then choosing install. ! CComBSTR GetLastCOMErrorDescription() { + CComBSTR decription; CComPtr<IErrorInfo> pErrorInfo; ! if ( GetErrorInfo(0, &pErrorInfo) == S_OK ) ! pErrorInfo->GetDescription( &decription ); ! return decription; } *************** *** 81,85 **** HRESULT hr = commands.Item( CComVariant( fullCommandName ), 0, &pExistingCommand ); if ( SUCCEEDED(hr) && pExistingCommand ) ! pExistingCommand->Delete(); } --- 43,47 ---- HRESULT hr = commands.Item( CComVariant( fullCommandName ), 0, &pExistingCommand ); if ( SUCCEEDED(hr) && pExistingCommand ) ! VERIFY_COM( pExistingCommand->Delete() ); } *************** *** 89,98 **** AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! // _asm int 3; // comment this out to force an assertion when loading the add-in. HRESULT hr = S_OK; pApplication->QueryInterface(__uuidof(EnvDTE::_DTE), (LPVOID*)&m_pDTE); pAddInInst->QueryInterface(__uuidof(EnvDTE::AddIn), (LPVOID*)&m_pAddInInstance); ! if(ConnectMode != 5) //5 == AddInDesignerObjects::ext_cm_UISetup) return S_OK; --- 51,60 ---- AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! _asm int 3; // comment this out to force an assertion when loading the add-in. HRESULT hr = S_OK; pApplication->QueryInterface(__uuidof(EnvDTE::_DTE), (LPVOID*)&m_pDTE); pAddInInst->QueryInterface(__uuidof(EnvDTE::AddIn), (LPVOID*)&m_pAddInInstance); ! if( ConnectMode != 5 ) //5 == AddInDesignerObjects::ext_cm_UISetup) return S_OK; *************** *** 101,105 **** CComPtr<EnvDTE::Commands> pCommands; CComPtr<EnvDTE::Command> pCreatedCommand; ! checkIDTCall( m_pDTE->get_Commands( &pCommands ) ); // Removes existing command (so we can add some as the add-in is updated). --- 63,67 ---- CComPtr<EnvDTE::Commands> pCommands; CComPtr<EnvDTE::Command> pCreatedCommand; ! VERIFY_COM( m_pDTE->get_Commands( &pCommands ) ); // Removes existing command (so we can add some as the add-in is updated). *************** *** 173,185 **** { CComPtr<EnvDTE::Command> pCreatedCommand; ! checkIDTCall( commands.AddNamedCommand( m_pAddInInstance, ! commandName, ! commandButtonText, ! commandToolTip, ! VARIANT_FALSE, ! commandBitmapID, ! NULL, ! EnvDTE::vsCommandStatusSupported + EnvDTE::vsCommandStatusEnabled, ! &pCreatedCommand ) ); return pCreatedCommand; } --- 135,147 ---- { CComPtr<EnvDTE::Command> pCreatedCommand; ! VERIFY_COM( commands.AddNamedCommand( m_pAddInInstance, ! commandName, ! commandButtonText, ! commandToolTip, ! VARIANT_FALSE, ! commandBitmapID, ! NULL, ! EnvDTE::vsCommandStatusSupported + EnvDTE::vsCommandStatusEnabled, ! &pCreatedCommand ) ); return pCreatedCommand; } *************** *** 193,197 **** CComQIPtr<Office::CommandBar> pToolbar; CComPtr<Office::_CommandBars> pCommandBars; ! checkIDTCall( m_pDTE->get_CommandBars( &pCommandBars ) ); HRESULT hr = pCommandBars->get_Item( CComVariant( toolBarName ), &pToolbar ); if ( SUCCEEDED(hr) ) // the toolbar already exist, make it visible --- 155,159 ---- CComQIPtr<Office::CommandBar> pToolbar; CComPtr<Office::_CommandBars> pCommandBars; ! VERIFY_COM( m_pDTE->get_CommandBars( &pCommandBars ) ); HRESULT hr = pCommandBars->get_Item( CComVariant( toolBarName ), &pToolbar ); if ( SUCCEEDED(hr) ) // the toolbar already exist, make it visible *************** *** 201,208 **** CComPtr<Office::CommandBar> pMenubar; if ( commandBarType == EnvDTE::vsCommandBarTypeMenu ) // get top level menu bar ! checkIDTCall( pCommandBars->get_Item( CComVariant( "MenuBar" ), &pMenubar ) ); CComPtr<IDispatch> pDisp; ! checkIDTCall( commands.AddCommandBar( (LPWSTR)toolBarName, commandBarType, pMenubar, --- 163,170 ---- CComPtr<Office::CommandBar> pMenubar; if ( commandBarType == EnvDTE::vsCommandBarTypeMenu ) // get top level menu bar ! VERIFY_COM( pCommandBars->get_Item( CComVariant( "MenuBar" ), &pMenubar ) ); CComPtr<IDispatch> pDisp; ! VERIFY_COM( commands.AddCommandBar( (LPWSTR)toolBarName, commandBarType, pMenubar, *************** *** 232,236 **** CComQIPtr<Office::_CommandBarButton> pButton( pCommandBarControl ); if ( pButton ) ! pButton->put_Style( Office::msoButtonIcon ); } } --- 194,198 ---- CComQIPtr<Office::_CommandBarButton> pButton( pCommandBarControl ); if ( pButton ) ! VERIFY_COM( pButton->put_Style( Office::msoButtonIcon ) ); } } *************** *** 238,242 **** { CComPtr<Office::CommandBarControl> pCommandBarControl; ! pCommand->AddControl( pMenuBar, index, &pCommandBarControl ); } } --- 200,204 ---- { CComPtr<Office::CommandBarControl> pCommandBarControl; ! VERIFY_COM( pCommand->AddControl( pMenuBar, index, &pCommandBarControl ) ); } } *************** *** 306,315 **** CComPtr<EnvDTE::Document> activeDocument; ! m_pDTE->get_ActiveDocument( &activeDocument ); if ( !activeDocument ) return S_OK; CComPtr<IDispatch> textDocumentBase; ! activeDocument->Object( CComBSTR(L"TextDocument"), &textDocumentBase ); CComQIPtr<EnvDTE::TextDocument> textDocument = textDocumentBase; if ( !textDocument ) --- 268,277 ---- CComPtr<EnvDTE::Document> activeDocument; ! VERIFY_COM( m_pDTE->get_ActiveDocument( &activeDocument ) ); if ( !activeDocument ) return S_OK; CComPtr<IDispatch> textDocumentBase; ! VERIFY_COM( activeDocument->Object( CComBSTR(L"TextDocument"), &textDocumentBase ) ); CComQIPtr<EnvDTE::TextDocument> textDocument = textDocumentBase; if ( !textDocument ) *************** *** 317,321 **** CComPtr<EnvDTE::TextSelection> selection; ! textDocument->get_Selection( &selection ); TextSelectionHelper selectionHelper( selection ); int selectionStart = selectionHelper.selectionStartCharOffset(); --- 279,283 ---- CComPtr<EnvDTE::TextSelection> selection; ! VERIFY_COM( textDocument->get_Selection( &selection ) ); TextSelectionHelper selectionHelper( selection ); int selectionStart = selectionHelper.selectionStartCharOffset(); Index: stdafx.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/stdafx.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stdafx.h 14 May 2003 18:55:50 -0000 1.3 --- stdafx.h 18 May 2003 09:19:10 -0000 1.4 *************** *** 96,98 **** }; ! extern CAddInModule _AtlModule; \ No newline at end of file --- 96,142 ---- }; ! extern CAddInModule _AtlModule; ! ! ! ! // Will need to clean this... ! #include <stdexcept> ! ! class IDTCallError : public std::runtime_error ! { ! public: ! IDTCallError( HRESULT hr ) ! : std::runtime_error( "IDT call failed" ) ! , hresult_( hr ) ! { ! } ! ! HRESULT hresult_; ! }; ! ! inline void checkIDTCall( HRESULT hresult ) ! { ! if ( !SUCCEEDED( hresult ) ) ! throw IDTCallError( hresult ); ! } ! ! CComBSTR GetLastCOMErrorDescription(); ! ! #ifdef NDEBUG ! # define VERIFY_COM( expression ) \ ! checkIDTCall( expression ); ! #else ! # define VERIFY_COM( expression ) \ ! { \ ! HRESULT hr = (expression); \ ! if ( FAILED(hr) ) \ ! { \ ! CComBSTR decription = GetLastCOMErrorDescription(); \ ! _RPTF3( _CRT_ASSERT, \ ! "COM call returned %lx\nExpression: %s\n%S", \ ! hr, \ ! #expression, \ ! (BSTR)decription ); \ ! } \ ! } ! #endif Index: TextDocumentHelper.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/TextDocumentHelper.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextDocumentHelper.cpp 15 May 2003 19:29:33 -0000 1.2 --- TextDocumentHelper.cpp 18 May 2003 09:19:10 -0000 1.3 *************** *** 31,35 **** { CComPtr<EnvDTE::TextSelection> selectionInterface; ! _document->get_Selection( &selectionInterface ); return TextSelectionHelper( selectionInterface ); } --- 31,35 ---- { CComPtr<EnvDTE::TextSelection> selectionInterface; ! VERIFY_COM( _document->get_Selection( &selectionInterface ) ); return TextSelectionHelper( selectionInterface ); } *************** *** 40,44 **** { long tabSize; ! _document->get_TabSize( &tabSize ); return tabSize; } --- 40,44 ---- { long tabSize; ! VERIFY_COM( _document->get_TabSize( &tabSize ) ); return tabSize; } Index: TextSelectionHelper.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/TextSelectionHelper.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextSelectionHelper.cpp 15 May 2003 19:29:33 -0000 1.2 --- TextSelectionHelper.cpp 18 May 2003 09:19:10 -0000 1.3 *************** *** 31,38 **** { CComPtr<EnvDTE::VirtualPoint> point; ! _selection->get_TopPoint( &point ); long startIndex = -1; ! point->get_AbsoluteCharOffset( &startIndex ); return startIndex -1; } --- 31,38 ---- { CComPtr<EnvDTE::VirtualPoint> point; ! VERIFY_COM( _selection->get_TopPoint( &point ) ); long startIndex = -1; ! VERIFY_COM( point->get_AbsoluteCharOffset( &startIndex ) ); return startIndex -1; } *************** *** 43,52 **** { CComPtr<EnvDTE::VirtualPoint> point; ! _selection->get_BottomPoint( &point ); long endIndex = -1; ! point->get_AbsoluteCharOffset( &endIndex ); return endIndex -1; } - - --- 43,50 ---- { CComPtr<EnvDTE::VirtualPoint> point; ! VERIFY_COM( _selection->get_BottomPoint( &point ) ); long endIndex = -1; ! VERIFY_COM( point->get_AbsoluteCharOffset( &endIndex ) ); return endIndex -1; } Index: VC7TextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/VC7TextDocument.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VC7TextDocument.cpp 16 May 2003 21:13:56 -0000 1.4 --- VC7TextDocument.cpp 18 May 2003 09:19:10 -0000 1.5 *************** *** 19,31 **** { CComPtr<EnvDTE::TextPoint> startPoint; ! document_->get_StartPoint( &startPoint ); CComPtr<EnvDTE::TextPoint> endPoint; ! document_->get_EndPoint( &endPoint ); CComPtr<EnvDTE::EditPoint> editPoint; ! startPoint->CreateEditPoint( &editPoint ); CComBSTR text; ! editPoint->GetText( CComVariant( &*endPoint), &text ); CString ctext( text ); --- 19,31 ---- { CComPtr<EnvDTE::TextPoint> startPoint; ! VERIFY_COM( document_->get_StartPoint( &startPoint ) ); CComPtr<EnvDTE::TextPoint> endPoint; ! VERIFY_COM( document_->get_EndPoint( &endPoint ) ); CComPtr<EnvDTE::EditPoint> editPoint; ! VERIFY_COM( startPoint->CreateEditPoint( &editPoint ) ); CComBSTR text; ! VERIFY_COM( editPoint->GetText( CComVariant( &*endPoint), &text ) ); CString ctext( text ); *************** *** 40,44 **** CComBSTR text; ! startPoint_->GetText( CComVariant( &*endPoint_), &text ); CString ctext( text ); --- 40,44 ---- CComBSTR text; ! VERIFY_COM( startPoint_->GetText( CComVariant( &*endPoint_), &text ) ); CString ctext( text ); *************** *** 51,58 **** const std::string &text ) { ! setEditedRange( range ); ! startPoint_->Delete( CComVariant( &*endPoint_) ); ! startPoint_->Insert( CComBSTR( text.c_str() ) ); } --- 51,58 ---- const std::string &text ) { ! setEditedRange( range ); ! VERIFY_COM( startPoint_->Delete( CComVariant( &*endPoint_) ) ); ! VERIFY_COM( startPoint_->Insert( CComBSTR( text.c_str() ) ) ); } *************** *** 64,74 **** { CComPtr<EnvDTE::TextPoint> textPoint; ! document_->get_StartPoint( &textPoint ); ! textPoint->CreateEditPoint( &startPoint_ ); ! textPoint->CreateEditPoint( &endPoint_ ); } ! startPoint_->MoveToAbsoluteOffset( selection.getStartIndex()+1 ); ! endPoint_->MoveToAbsoluteOffset( selection.getEndIndex()+1 ); } --- 64,74 ---- { CComPtr<EnvDTE::TextPoint> textPoint; ! VERIFY_COM( document_->get_StartPoint( &textPoint ) ); ! VERIFY_COM( textPoint->CreateEditPoint( &startPoint_ ) ); ! VERIFY_COM( textPoint->CreateEditPoint( &endPoint_ ) ); } ! VERIFY_COM( startPoint_->MoveToAbsoluteOffset( selection.getStartIndex()+1 ) ); ! VERIFY_COM( endPoint_->MoveToAbsoluteOffset( selection.getEndIndex()+1 ) ); } |
From: <bl...@us...> - 2003-05-16 21:13:59
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin In directory sc8-pr-cvs1:/tmp/cvs-serv2227/src/rftavc7addin Modified Files: VC7TextDocument.cpp VC7TextDocument.h Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: VC7TextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/VC7TextDocument.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VC7TextDocument.cpp 15 May 2003 07:06:46 -0000 1.3 --- VC7TextDocument.cpp 16 May 2003 21:13:56 -0000 1.4 *************** *** 34,42 **** ! const std::string ! VC7TextDocument::getSelection() const { ! if ( !startPoint_ || !endPoint_ ) ! return ""; CComBSTR text; --- 34,41 ---- ! std::string ! VC7TextDocument::getTextRange( const Refactoring::SourceRange &range ) { ! setEditedRange( range ); CComBSTR text; *************** *** 49,77 **** void ! VC7TextDocument::replaceSelection( const std::string &text ) ! { ! if ( startPoint_ && endPoint_ ) { startPoint_->Delete( CComVariant( &*endPoint_) ); startPoint_->Insert( CComBSTR( text.c_str() ) ); } - } - - - Refactoring::SourceRange - VC7TextDocument::getSelectionRange() const - { - if ( !startPoint_ || !endPoint_ ) - return Refactoring::SourceRange(); - long startIndex = 0; - long endIndex = 0; - startPoint_->get_AbsoluteCharOffset( &startIndex ); - endPoint_->get_AbsoluteCharOffset( &endIndex ); - return Refactoring::SourceRange( startIndex-1, endIndex-startIndex ); - } void ! VC7TextDocument::setSelectionRange( const Refactoring::SourceRange &selection ) { if ( !startPoint_ || !endPoint_ ) --- 48,63 ---- void ! VC7TextDocument::replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ) { + setEditedRange( range ); + startPoint_->Delete( CComVariant( &*endPoint_) ); startPoint_->Insert( CComBSTR( text.c_str() ) ); } void ! VC7TextDocument::setEditedRange( const Refactoring::SourceRange &selection ) { if ( !startPoint_ || !endPoint_ ) *************** *** 85,105 **** startPoint_->MoveToAbsoluteOffset( selection.getStartIndex()+1 ); endPoint_->MoveToAbsoluteOffset( selection.getEndIndex()+1 ); - } - - - std::string - VC7TextDocument::getTextRange( const Refactoring::SourceRange &range ) - { - setSelectionRange( range ); - return getSelection(); - } - - - void - VC7TextDocument::replaceTextRange( const Refactoring::SourceRange &range, - const std::string &text ) - { - setSelectionRange( range ); - return replaceSelection( text ); } --- 71,74 ---- Index: VC7TextDocument.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/VC7TextDocument.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VC7TextDocument.h 15 May 2003 07:06:46 -0000 1.3 --- VC7TextDocument.h 16 May 2003 21:13:56 -0000 1.4 *************** *** 14,42 **** const std::string getAllText() const; - /*! Gets the selected text. - * \return Selected text. EOL are in the original text format. - */ - const std::string getSelection() const; - - /*! Replace current selection text with the specified text. - * \param text The selection is replaced with that text. If no - * text is selected, then the specified text is - * inserted at the selection location. - */ - void replaceSelection( const std::string &text ); - - /*! Gets the selected range. - * \return The location range of the selection. - * \warning Discard current selection. - */ - Refactoring::SourceRange getSelectionRange() const; - - /*! Select a specified range of text. - * Line and column are zero-based. - * \param from Location the selection begins at. - * \param to Location the selection ends (not included). - */ - void setSelectionRange( const Refactoring::SourceRange &selection ); - std::string getTextRange( const Refactoring::SourceRange &range ); --- 14,17 ---- *************** *** 45,48 **** --- 20,25 ---- private: + void setEditedRange( const Refactoring::SourceRange &selection ); + std::string stripCR( const std::string &text ) const; |
From: <bl...@us...> - 2003-05-16 19:55:27
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring In directory sc8-pr-cvs1:/tmp/cvs-serv32133/include/rfta/refactoring Modified Files: LineBasedTextDocument.h PlainTextDocument.h TextDocument.h Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: LineBasedTextDocument.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/LineBasedTextDocument.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LineBasedTextDocument.h 25 Dec 2002 22:39:46 -0000 1.6 --- LineBasedTextDocument.h 16 May 2003 19:54:53 -0000 1.7 *************** *** 77,80 **** --- 77,88 ---- void setSelectionRange( const SourceRange &selection ); + virtual const std::string getSelection() const =0; + + std::string getTextRange( const Refactoring::SourceRange &range ); + + void replaceTextRange( const Refactoring::SourceRange &range, + const std::string &text ); + + protected: void initialize( const std::string &initialContent ); Index: PlainTextDocument.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/PlainTextDocument.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlainTextDocument.h 22 Dec 2002 16:03:50 -0000 1.3 --- PlainTextDocument.h 16 May 2003 19:54:53 -0000 1.4 *************** *** 34,65 **** const std::string getAllText() const; ! /*! Gets the selected text. ! * \return Selected text. EOL are in the original text format. ! */ ! const std::string getSelection() const; ! ! /*! Replace current selection text with the specified text. ! * \param text The selection is replaced with that text. If no ! * text is selected, then the specified text is ! * inserted at the selection location. ! */ ! void replaceSelection( const std::string &text ); ! ! /*! Gets the selected range. ! * \return The location range of the selection. ! * \warning Discard current selection. ! */ ! SourceRange getSelectionRange() const; ! /*! Select a specified range of text. ! * Line and column are zero-based. ! * \param from Location the selection begins at. ! * \param to Location the selection ends (not included). ! */ ! void setSelectionRange( const SourceRange &selection ); private: std::string content_; - SourceRange selection_; }; --- 34,44 ---- const std::string getAllText() const; ! std::string getTextRange( const Refactoring::SourceRange &range ); ! void replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ); private: std::string content_; }; Index: TextDocument.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/TextDocument.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextDocument.h 22 Dec 2002 16:03:50 -0000 1.3 --- TextDocument.h 16 May 2003 19:54:53 -0000 1.4 *************** *** 28,63 **** virtual const std::string getAllText() const =0; ! /*! Gets the selected text. ! * \return Selected text. EOL are in the original text format. ! */ ! virtual const std::string getSelection() const =0; ! ! /*! Replace current selection text with the specified text. ! * \param text The selection is replaced with that text. If no ! * text is selected, then the specified text is ! * inserted at the selection location. ! */ ! virtual void replaceSelection( const std::string &text ) =0; ! ! /*! Gets the selected range. ! * \return The location range of the selection. ! * \warning Discard current selection. ! */ ! virtual SourceRange getSelectionRange() const =0; ! ! /*! Select a specified range of text. ! * Line and column are zero-based. ! * \param from Location the selection begins at. ! * \param to Location the selection ends (not included). */ ! virtual void setSelectionRange( const SourceRange &selection ) =0; ! /*! Move to a specific location. ! * Set the selection to an empty selection at the specified location. ! * Equivalent to selectText( to, to ). ! * \param toLocation Location the next setSelectedText() operation will insert ! * text at. */ ! void moveTo( int toLocation ); private: --- 28,45 ---- virtual const std::string getAllText() const =0; ! /*! Gets the text of the specified text range. ! * \param range Range of text to return. ! * \return Text of the specified text range. */ ! virtual std::string getTextRange( const Refactoring::SourceRange &range ) = 0; ! /*! Replaces the text of a given text range with the specified text. ! * \param range Range of text to replace. Length may be null is text ! * is being inserted. ! * \param text Text that replace the specified range. May be empty if ! * the text range is being deleted. */ ! virtual void replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ) = 0; private: |
From: <bl...@us...> - 2003-05-16 19:55:08
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv32133/src/rfta Modified Files: LineBasedTextDocument.cpp MockTextDocument.cpp MockTextDocument.h PlainTextDocument.cpp ReplaceTextTransform.cpp ReplaceTextTransformTest.cpp ReplaceTextTransformTest.h TextDocument.cpp TransformListTest.cpp Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: LineBasedTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/LineBasedTextDocument.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LineBasedTextDocument.cpp 10 May 2003 07:49:37 -0000 1.6 --- LineBasedTextDocument.cpp 16 May 2003 19:55:02 -0000 1.7 *************** *** 75,78 **** --- 75,95 ---- + std::string + LineBasedTextDocument::getTextRange( const Refactoring::SourceRange &range ) + { + setSelectionRange( range ); + return getSelection(); + } + + + void + LineBasedTextDocument::replaceTextRange( const Refactoring::SourceRange &range, + const std::string &text ) + { + setSelectionRange( range ); + replaceSelection( text ); + } + + void LineBasedTextDocument::replaceSelection( const std::string &text ) Index: MockTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/MockTextDocument.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MockTextDocument.cpp 22 Dec 2002 16:03:52 -0000 1.6 --- MockTextDocument.cpp 16 May 2003 19:55:02 -0000 1.7 *************** *** 13,17 **** MockTextDocument::MockTextDocument() ! : expectations_( "MockTextDocument" ) { } --- 13,17 ---- MockTextDocument::MockTextDocument() ! : Mock::Expectations( "MockTextDocument" ) { } *************** *** 26,38 **** MockTextDocument::getAllText() const { ! expectations_.throwNotImplemented( "getAllText" ); return ""; } ! const std::string ! MockTextDocument::getSelection() const { ! expectations_.throwNotImplemented( "getSelection" ); return ""; } --- 26,38 ---- MockTextDocument::getAllText() const { ! throwNotImplemented( "getAllText" ); return ""; } ! std::string ! MockTextDocument::getTextRange( const Refactoring::SourceRange &range ) { ! addCall( "MockTextDocument::getTextRange( " + range.toString() + ")" ); return ""; } *************** *** 40,89 **** void ! MockTextDocument::replaceSelection( const std::string &text ) ! { ! expectations_.addActual( "replaceSelection => " + text ); ! } ! ! ! void ! MockTextDocument::expectReplaceSelection( const std::string &text ) ! { ! expectations_.addExpected( "replaceSelection => " + text ); ! } ! ! ! SourceRange ! MockTextDocument::getSelectionRange() const ! { ! expectations_.throwNotImplemented( "getSelectionRange" ); ! return SourceRange(); ! } ! ! ! void ! MockTextDocument::setSelectionRange( const SourceRange &selection ) ! { ! expectations_.addActual( "setSelectionRange => " + selection.toString() ); ! } ! ! ! void ! MockTextDocument::expectSetSelectionRange( const SourceRange &selection ) ! { ! expectations_.addExpected( "setSelectionRange => " + selection.toString() ); ! } ! ! ! void ! MockTextDocument::expectNothing() ! { ! expectations_.expectNothing(); ! } ! ! ! void ! MockTextDocument::verify() { ! expectations_.verify(); } --- 40,48 ---- void ! MockTextDocument::replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ) { ! addCall( "MockTextDocument::replaceTextRange( " + range.toString() ! + ", " + text + ")" ); } Index: MockTextDocument.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/MockTextDocument.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MockTextDocument.h 22 Dec 2002 16:03:52 -0000 1.6 --- MockTextDocument.h 16 May 2003 19:55:02 -0000 1.7 *************** *** 19,22 **** --- 19,23 ---- class MockTextDocument : public TextDocument , public boost::noncopyable + , public Mock::Expectations { public: *************** *** 30,49 **** const std::string getAllText() const; ! const std::string getSelection() const; ! ! void replaceSelection( const std::string &text ); ! void expectReplaceSelection( const std::string &text ); ! ! SourceRange getSelectionRange() const; ! ! void setSelectionRange( const SourceRange &selection ); ! void expectSetSelectionRange( const SourceRange &selection ); ! ! void expectNothing(); ! ! void verify(); ! private: ! Mock::Expectations expectations_; }; --- 31,38 ---- const std::string getAllText() const; ! std::string getTextRange( const Refactoring::SourceRange &range ); ! void replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ); }; Index: PlainTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/PlainTextDocument.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlainTextDocument.cpp 22 Dec 2002 16:03:52 -0000 1.5 --- PlainTextDocument.cpp 16 May 2003 19:55:02 -0000 1.6 *************** *** 13,17 **** PlainTextDocument::PlainTextDocument() - : selection_( SourceRange(0,0) ) { } --- 13,16 ---- *************** *** 19,24 **** PlainTextDocument::PlainTextDocument( const std::string &content ) ! : selection_( SourceRange(0,0) ) ! , content_( content ) { } --- 18,22 ---- PlainTextDocument::PlainTextDocument( const std::string &content ) ! : content_( content ) { } *************** *** 37,70 **** ! const std::string ! PlainTextDocument::getSelection() const ! { ! return content_.substr( selection_.getStartIndex(), ! selection_.getLength() ); ! } ! ! ! void ! PlainTextDocument::replaceSelection( const std::string &text ) ! { ! std::string::iterator it = content_.begin() + selection_.getStartIndex(); ! content_.replace( it, it + selection_.getLength(), text ); ! selection_ = ! SourceRange( selection_.getStartIndex() + text.length(), 0 ); ! } ! ! ! SourceRange ! PlainTextDocument::getSelectionRange() const { ! return selection_; } - void ! PlainTextDocument::setSelectionRange( const SourceRange &selection ) { ! selection_ = selection; } --- 35,52 ---- ! std::string ! PlainTextDocument::getTextRange( const Refactoring::SourceRange &range ) { ! return content_.substr( range.getStartIndex(), ! range.getLength() ); } void ! PlainTextDocument::replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ) { ! std::string::iterator it = content_.begin() + range.getStartIndex(); ! content_.replace( it, it + range.getLength(), text ); } Index: ReplaceTextTransform.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/ReplaceTextTransform.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReplaceTextTransform.cpp 22 Dec 2002 16:03:52 -0000 1.5 --- ReplaceTextTransform.cpp 16 May 2003 19:55:02 -0000 1.6 *************** *** 30,35 **** { int lengthDelta = text_.length() - range_.getLength(); ! document.setSelectionRange( range_ ); ! document.replaceSelection( text_ ); return lengthDelta; --- 30,34 ---- { int lengthDelta = text_.length() - range_.getLength(); ! document.replaceTextRange( range_, text_ ); return lengthDelta; Index: ReplaceTextTransformTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/ReplaceTextTransformTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReplaceTextTransformTest.cpp 22 Dec 2002 16:03:52 -0000 1.4 --- ReplaceTextTransformTest.cpp 16 May 2003 19:55:02 -0000 1.5 *************** *** 5,9 **** #include "stdafx.h" - #include "MockTextDocument.h" #include "ReplaceTextTransform.h" #include "ReplaceTextTransformTest.h" --- 5,8 ---- *************** *** 30,33 **** --- 29,34 ---- ReplaceTextTransformTest::setUp() { + document_.reset( new MockTextDocument() ); + document_->setRecordMode(); } *************** *** 36,39 **** --- 37,41 ---- ReplaceTextTransformTest::tearDown() { + document_.reset(); } *************** *** 43,53 **** { ReplaceTextTransform transform( SourceRange( 0,0 ), "" ); ! MockTextDocument document; ! document.expectSetSelectionRange( SourceRange( 0,0 ) ); ! document.expectReplaceSelection( "" ); ! RFTA_ASSERT_EQUAL( 0, transform.apply( document ) ); ! document.verify(); } --- 45,54 ---- { ReplaceTextTransform transform( SourceRange( 0,0 ), "" ); ! document_->replaceTextRange( SourceRange( 0,0 ), "" ); ! document_->setVerifyMode(); ! RFTA_ASSERT_EQUAL( 0, transform.apply( *document_ ) ); ! document_->verify(); } *************** *** 57,67 **** { ReplaceTextTransform transform( SourceRange( 0,10 ), "123" ); ! MockTextDocument document; ! document.expectSetSelectionRange( SourceRange( 0,10 ) ); ! document.expectReplaceSelection( "123" ); ! RFTA_ASSERT_EQUAL( -7, transform.apply( document ) ); ! document.verify(); } --- 58,67 ---- { ReplaceTextTransform transform( SourceRange( 0,10 ), "123" ); ! document_->replaceTextRange( SourceRange( 0,10 ), "123" ); ! document_->setVerifyMode(); ! RFTA_ASSERT_EQUAL( -7, transform.apply( *document_ ) ); ! document_->verify(); } *************** *** 71,81 **** { ReplaceTextTransform transform( SourceRange( 0,5 ), "1234567890" ); ! MockTextDocument document; ! document.expectSetSelectionRange( SourceRange( 0,5 ) ); ! document.expectReplaceSelection( "1234567890" ); ! RFTA_ASSERT_EQUAL( 5, transform.apply( document ) ); ! document.verify(); } --- 71,80 ---- { ReplaceTextTransform transform( SourceRange( 0,5 ), "1234567890" ); ! document_->replaceTextRange( SourceRange( 0,5 ), "1234567890" ); ! document_->setVerifyMode(); ! RFTA_ASSERT_EQUAL( 5, transform.apply( *document_ ) ); ! document_->verify(); } *************** *** 85,95 **** { ReplaceTextTransform transform( SourceRange( 0,4 ), "1234" ); ! MockTextDocument document; ! document.expectSetSelectionRange( SourceRange( 0,4 ) ); ! document.expectReplaceSelection( "1234" ); ! RFTA_ASSERT_EQUAL( 0, transform.apply( document ) ); ! document.verify(); } --- 84,93 ---- { ReplaceTextTransform transform( SourceRange( 0,4 ), "1234" ); ! document_->replaceTextRange( SourceRange( 0,4 ), "1234" ); ! document_->setVerifyMode(); ! RFTA_ASSERT_EQUAL( 0, transform.apply( *document_ ) ); ! document_->verify(); } Index: ReplaceTextTransformTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/ReplaceTextTransformTest.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReplaceTextTransformTest.h 26 Oct 2002 20:39:56 -0000 1.1 --- ReplaceTextTransformTest.h 16 May 2003 19:55:02 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- #include "UnitTesting.h" + #include "MockTextDocument.h" + #include <boost/shared_ptr.hpp> *************** *** 47,50 **** --- 49,53 ---- private: + boost::shared_ptr<MockTextDocument> document_; }; Index: TextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/TextDocument.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TextDocument.cpp 22 Dec 2002 16:03:52 -0000 1.5 --- TextDocument.cpp 16 May 2003 19:55:02 -0000 1.6 *************** *** 16,20 **** } ! void TextDocument::moveTo( int toLocation ) --- 16,20 ---- } ! #if 0 void TextDocument::moveTo( int toLocation ) *************** *** 22,25 **** --- 22,26 ---- setSelectionRange( SourceRange( toLocation, toLocation ) ); } + #endif Index: TransformListTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/TransformListTest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TransformListTest.cpp 6 Mar 2003 22:18:41 -0000 1.5 --- TransformListTest.cpp 16 May 2003 19:55:02 -0000 1.6 *************** *** 15,19 **** TransformListTest::TransformListTest() - : CppUnit::TestFixture() { } --- 15,18 ---- *************** *** 30,33 **** --- 29,33 ---- transforms_.reset( new TransformList() ); document_.reset( new MockTextDocument() ); + document_->setRecordMode(); } *************** *** 45,48 **** --- 45,49 ---- { document_->expectNothing(); + document_->setVerifyMode(); transforms_->apply( *document_ ); *************** *** 55,62 **** TransformListTest::testApplyOne() { ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(3,6), "1" ) ); ! document_->expectSetSelectionRange( SourceRange( 3,6 ) ); ! document_->expectReplaceSelection( "1" ); transforms_->apply( *document_ ); --- 56,62 ---- TransformListTest::testApplyOne() { ! transforms_->add( *new ReplaceTextTransform( SourceRange(3,6), "1" ) ); ! document_->replaceTextRange( SourceRange( 3,6 ), "1" ); ! document_->setVerifyMode(); transforms_->apply( *document_ ); *************** *** 69,80 **** TransformListTest::testApplyTwoMissordered() { ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(30,7), "1456" ) ); ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(3,20), "aze" ) ); ! document_->expectSetSelectionRange( SourceRange( 3,20 ) ); ! document_->expectReplaceSelection( "aze" ); ! document_->expectSetSelectionRange( SourceRange( 30-20+3,7 ) ); ! document_->expectReplaceSelection( "1456" ); transforms_->apply( *document_ ); --- 69,77 ---- TransformListTest::testApplyTwoMissordered() { ! transforms_->add( *new ReplaceTextTransform( SourceRange(30,7), "1456" ) ); ! transforms_->add( *new ReplaceTextTransform( SourceRange(3,20), "aze" ) ); ! document_->replaceTextRange( SourceRange( 3,20 ), "aze" ); ! document_->replaceTextRange( SourceRange( 30-20+3,7 ), "1456" ); ! document_->setVerifyMode(); transforms_->apply( *document_ ); *************** *** 87,98 **** TransformListTest::testApplyTwoOrdered() { ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(3,20), "aze" ) ); ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(30,7), "1456" ) ); ! document_->expectSetSelectionRange( SourceRange( 3,20 ) ); ! document_->expectReplaceSelection( "aze" ); ! document_->expectSetSelectionRange( SourceRange( 30-20+3,7 ) ); ! document_->expectReplaceSelection( "1456" ); transforms_->apply( *document_ ); --- 84,92 ---- TransformListTest::testApplyTwoOrdered() { ! transforms_->add( *new ReplaceTextTransform( SourceRange(3,20), "aze" ) ); ! transforms_->add( *new ReplaceTextTransform( SourceRange(30,7), "1456" ) ); ! document_->replaceTextRange( SourceRange( 3,20 ), "aze" ); ! document_->replaceTextRange( SourceRange( 30-20+3,7 ), "1456" ); ! document_->setVerifyMode(); transforms_->apply( *document_ ); *************** *** 105,120 **** TransformListTest::testApplyThreeMissordered() { ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(30,7), "1456" ) ); ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(3,20), "aze" ) ); ! transforms_->add( *new ReplaceTextTransform( ! SourceRange(25,3), "a" ) ); ! document_->expectSetSelectionRange( SourceRange( 3,20 ) ); ! document_->expectReplaceSelection( "aze" ); ! document_->expectSetSelectionRange( SourceRange( 25-20+3,3 ) ); ! document_->expectReplaceSelection( "a" ); ! document_->expectSetSelectionRange( SourceRange( 30-20+3-3+1,7 ) ); ! document_->expectReplaceSelection( "1456" ); transforms_->apply( *document_ ); --- 99,109 ---- TransformListTest::testApplyThreeMissordered() { ! transforms_->add( *new ReplaceTextTransform( SourceRange(30,7), "1456" ) ); ! transforms_->add( *new ReplaceTextTransform( SourceRange(3,20), "aze" ) ); ! transforms_->add( *new ReplaceTextTransform( SourceRange(25,3), "a" ) ); ! document_->replaceTextRange( SourceRange( 3,20 ), "aze" ); ! document_->replaceTextRange( SourceRange( 25-20+3,3 ), "a" ); ! document_->replaceTextRange( SourceRange( 30-20+3-3+1,7 ), "1456" ); ! document_->setVerifyMode(); transforms_->apply( *document_ ); *************** *** 131,140 **** transforms_->add( *new ReplaceTextTransform( SourceRange( 0,0 ), line1 ) ); transforms_->add( *new ReplaceTextTransform( SourceRange( 0,0 ), "}" ) ); ! document_->expectSetSelectionRange( SourceRange( 0,0 ) ); ! document_->expectReplaceSelection( "{" ); ! document_->expectSetSelectionRange( SourceRange( 1,0 ) ); ! document_->expectReplaceSelection( line1 ); ! document_->expectSetSelectionRange( SourceRange( 1+line1.length(),0 ) ); ! document_->expectReplaceSelection( "}" ); transforms_->apply( *document_ ); --- 120,127 ---- transforms_->add( *new ReplaceTextTransform( SourceRange( 0,0 ), line1 ) ); transforms_->add( *new ReplaceTextTransform( SourceRange( 0,0 ), "}" ) ); ! document_->replaceTextRange( SourceRange( 0,0 ), "{" ); ! document_->replaceTextRange( SourceRange( 1,0 ), line1 ); ! document_->replaceTextRange( SourceRange( 1+line1.length(),0 ), "}" ); ! document_->setVerifyMode(); transforms_->apply( *document_ ); |
From: <bl...@us...> - 2003-05-16 19:55:06
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv32133/src/rftaparser Modified Files: CPPParserTest.cpp Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: CPPParserTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/CPPParserTest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CPPParserTest.cpp 4 May 2003 06:56:47 -0000 1.3 --- CPPParserTest.cpp 16 May 2003 19:55:02 -0000 1.4 *************** *** 111,119 **** CPPParserTest::testParseAllEnumDeclaration() { const std::string source( "enum X {\n" " FirstID = 7000\n" "};" ); ! CPPParser parser( source ); parser.parseAll(); --- 111,128 ---- CPPParserTest::testParseAllEnumDeclaration() { + const std::string source( "enum X {\n" " FirstID = 7000\n" "};" ); ! ! /* ! const std::string source( ! " class wxGenericDirCtrl {" ! "wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1 )\n" ! "{\n" ! "}\n" ! "};" ); ! */ CPPParser parser( source ); parser.parseAll(); |
From: <bl...@us...> - 2003-05-16 19:55:05
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv32133/src/pyrfta Modified Files: pyrfta.dsp Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: pyrfta.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pyrfta.dsp 30 Apr 2003 08:06:29 -0000 1.6 --- pyrfta.dsp 16 May 2003 19:55:01 -0000 1.7 *************** *** 106,109 **** --- 106,117 ---- # End Source File # End Group + # Begin Group "com" + + # PROP Default_Filter "" + # Begin Source File + + SOURCE=.\com\TextDocument.idl + # End Source File + # End Group # Begin Source File |
From: <bl...@us...> - 2003-05-16 19:55:04
|
Update of /cvsroot/cpptool/rfta/src/eclipseplugin/CppBridge In directory sc8-pr-cvs1:/tmp/cvs-serv32133/src/eclipseplugin/CppBridge Modified Files: EclipseDocumentHelper.cpp EclipseDocumentHelper.h Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: EclipseDocumentHelper.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/eclipseplugin/CppBridge/EclipseDocumentHelper.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EclipseDocumentHelper.cpp 15 Feb 2003 13:32:03 -0000 1.1 --- EclipseDocumentHelper.cpp 16 May 2003 19:55:01 -0000 1.2 *************** *** 55,63 **** } ! /*! Gets the selected text. ! * \return Selected text. EOL are in the original text format. ! */ ! const std::string EclipseDocumentHelper::getSelection() const ! { // call the java class method: jstring jres = (jstring)env->CallObjectMethod(targetDocument, mid_getSelection ); --- 55,64 ---- } ! ! std::string ! EclipseDocumentHelper::getTextRange( const Refactoring::SourceRange &range ) ! { ! setSelectionRange( range ); ! // call the java class method: jstring jres = (jstring)env->CallObjectMethod(targetDocument, mid_getSelection ); *************** *** 73,83 **** } ! /*! Replace current selection text with the specified text. ! * \param text The selection is replaced with that text. If no ! * text is selected, then the specified text is ! * inserted at the selection location. ! */ ! void EclipseDocumentHelper::replaceSelection( const std::string &text ) { jstring par = env->NewStringUTF(text.c_str()); env->CallVoidMethod(targetDocument, mid_replaceSelection , par ); --- 74,84 ---- } ! ! void ! EclipseDocumentHelper::replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ) { + setSelectionRange( range ); + jstring par = env->NewStringUTF(text.c_str()); env->CallVoidMethod(targetDocument, mid_replaceSelection , par ); *************** *** 121,137 **** env->ExceptionClear(); } - } - - - /*! Move to a specific location. - * Set the selection to an empty selection at the specified location. - * Equivalent to selectText( to, to ). - * \param toLocation Location the next setSelectedText() operation will insert - * text at. - */ - void EclipseDocumentHelper::moveTo( int toLocation ) - { - jint to=toLocation; - // call the java class method: - env->CallVoidMethod(targetDocument, mid_moveTo, to ); } --- 122,124 ---- Index: EclipseDocumentHelper.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/eclipseplugin/CppBridge/EclipseDocumentHelper.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EclipseDocumentHelper.h 15 Feb 2003 13:32:03 -0000 1.1 --- EclipseDocumentHelper.h 16 May 2003 19:55:01 -0000 1.2 *************** *** 35,61 **** EclipseDocumentHelper(JNIEnv * _env, jobject _targetDocument); /*! Gets the text of the document. * \return Text of the document. EOL are in the original text format. * \warning Discard current selection. */ ! virtual const std::string getAllText() const; ! /*! Gets the selected text. ! * \return Selected text. EOL are in the original text format. */ ! virtual const std::string getSelection() const; ! /*! Replace current selection text with the specified text. ! * \param text The selection is replaced with that text. If no ! * text is selected, then the specified text is ! * inserted at the selection location. */ ! virtual void replaceSelection( const std::string &text ); ! /*! Gets the selected range. ! * \return The location range of the selection. ! * \warning Discard current selection. ! */ ! virtual Refactoring::SourceRange getSelectionRange() const; /*! Select a specified range of text. --- 35,69 ---- EclipseDocumentHelper(JNIEnv * _env, jobject _targetDocument); + /*! Gets the selected range. + * \return The location range of the selection. + * \warning Discard current selection. + */ + Refactoring::SourceRange getSelectionRange() const; + + + // overridden from Refactoring::TextDocument + /*! Gets the text of the document. * \return Text of the document. EOL are in the original text format. * \warning Discard current selection. */ ! const std::string getAllText() const; ! /*! Gets the text of the specified text range. ! * \param range Range of text to return. ! * \return Text of the specified text range. */ ! std::string getTextRange( const Refactoring::SourceRange &range ); ! /*! Replaces the text of a given text range with the specified text. ! * \param range Range of text to replace. Length may be null is text ! * is being inserted. ! * \param text Text that replace the specified range. May be empty if ! * the text range is being deleted. */ ! void replaceTextRange( const Refactoring::SourceRange &range, ! const std::string &text ); ! private: /*! Select a specified range of text. *************** *** 64,76 **** * \param to Location the selection ends (not included). */ ! virtual void setSelectionRange( const Refactoring::SourceRange &selection ); ! ! /*! Move to a specific location. ! * Set the selection to an empty selection at the specified location. ! * Equivalent to selectText( to, to ). ! * \param toLocation Location the next setSelectedText() operation will insert ! * text at. ! */ ! void moveTo( int toLocation ); }; --- 72,76 ---- * \param to Location the selection ends (not included). */ ! void setSelectionRange( const Refactoring::SourceRange &selection ); }; |
From: <bl...@us...> - 2003-05-16 19:55:04
|
Update of /cvsroot/cpptool/rfta/src In directory sc8-pr-cvs1:/tmp/cvs-serv32133/src Modified Files: rfta.opt Log Message: * Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange(). Index: rfta.opt =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta.opt,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 Binary files /tmp/cvslDMHHT and /tmp/cvsWb3BtE differ |
From: <net...@us...> - 2003-05-16 10:26:17
|
Update of /cvsroot/cpptool/rfta/src/eclipseplugin In directory sc8-pr-cvs1:/tmp/cvs-serv30779/src/eclipseplugin Added Files: about.html Log Message: -- a brief description of the PlugIn for a binary distribution. --- NEW FILE: about.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html> <head> <title>About</title> <meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> </head> <body lang="EN-US"> <h2>About This Content</h2> <p>16st Mai, 2003</p> <h3>License</h3> <p>Eclipse.org makes available all content in this web archive ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>. For purposes of the CPL, "Program" will mean the Content.</p> <h3>Third Party Content</h3> <p>The Content includes items that have been sourced from third parties as follows:</p> <b>Cpp Refactoring</b> <blockquote> This product includes software developed by the Open Source Project "CPP-Refactory" (<a href="http://cpptool.sourceforge.net/">http://cpptool.sourceforge.net/</a>). </blockquote> <p>The following files contain the Cpp-Refactoring binary code:</p> <ul> <li>rfta_mdr.ext</li> <li>rftaparser_mdr.ext</li> <li>eclipseplugin.dll</li> </ul> <p>Source code for CppRefactoring is available at <a href="http://cpptool.sourceforge.net/">http://cpptool.sourceforge.net/</a>.</p> <h3>Contributions</h3> <p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p> <p>If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of the CPL.</p> </body> </html> |
From: <net...@us...> - 2003-05-16 10:01:49
|
Update of /cvsroot/cpptool/rfta/bug In directory sc8-pr-cvs1:/tmp/cvs-serv30938/bug Modified Files: List.txt Log Message: -- bug has been fixed (added a test to detailed parser tests) Index: List.txt =================================================================== RCS file: /cvsroot/cpptool/rfta/bug/List.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** List.txt 6 May 2003 07:53:30 -0000 1.9 --- List.txt 16 May 2003 10:01:46 -0000 1.10 *************** *** 83,91 **** => range extends to the end of the compound statement --- - pure virtual method declaration is not parsed correctly (audacity\exportmp3.h.html) - virtual wxString GetLibraryName() = 0; - - => '=0' get parse as an assignment initializer expression. - --- - - --- 83,84 ---- |
From: <net...@us...> - 2003-05-16 10:00:48
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv30593a/src/rftaparser Modified Files: DeclarationDetailsParserTest.cpp DeclarationDetailsParser.h DeclarationDetailsParser.cpp Log Message: -- bugfix for a problem that was introduced by new declarator parser -- introduced new property and node type of pure-specifier Index: DeclarationDetailsParserTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParserTest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DeclarationDetailsParserTest.cpp 13 May 2003 08:02:16 -0000 1.3 --- DeclarationDetailsParserTest.cpp 16 May 2003 10:00:43 -0000 1.4 *************** *** 141,145 **** ASSERT_DETAILS_PARSER_PASS( DeclarationDetailsParser, "T(a)=4;" ); ASSERT_DETAILS_PARSER_PASS( DeclarationDetailsParser, "T(*b)();" ); ! ASSERT_DETAILS_PARSER_PASS( DeclarationDetailsParser, "T(x),y,z=7;" ); /* --- 141,145 ---- ASSERT_DETAILS_PARSER_PASS( DeclarationDetailsParser, "T(a)=4;" ); ASSERT_DETAILS_PARSER_PASS( DeclarationDetailsParser, "T(*b)();" ); ! ASSERT_DETAILS_PARSER_PASS( DeclarationDetailsParser, "T(x),y,z=7;" ); /* Index: DeclarationDetailsParser.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DeclarationDetailsParser.h 13 May 2003 08:02:16 -0000 1.6 --- DeclarationDetailsParser.h 16 May 2003 10:00:43 -0000 1.7 *************** *** 94,103 **** bool skipOverAssignmentInitializer(); ! bool createAndAddInitializerNode( const ASTNodePtr &variableDeclNode ); void addValueNode( const ASTNodePtr& variableDeclNode, int start, int end ) const; ! void addInitializerNode( const ASTNodePtr& variableDeclNode, const ASTNodeType initializerType, int initializerStartIndex ) const; --- 94,106 ---- bool skipOverAssignmentInitializer(); ! bool createAndAddInitializerNode( const ASTNodePtr &variableDeclNode, bool functionDeclarator ); void addValueNode( const ASTNodePtr& variableDeclNode, int start, int end ) const; ! void addInitializerNode( const ASTNodePtr& declaratorNode, ! const ASTNodeType initializerType, ! int initializerStartIndex ) const; ! void addFunctionSpecifierNode( const ASTNodePtr& declaratorNode, const ASTNodeType initializerType, int initializerStartIndex ) const; Index: DeclarationDetailsParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DeclarationDetailsParser.cpp 13 May 2003 08:02:16 -0000 1.11 --- DeclarationDetailsParser.cpp 16 May 2003 10:00:44 -0000 1.12 *************** *** 471,475 **** } ! skipSpaces(); do { --- 471,484 ---- } ! skipSpaces(); ! // check special case "empty braces" ! if (*current_ == ')') ! { ! // it's an empty parameter list, not a declarator ! current_ = rollback; ! return false; ! } ! ! // try to parse a declarator: do { *************** *** 707,711 **** char c = *current_; if ( c == ';' || c == ',' ) ! return current_ != (start+1); else if ( c == '(' ) { --- 716,720 ---- char c = *current_; if ( c == ';' || c == ',' ) ! return current_ != start; else if ( c == '(' ) { *************** *** 883,887 **** // now go through initializers: ! if (!createAndAddInitializerNode(declaratorNode)) // error in parsing initializer return false; --- 892,896 ---- // now go through initializers: ! if (!createAndAddInitializerNode(declaratorNode,functionDeclarator)) // error in parsing initializer return false; *************** *** 894,898 **** bool ! DeclarationDetailsParser::createAndAddInitializerNode( const ASTNodePtr &declaratorNode ) { if ( !hasNext() ) --- 903,907 ---- bool ! DeclarationDetailsParser::createAndAddInitializerNode( const ASTNodePtr &declaratorNode, bool functionDeclarator ) { if ( !hasNext() ) *************** *** 906,942 **** int declaratorEndIndex; ASTNodeType initializerType; switch( *current_++ ) { ! case '=': ! initializerType = ASTNodeTypes::assignVariableInitializerExpression; ! skipSpaces(); ! initializerValueStartIndex = getCurrentIndex(); ! skipOverAssignmentInitializer(); /// @todo should check return value declaratorEndIndex = getCurrentIndex(); initializerValueEndIndex = getCurrentIndex(); break; case '(': ! initializerType = ASTNodeTypes::constructorVariableInitializerExpression; ! initializerValueStartIndex = getCurrentIndex(); ! findNextBalanced( '(', ')' ); ! declaratorEndIndex = getCurrentIndex(); ! initializerValueEndIndex = getCurrentIndex() -1; ! break; case ';': case ',': case '{': ! return true; // end of initializer default: ! -- current_; ! // unexpected character: '*current_' ! return false; } declaratorNode->setLength( declaratorEndIndex - ! declaratorNode->getStartIndex() ); ! addInitializerNode( declaratorNode, ! initializerType, ! initializerStartIndex ); ! addValueNode( declaratorNode, ! initializerValueStartIndex, ! initializerValueEndIndex ); skipSpaces(); --- 915,979 ---- int declaratorEndIndex; ASTNodeType initializerType; + int save_position = getCurrentIndex(); switch( *current_++ ) { ! case '=': ! skipSpaces(); ! if (functionDeclarator) ! { ! initializerType = ASTNodeTypes::pureSpecifier; ! initializerValueStartIndex = save_position-1; ! } ! else ! { ! initializerType = ASTNodeTypes::assignVariableInitializerExpression; ! initializerValueStartIndex = getCurrentIndex(); ! } ! if (!skipOverAssignmentInitializer()) ! { ! // this is not a correctly parsed initialization ! return false; ! } declaratorEndIndex = getCurrentIndex(); initializerValueEndIndex = getCurrentIndex(); break; case '(': ! if (functionDeclarator) ! { ! // for a function declarator this is not possible ! return false; ! } ! initializerType = ASTNodeTypes::constructorVariableInitializerExpression; ! initializerValueStartIndex = getCurrentIndex(); ! findNextBalanced( '(', ')' ); ! declaratorEndIndex = getCurrentIndex(); ! initializerValueEndIndex = getCurrentIndex() -1; ! break; case ';': case ',': case '{': ! return true; // end of initializer default: ! -- current_; ! // unexpected character: '*current_' ! return false; } declaratorNode->setLength( declaratorEndIndex - ! declaratorNode->getStartIndex() ); ! ! if (functionDeclarator) ! { ! addFunctionSpecifierNode( declaratorNode, ! initializerType, ! initializerStartIndex ); ! } else ! { ! addInitializerNode( declaratorNode, ! initializerType, ! initializerStartIndex ); ! ! addValueNode( declaratorNode, ! initializerValueStartIndex, ! initializerValueEndIndex ); ! } skipSpaces(); *************** *** 981,984 **** --- 1018,1036 ---- declaratorNode->setPropertyNode( ASTNodeProperties::variableInitializerProperty, initializerNode ); + } + + void + DeclarationDetailsParser::addFunctionSpecifierNode( const ASTNodePtr& declaratorNode, + const ASTNodeType initializerType, + int initializerStartIndex) const + { + int initializerLength = getCurrentIndex() - initializerStartIndex; + + ASTNodePtr specifierNode = createASTNode( initializerType, + declaratorNode, + initializerStartIndex, + initializerLength ); + declaratorNode->setPropertyNode( ASTNodeProperties::functionDeclaratorSpecifier, + specifierNode ); } |
From: <net...@us...> - 2003-05-16 10:00:02
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv30288/src/rftaparser Modified Files: UnparsedDeclarationMutatorTest.h UnparsedDeclarationMutatorTest.cpp Log Message: -- additional test for bug that was introduced by new declarator parser -- testing now new property and node type of pure-specifier Index: UnparsedDeclarationMutatorTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** UnparsedDeclarationMutatorTest.h 4 May 2003 06:56:48 -0000 1.8 --- UnparsedDeclarationMutatorTest.h 16 May 2003 09:59:57 -0000 1.9 *************** *** 53,56 **** --- 53,57 ---- CPPUNIT_TEST( testMemberConstInit ); CPPUNIT_TEST( testStructBitfield ); + CPPUNIT_TEST( testEmptyParameterList ); CPPUNIT_TEST_SUITE_END(); *************** *** 100,103 **** --- 101,105 ---- void testStructBitfield(); void testOperatorMember(); + void testEmptyParameterList(); private: Index: UnparsedDeclarationMutatorTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** UnparsedDeclarationMutatorTest.cpp 10 May 2003 13:11:06 -0000 1.13 --- UnparsedDeclarationMutatorTest.cpp 16 May 2003 09:59:57 -0000 1.14 *************** *** 768,772 **** source.addKeyed(SPECIFIER , "const" ) << " "; source.addKeyed(SPECIFIER , "vector<int>" ) << " "; ! source.addKeyed(DECLARATOR, "& func(class s::t v=0,int i=-1) = 0" ) << ";"; SourceASTNodePtr sourceAST = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source ); --- 768,776 ---- source.addKeyed(SPECIFIER , "const" ) << " "; source.addKeyed(SPECIFIER , "vector<int>" ) << " "; ! ! source.setKeyStart(DECLARATOR); ! source << "& func(class s::t v=0,int i=-1) "; ! source.addKeyed("PURESPECIFIER","= 0" ); // "pure specifier is within 'declarator' ! source.setKeyEnd(DECLARATOR) << ";"; SourceASTNodePtr sourceAST = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source ); *************** *** 778,781 **** --- 782,791 ---- // check declarator types: RFTA_ASSERT_NODE_TYPE( node->getChildAt(0), ASTNodeTypes::unparsedDeclarator, "declarator"); + RFTA_ASSERT_NODE_PROPERTY_HAS( node->getChildAt(0), + ASTNodeProperties::functionDeclaratorSpecifier, + ASTNodeTypes::pureSpecifier, + source.getKeyedIndex("PURESPECIFIER",0), + source.getKeyedLen("PURESPECIFIER",0) + ); } *************** *** 833,836 **** --- 843,877 ---- RFTA_ASSERT_NODE_TYPE( node->getChildAt(0), ASTNodeTypes::unparsedDeclarator, "declarator"); } + + void + UnparsedDeclarationMutatorTest::testEmptyParameterList() + { + Testing::KeyedString source; + source.addKeyed(SPECIFIER , "virtual" ) << " "; + source.addKeyed(SPECIFIER , "wxString") << " "; + + source.setKeyStart(DECLARATOR); + source << "GetLibraryName() "; + source.addKeyed("PURESPECIFIER","= 0" ); // "pure specifier is within 'declarator' + source.setKeyEnd (DECLARATOR); + + source << ";"; + + SourceASTNodePtr sourceAST = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source ); + ASTNodePtr node = sourceAST->getChildAt(0); + + // check AST: + RFTA_ASSERT_DECLARATION( source, sourceAST ); + + // check declarator types: + RFTA_ASSERT_NODE_TYPE( node->getChildAt(0), ASTNodeTypes::unparsedDeclarator, "declarator"); + RFTA_ASSERT_NODE_PROPERTY_HAS( node->getChildAt(0), + ASTNodeProperties::functionDeclaratorSpecifier, + ASTNodeTypes::pureSpecifier, + source.getKeyedIndex("PURESPECIFIER",0), + source.getKeyedLen("PURESPECIFIER",0) + ); + } + |
From: <net...@us...> - 2003-05-16 09:58:46
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv29890/src/rftaparser Modified Files: ASTNodes.cpp Log Message: -- added special node type/property for the pure-specifier of function declarators (last bug in list.txt) Index: ASTNodes.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/ASTNodes.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ASTNodes.cpp 3 May 2003 21:52:15 -0000 1.24 --- ASTNodes.cpp 16 May 2003 09:58:43 -0000 1.25 *************** *** 81,84 **** --- 81,85 ---- const ASTNodeType ASTNodeTypes::macroIdentifier( "macro-identifier" ); const ASTNodeType ASTNodeTypes::macroParameters( "macro-parameter" ); + const ASTNodeType ASTNodeTypes::pureSpecifier ( "pure-specifier" ); *************** *** 124,127 **** --- 125,130 ---- const ASTNodeProperty ASTNodeProperties::macroIdentifier( "macro-identifier-property" ); const ASTNodeProperty ASTNodeProperties::macroParameters( "macro-parameters-property" ); + + const ASTNodeProperty ASTNodeProperties::functionDeclaratorSpecifier( "function-declarator-specifier" ); } // namespace Refactoring |
From: <net...@us...> - 2003-05-16 09:58:46
|
Update of /cvsroot/cpptool/rfta/include/rfta/parser In directory sc8-pr-cvs1:/tmp/cvs-serv29890/include/rfta/parser Modified Files: ASTNodes.h Log Message: -- added special node type/property for the pure-specifier of function declarators (last bug in list.txt) Index: ASTNodes.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/parser/ASTNodes.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ASTNodes.h 3 May 2003 21:52:15 -0000 1.21 --- ASTNodes.h 16 May 2003 09:58:42 -0000 1.22 *************** *** 73,76 **** --- 73,77 ---- static const ASTNodeType unparsedDeclarator; + static const ASTNodeType pureSpecifier; // statement types *************** *** 245,248 **** --- 246,251 ---- static const ASTNodeProperty macroIdentifier; static const ASTNodeProperty macroParameters; + + static const ASTNodeProperty functionDeclaratorSpecifier; }; |
From: <net...@us...> - 2003-05-16 08:30:38
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv26093/src/rfta Modified Files: rfta.dsp Log Message: -- deactivated tests in release version Index: rfta.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/rfta.dsp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** rfta.dsp 15 May 2003 16:29:53 -0000 1.47 --- rfta.dsp 16 May 2003 08:30:33 -0000 1.48 *************** *** 611,618 **** --- 611,636 ---- SOURCE=.\IdentifierScopeTest.cpp + + !IF "$(CFG)" == "rfta - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rfta - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File SOURCE=.\IdentifierScopeTest.h + + !IF "$(CFG)" == "rfta - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rfta - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File |