Improved performance
Bug #92 Large XML file without line breaks kills XML Copy Editor
This commit is contained in:
parent
543a4b57a3
commit
8f80bee6c2
|
@ -1661,8 +1661,8 @@ void MyFrame::OnIdle ( wxIdleEvent& event )
|
|||
// check if document loaded
|
||||
wxString frameTitle = GetTitle();
|
||||
|
||||
XmlDoc *doc;
|
||||
if ( ( doc = getActiveDocument() ) == NULL )
|
||||
XmlDoc *doc = getActiveDocument();
|
||||
if ( doc == NULL )
|
||||
{
|
||||
if ( lastDoc != NULL )
|
||||
{
|
||||
|
@ -1691,18 +1691,6 @@ void MyFrame::OnIdle ( wxIdleEvent& event )
|
|||
restoreFocusToNotebook = false;
|
||||
}
|
||||
|
||||
wxString docTitle;
|
||||
if ( doc->getFullFileName().empty() || !showFullPathOnFrame )
|
||||
docTitle = doc->getShortFileName();
|
||||
else
|
||||
docTitle = doc->getFullFileName();
|
||||
|
||||
docTitle += _T ( " - " );
|
||||
docTitle += _ ( "XML Copy Editor" );
|
||||
|
||||
if ( frameTitle != docTitle )
|
||||
SetTitle ( docTitle );
|
||||
|
||||
// update modified field
|
||||
if ( !mainBook )
|
||||
return;
|
||||
|
@ -1738,20 +1726,15 @@ void MyFrame::OnIdle ( wxIdleEvent& event )
|
|||
}
|
||||
|
||||
// update coordinates field
|
||||
std::pair<int, int> myControlCoordinates;
|
||||
int current = doc->GetCurrentPos();
|
||||
myControlCoordinates.first = doc->LineFromPosition ( current ) + 1;
|
||||
myControlCoordinates.second = doc->GetColumn ( current ) + 1;
|
||||
|
||||
if ( myControlCoordinates != controlCoordinates )
|
||||
if ( current != lastPos )
|
||||
{
|
||||
wxString coordinates;
|
||||
coordinates.Printf (
|
||||
_ ( "Ln %i Col %i" ),
|
||||
myControlCoordinates.first,
|
||||
myControlCoordinates.second );
|
||||
doc->LineFromPosition ( current ) + 1,
|
||||
doc->GetColumn ( current ) + 1 );
|
||||
GetStatusBar()->SetStatusText ( coordinates, STATUS_POSITION );
|
||||
controlCoordinates = myControlCoordinates;
|
||||
}
|
||||
|
||||
// update parent element field
|
||||
|
@ -1762,6 +1745,17 @@ void MyFrame::OnIdle ( wxIdleEvent& event )
|
|||
lastPos = current;
|
||||
lastDoc = doc;
|
||||
|
||||
wxString docTitle;
|
||||
if ( doc->getFullFileName().empty() || !showFullPathOnFrame )
|
||||
docTitle = doc->getShortFileName();
|
||||
else
|
||||
docTitle = doc->getFullFileName();
|
||||
|
||||
docTitle += _T ( " - " );
|
||||
docTitle += _ ( "XML Copy Editor" );
|
||||
|
||||
if ( frameTitle != docTitle )
|
||||
SetTitle ( docTitle );
|
||||
|
||||
// don't try to find parent if pane is not shown
|
||||
if ( !manager.GetPane ( insertChildPanel ).IsShown() && !properties.validateAsYouType )
|
||||
|
|
|
@ -376,7 +376,6 @@ class MyFrame : public wxFrame
|
|||
|
||||
wxString catalogPath, xslDtdPath, rssDtdPath, lzxDtdPath, xtmDtdPath,
|
||||
xliffDtdPath, aspellDataPath, aspellDictPath;
|
||||
std::pair<int, int> controlCoordinates;
|
||||
std::map<std::string, std::map<std::string, std::set<std::string> > >
|
||||
promptMap;
|
||||
std::map<int, wxString> validationPresetMap;
|
||||
|
|
Loading…
Reference in New Issue