Kaydet (Commit) 9ef0b8e3 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert tools/table.hxx to std::set in EditorWindow class in basctl module

üst e5a916ee
...@@ -51,11 +51,11 @@ class SvxSearchItem; ...@@ -51,11 +51,11 @@ class SvxSearchItem;
#include <sfx2/progress.hxx> #include <sfx2/progress.hxx>
#include <svtools/syntaxhighlight.hxx> #include <svtools/syntaxhighlight.hxx>
#include <unotools/options.hxx> #include <unotools/options.hxx>
#include <tools/table.hxx>
#include "breakpoint.hxx" #include "breakpoint.hxx"
#include "linenumberwindow.hxx" #include "linenumberwindow.hxx"
#include "objdlg.hxx" #include "objdlg.hxx"
#include <set>
#include <tools/table.hxx> #include <tools/table.hxx>
...@@ -95,6 +95,8 @@ inline void ProgressInfo::StepProgress() ...@@ -95,6 +95,8 @@ inline void ProgressInfo::StepProgress()
SetState( ++nCurState ); SetState( ++nCurState );
} }
typedef std::set<sal_uInt16> SyntaxLineSet;
class EditorWindow : public Window, public SfxListener class EditorWindow : public Window, public SfxListener
{ {
private: private:
...@@ -113,7 +115,7 @@ private: ...@@ -113,7 +115,7 @@ private:
SyntaxHighlighter aHighlighter; SyntaxHighlighter aHighlighter;
Timer aSyntaxIdleTimer; Timer aSyntaxIdleTimer;
Table aSyntaxLineTable; SyntaxLineSet aSyntaxLineTable;
DECL_LINK(SyntaxTimerHdl, void *); DECL_LINK(SyntaxTimerHdl, void *);
ProgressInfo* pProgress; ProgressInfo* pProgress;
ModulWindow* pModulWindow; ModulWindow* pModulWindow;
......
...@@ -628,7 +628,7 @@ void EditorWindow::CreateEditEngine() ...@@ -628,7 +628,7 @@ void EditorWindow::CreateEditEngine()
for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
aSyntaxLineTable.Insert( nLine, (void*)(sal_uInt16)1 ); aSyntaxLineTable.insert( nLine );
ForceSyntaxTimeout(); ForceSyntaxTimeout();
DELETEZ( pProgress ); DELETEZ( pProgress );
...@@ -793,7 +793,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine ) ...@@ -793,7 +793,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine )
if ( aChanges.Len() ) if ( aChanges.Len() )
{ {
for ( long n = aChanges.Min() + 1; n <= aChanges.Max(); n++ ) for ( long n = aChanges.Min() + 1; n <= aChanges.Max(); n++ )
aSyntaxLineTable.Insert( n, (void*)(sal_uLong)1 ); aSyntaxLineTable.insert( n );
aSyntaxIdleTimer.Start(); aSyntaxIdleTimer.Start();
} }
...@@ -868,7 +868,7 @@ void EditorWindow::DoDelayedSyntaxHighlight( sal_uLong nPara ) ...@@ -868,7 +868,7 @@ void EditorWindow::DoDelayedSyntaxHighlight( sal_uLong nPara )
{ {
if ( bDelayHighlight ) if ( bDelayHighlight )
{ {
aSyntaxLineTable.Insert( nPara, (void*)(sal_uLong)1 ); aSyntaxLineTable.insert( nPara );
aSyntaxIdleTimer.Start(); aSyntaxIdleTimer.Start();
} }
else else
...@@ -884,13 +884,11 @@ IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl) ...@@ -884,13 +884,11 @@ IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl)
// pEditEngine->SetUpdateMode( sal_False ); // pEditEngine->SetUpdateMode( sal_False );
bHighlightning = sal_True; bHighlightning = sal_True;
sal_uInt16 nLine; for ( SyntaxLineSet::const_iterator it = aSyntaxLineTable.begin();
void* p = aSyntaxLineTable.First(); it != aSyntaxLineTable.end(); ++it )
while ( p )
{ {
nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey(); sal_uInt16 nLine = *it;
DoSyntaxHighlight( nLine ); DoSyntaxHighlight( nLine );
p = aSyntaxLineTable.Next();
} }
// #i45572# // #i45572#
...@@ -899,7 +897,7 @@ IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl) ...@@ -899,7 +897,7 @@ IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl)
pEditEngine->SetModified( bWasModified ); pEditEngine->SetModified( bWasModified );
aSyntaxLineTable.Clear(); aSyntaxLineTable.clear();
bHighlightning = sal_False; bHighlightning = sal_False;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment