feature req. 1640029

click on error desciption in warning pane will bring cursor the line number containing error
This commit is contained in:
Anh Trinh 2009-05-07 21:04:42 +00:00
parent 21b8289882
commit a44c094902
4 changed files with 63 additions and 22 deletions

12
libtool
View File

@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services. # libtool - Provide generalized library-building support services.
# Generated automatically by config.status (xmlcopyeditor) 1.2.0.4 # Generated automatically by config.status (xmlcopyeditor) 1.2.0.4
# Libtool was configured on host geralds-laptop: # Libtool was configured on host antux:
# NOTE: Changes made to this file will be lost: look at ltmain.sh. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
# #
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
@ -231,7 +231,7 @@ finish_eval=""
hardcode_into_libs=yes hardcode_into_libs=yes
# Compile-time system search path for libraries. # Compile-time system search path for libraries.
sys_lib_search_path_spec="/usr/lib/gcc/i486-linux-gnu/4.3.2 /usr/lib /lib" sys_lib_search_path_spec="/usr/lib/gcc/i486-linux-gnu/4.3.3 /usr/lib /lib"
# Run-time system search path for libraries. # Run-time system search path for libraries.
sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib " sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib "
@ -8511,17 +8511,17 @@ file_list_spec=""
hardcode_action=immediate hardcode_action=immediate
# The directories searched by this compiler when creating a shared library. # The directories searched by this compiler when creating a shared library.
compiler_lib_search_dirs="/usr/lib/gcc/i486-linux-gnu/4.3.2 /usr/lib/gcc/i486-linux-gnu/4.3.2 /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib /lib/../lib /usr/lib/../lib /usr/lib/gcc/i486-linux-gnu/4.3.2/../../.." compiler_lib_search_dirs="/usr/lib/gcc/i486-linux-gnu/4.3.3 /usr/lib/gcc/i486-linux-gnu/4.3.3 /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib /lib/../lib /usr/lib/../lib /usr/lib/gcc/i486-linux-gnu/4.3.3/../../.."
# Dependencies to place before and after the objects being linked to # Dependencies to place before and after the objects being linked to
# create a shared library. # create a shared library.
predep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.2/crtbeginS.o" predep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.3/crtbeginS.o"
postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crtn.o" postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crtn.o"
predeps="" predeps=""
postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
# The library search path used internally by the compiler when linking # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../.." compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../.."
# ### END LIBTOOL TAG CONFIG: CXX # ### END LIBTOOL TAG CONFIG: CXX

View File

@ -20,6 +20,11 @@
#include "myhtmlpane.h" #include "myhtmlpane.h"
#include "xmlcopyeditor.h" #include "xmlcopyeditor.h"
#include <string>
#include <sstream>
#include <iostream>
BEGIN_EVENT_TABLE ( MyHtmlPane, wxHtmlWindow ) BEGIN_EVENT_TABLE ( MyHtmlPane, wxHtmlWindow )
EVT_LEFT_DCLICK ( MyHtmlPane::OnLeftDoubleClick ) EVT_LEFT_DCLICK ( MyHtmlPane::OnLeftDoubleClick )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -52,4 +57,32 @@ void MyHtmlPane::OnCellClicked(
*/ */
void MyHtmlPane::OnLeftDoubleClick ( wxMouseEvent& WXUNUSED ( event ) ) void MyHtmlPane::OnLeftDoubleClick ( wxMouseEvent& WXUNUSED ( event ) )
{ } {
}
bool MyHtmlPane::OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event)
{
//since the error description was hardcoded, make use of this error string
//parse the get the line number, then jump to that line
if(error_message.find("Validation stopped at line") != -1 ||
error_message.find("Error at line")!= -1){
string substring = error_message.substr(error_message.find("at line ")+8);
string number = substring.substr(0,substring.find(", "));
istringstream iss(substring);
int line ;
iss >> line;
if (--line >= 0 && (doc))
{
doc->GotoLine ( ( int ) line );
doc->SetFocus();
}
return true;
}
return false;
}
void MyHtmlPane::SetCurrentDocument(XmlDoc *xdoc)
{
doc = xdoc;
}

View File

@ -19,18 +19,23 @@
#ifndef MY_HTML_PANE_H #ifndef MY_HTML_PANE_H
#define MY_HTML_PANE_H #define MY_HTML_PANE_H
#include "xmldoc.h"
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/wxhtml.h> #include <wx/wxhtml.h>
class MyHtmlPane : public wxHtmlWindow class MyHtmlPane : public wxHtmlWindow
{ {
public: public:
std::string error_message;
MyHtmlPane ( MyHtmlPane (
wxWindow *parent, wxWindow *parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& position = wxDefaultPosition, const wxPoint& position = wxDefaultPosition,
const wxSize& size = wxDefaultSize ); const wxSize& size = wxDefaultSize );
void SetCurrentDocument(XmlDoc *xdoc);
private: private:
/* /*
void OnCellClicked( void OnCellClicked(
@ -39,7 +44,9 @@ class MyHtmlPane : public wxHtmlWindow
wxCoord y, wxCoord y,
const wxMouseEvent& event); const wxMouseEvent& event);
*/ */
XmlDoc *doc;
void OnLeftDoubleClick ( wxMouseEvent& event ); void OnLeftDoubleClick ( wxMouseEvent& event );
bool OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@ -5517,7 +5517,8 @@ void MyFrame::messagePane ( const wxString& s, int iconType, bool forcePane )
htmlBuffer += _T ( "</td></tr></table></body></html>" ); htmlBuffer += _T ( "</td></tr></table></body></html>" );
htmlReport->SetPage ( htmlBuffer ); htmlReport->SetPage ( htmlBuffer );
htmlReport->error_message = htmlString.mb_str(wxConvUTF8);
htmlReport->SetCurrentDocument(getActiveDocument());
manager.Update(); manager.Update();
} }