summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2010-12-11 07:39:25 -0800
committerJoseph Powers <jpowers27@cox.net>2010-12-11 07:45:10 -0800
commited76ffd5644a42bbba2a18faaace9934d4c97311 (patch)
tree0e44a0fa09db4a4e086b640ac0f16d5fb9edd3f2
parent74eecabdd5fe23732aa5726f77c41da54eaa10a9 (diff)
remove DECLARE_LIST( BreakPL, BreakPoint* )
Also simplify the prior patch & make sure the list is in the right order.
-rw-r--r--basctl/source/basicide/baside2.cxx26
-rw-r--r--basctl/source/basicide/baside2b.cxx25
-rw-r--r--basctl/source/basicide/bastypes.cxx114
-rw-r--r--basctl/source/basicide/brkdlg.cxx36
-rw-r--r--basctl/source/basicide/macrodlg.cxx27
-rw-r--r--basctl/source/inc/bastypes.hxx35
6 files changed, 142 insertions, 121 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 9e8804d9c..4cf79d2a6 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -102,7 +102,7 @@ using namespace comphelper;
DBG_NAME( ModulWindow )
TYPEINIT1( ModulWindow , IDEBaseWindow );
-
+
void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const String& rTitle, bool bOutput )
{
short nLeftMargin = LMARGPRN;
@@ -187,7 +187,7 @@ void lcl_ConvertTabsToSpaces( String& rLine )
}
-ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, String aLibName,
+ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, String aLibName,
String aName, ::rtl::OUString& aModule )
:IDEBaseWindow( pParent, rDocument, aLibName, aName )
,aXEditorWindow( this )
@@ -203,10 +203,10 @@ ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDoc
SbModuleRef ModulWindow::XModule()
{
- // ModuleWindows can now be created as a result of the
+ // ModuleWindows can now be created as a result of the
// modules getting created via the api. This is a result of an
// elementInserted event from the BasicLibrary container.
- // However the SbModule is also created from a different listener to
+ // However the SbModule is also created from a different listener to
// the same event ( in basmgr ) Therefore it is possible when we look
// for xModule it may not yet be available, here we keep tring to access
// the module until such time as it exists
@@ -334,7 +334,7 @@ BOOL ModulWindow::BasicExecute()
if ( XModule().Is() && xModule->IsCompiled() && !aStatus.bError )
{
- if ( GetBreakPoints().Count() )
+ if ( GetBreakPoints().size() )
aStatus.nBasicFlags = aStatus.nBasicFlags | SbDEBUG_BREAK;
if ( !aStatus.bIsRunning )
@@ -555,7 +555,7 @@ BOOL ModulWindow::SaveBasicSource()
return bDone;
}
-BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName );
+BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName );
BOOL ModulWindow::ImportDialog()
{
@@ -584,7 +584,7 @@ BOOL ModulWindow::ToggleBreakPoint( ULONG nLine )
if ( pBrk ) // entfernen
{
xModule->ClearBP( (USHORT)nLine );
- delete GetBreakPoints().Remove( pBrk );
+ delete GetBreakPoints().remove( pBrk );
}
else // einen erzeugen
{
@@ -751,7 +751,7 @@ long __EXPORT ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
USHORT nErrorLine = pBasic->GetLine();
// Gibt es hier einen BreakPoint?
- BreakPoint* pBrk = GetBreakPoints().FindBreakPoint( nErrorLine );
+ BreakPoint* pBrk = GetBreakPoints().FindBreakPoint( nErrorLine );
if ( pBrk )
{
pBrk->nHitCount++;
@@ -952,7 +952,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
DBG_CHKTHIS( ModulWindow, 0 );
AssertValidEditEngine();
-
+
MapMode eOldMapMode( pPrinter->GetMapMode() );
Font aOldFont( pPrinter->GetFont() );
@@ -1007,7 +1007,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
pPrinter->SetFont( aOldFont );
pPrinter->SetMapMode( eOldMapMode );
-
+
return sal_Int32(nCurPage);
}
@@ -1350,7 +1350,7 @@ void __EXPORT ModulWindow::BasicStarted()
{
aStatus.bIsRunning = TRUE;
BreakPointList& rList = GetBreakPoints();
- if ( rList.Count() )
+ if ( rList.size() )
{
rList.ResetHitCount();
rList.SetBreakPointsInBasic( xModule );
@@ -1395,7 +1395,7 @@ BasicEntryDescriptor ModulWindow::CreateEntryDescriptor()
}
}
break;
- }
+ }
case script::ModuleType::FORM:
aLibSubName = String( IDEResId( RID_STR_USERFORMS ) );
break;
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2365ee558..3af39c19c 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -975,13 +975,12 @@ void __EXPORT BreakPointWindow::Paint( const Rectangle& )
aBmpOff.X() = ( aOutSz.Width() - aBmpSz.Width() ) / 2;
aBmpOff.Y() = ( nLineHeight - aBmpSz.Height() ) / 2;
- BreakPoint* pBrk = GetBreakPoints().First();
- while ( pBrk )
+ for ( size_t i = 0, n = GetBreakPoints().size(); i < n ; ++i )
{
- ULONG nLine = pBrk->nLine-1;
- ULONG nY = nLine*nLineHeight - nCurYOffset;
+ BreakPoint* pBrk = GetBreakPoints().at( i );
+ size_t nLine = pBrk->nLine-1;
+ size_t nY = nLine*nLineHeight - nCurYOffset;
DrawImage( Point( 0, nY ) + aBmpOff, pBrk->bEnabled ? aBrk1 : aBrk0 );
- pBrk = GetBreakPoints().Next();
}
ShowMarker( TRUE );
}
@@ -1039,20 +1038,16 @@ void BreakPointWindow::ShowMarker( BOOL bShow )
BreakPoint* BreakPointWindow::FindBreakPoint( const Point& rMousePos )
{
- long nLineHeight = GetTextHeight();
- long nYPos = rMousePos.Y() + nCurYOffset;
-// Image aBrk( ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetImage( IMGID_BRKENABLED ) );
-// Size aBmpSz( aBrk.GetSizePixel() );
-// aBmpSz = PixelToLogic( aBmpSz );
+ size_t nLineHeight = GetTextHeight();
+ size_t nYPos = rMousePos.Y() + nCurYOffset;
- BreakPoint* pBrk = GetBreakPoints().First();
- while ( pBrk )
+ for ( size_t i = 0, n = GetBreakPoints().size(); i < n ; ++i )
{
- ULONG nLine = pBrk->nLine-1;
- long nY = nLine*nLineHeight;
+ BreakPoint* pBrk = GetBreakPoints().at( i );
+ size_t nLine = pBrk->nLine-1;
+ size_t nY = nLine*nLineHeight;
if ( ( nYPos > nY ) && ( nYPos < ( nY + nLineHeight ) ) )
return pBrk;
- pBrk = GetBreakPoints().Next();
}
return 0;
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 4b0d7564e..2f33185cc 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -59,6 +59,7 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
+using ::std::vector;
DBG_NAME( IDEBaseWindow )
@@ -265,11 +266,10 @@ SfxUndoManager* __EXPORT IDEBaseWindow::GetUndoManager()
BreakPointList::BreakPointList()
{}
-BreakPointList::BreakPointList(BreakPointList const & rList):
- BreakPL( sal::static_int_cast<USHORT>( rList.Count() ))
+BreakPointList::BreakPointList(BreakPointList const & rList)
{
- for (ULONG i = 0; i < rList.Count(); ++i)
- Insert(new BreakPoint(*rList.GetObject(i)), i);
+ for (size_t i = 0; i < rList.size(); ++i)
+ maBreakPoints.push_back( new BreakPoint(*rList.at( i ) ) );
}
BreakPointList::~BreakPointList()
@@ -279,76 +279,69 @@ BreakPointList::~BreakPointList()
void BreakPointList::reset()
{
- while (Count() > 0)
- delete Remove(Count() - 1);
+ for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i )
+ delete maBreakPoints[ i ];
+ maBreakPoints.clear();
}
void BreakPointList::transfer(BreakPointList & rList)
{
reset();
- for (ULONG i = 0; i < rList.Count(); ++i)
- Insert(rList.GetObject(i), i);
- rList.Clear();
+ for (size_t i = 0; i < rList.size(); ++i)
+ maBreakPoints.push_back( rList.at( i ) );
+ rList.reset();
}
void BreakPointList::InsertSorted( BreakPoint* pNewBrk )
{
- BreakPoint* pBrk = First();
- while ( pBrk )
+ for ( vector< BreakPoint* >::iterator i = maBreakPoints.begin(); i < maBreakPoints.end(); ++i )
{
- if ( pNewBrk->nLine <= pBrk->nLine )
+ if ( pNewBrk->nLine <= (*i)->nLine )
{
DBG_ASSERT( ( pBrk->nLine != pNewBrk->nLine ) || pNewBrk->bTemp, "BreakPoint existiert schon!" );
- Insert( pNewBrk );
+ maBreakPoints.insert( i, pNewBrk );
return;
}
- pBrk = Next();
}
// Keine Einfuegeposition gefunden => LIST_APPEND
- Insert( pNewBrk, LIST_APPEND );
+ maBreakPoints.push_back( pNewBrk );
}
void BreakPointList::SetBreakPointsInBasic( SbModule* pModule )
{
pModule->ClearAllBP();
- BreakPoint* pBrk = First();
- while ( pBrk )
+ for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i )
{
+ BreakPoint* pBrk = maBreakPoints[ i ];
if ( pBrk->bEnabled )
pModule->SetBP( (USHORT)pBrk->nLine );
- pBrk = Next();
}
}
-BreakPoint* BreakPointList::FindBreakPoint( ULONG nLine )
+BreakPoint* BreakPointList::FindBreakPoint( size_t nLine )
{
- BreakPoint* pBrk = First();
- while ( pBrk )
+ for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i )
{
+ BreakPoint* pBrk = maBreakPoints[ i ];
if ( pBrk->nLine == nLine )
return pBrk;
-
- pBrk = Next();
}
-
- return (BreakPoint*)0;
+ return NULL;
}
-
-
-void BreakPointList::AdjustBreakPoints( ULONG nLine, BOOL bInserted )
+void BreakPointList::AdjustBreakPoints( size_t nLine, bool bInserted )
{
- BreakPoint* pBrk = First();
- while ( pBrk )
+ for ( size_t i = 0; i < maBreakPoints.size(); )
{
- BOOL bDelBrk = FALSE;
+ BreakPoint* pBrk = maBreakPoints[ i ];
+ bool bDelBrk = false;
if ( pBrk->nLine == nLine )
{
if ( bInserted )
pBrk->nLine++;
else
- bDelBrk = TRUE;
+ bDelBrk = true;
}
else if ( pBrk->nLine > nLine )
{
@@ -360,27 +353,66 @@ void BreakPointList::AdjustBreakPoints( ULONG nLine, BOOL bInserted )
if ( bDelBrk )
{
- ULONG n = GetCurPos();
- delete Remove( pBrk );
- pBrk = Seek( n );
+ delete remove( pBrk );
}
else
{
- pBrk = Next();
+ ++i;
}
}
}
void BreakPointList::ResetHitCount()
{
- BreakPoint* pBrk = First();
- while ( pBrk )
+ for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i )
{
+ BreakPoint* pBrk = maBreakPoints[ i ];
pBrk->nHitCount = 0;
- pBrk = Next();
}
}
+size_t BreakPointList::size() const
+{
+ return maBreakPoints.size();
+}
+
+BreakPoint* BreakPointList::at( size_t i )
+{
+ if ( i < maBreakPoints.size() )
+ return maBreakPoints[ i ];
+ else
+ return NULL;
+}
+
+const BreakPoint* BreakPointList::at( size_t i ) const
+{
+ return maBreakPoints[ i ];
+}
+
+BreakPoint* BreakPointList::remove( BreakPoint* ptr )
+{
+ for ( vector< BreakPoint* >::iterator i = maBreakPoints.begin(); i < maBreakPoints.end(); ++i )
+ {
+ if ( ptr == *i )
+ {
+ maBreakPoints.erase( i );
+ return ptr;
+ }
+ }
+ return NULL;
+}
+
+void BreakPointList::push_back( BreakPoint* item )
+{
+ maBreakPoints.push_back( item );
+}
+
+void BreakPointList::clear()
+{
+ maBreakPoints.clear();
+}
+
+
void IDEBaseWindow::Deactivating()
{
}
@@ -583,7 +615,7 @@ void __EXPORT BasicIDETabBar::Command( const CommandEvent& rCEvt )
aPopup.RemoveDisabledEntries();
}
if ( aDocument.isInVBAMode() )
- {
+ {
// disable to delete or remove object modules in IDE
BasicManager* pBasMgr = aDocument.getBasicManager();
if ( pBasMgr )
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index c5bf23e7c..fdbe970d9 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@
// FIXME Why does BreakPointDialog allow only USHORT for break-point line
// numbers, whereas BreakPoint supports ULONG?
-bool lcl_ParseText( String aText, USHORT& rLineNr )
+bool lcl_ParseText( String aText, size_t& rLineNr )
{
// aText should look like "# n" where
// n > 0 && n < std::numeric_limits< USHORT >::max().
@@ -61,9 +61,9 @@ bool lcl_ParseText( String aText, USHORT& rLineNr )
aText.Erase(0, 1);
// XXX Assumes that USHORT is contained within sal_Int32:
sal_Int32 n = aText.ToInt32();
- if (n <= 0 || n > std::numeric_limits< USHORT >::max())
+ if ( n <= 0 )
return false;
- rLineNr = static_cast< USHORT >(n);
+ rLineNr = static_cast< size_t >(n);
return true;
}
@@ -84,14 +84,12 @@ BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList
FreeResource();
aComboBox.SetUpdateMode( FALSE );
- BreakPoint* pBrk = m_aModifiedBreakPointList.First();
- BreakPoint* pFirstBrk = pBrk;
- while ( pBrk )
+ for ( size_t i = 0, n = m_aModifiedBreakPointList.size(); i < n; ++i )
{
+ BreakPoint* pBrk = m_aModifiedBreakPointList.at( i );
String aEntryStr( RTL_CONSTASCII_USTRINGPARAM( "# " ) );
aEntryStr += String::CreateFromInt32( pBrk->nLine );
aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND );
- pBrk = m_aModifiedBreakPointList.Next();
}
aComboBox.SetUpdateMode( TRUE );
@@ -112,7 +110,7 @@ BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList
aNumericField.SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
aComboBox.SetText( aComboBox.GetEntry( 0 ) );
- UpdateFields( pFirstBrk );
+ UpdateFields( m_aModifiedBreakPointList.at( 0 ) );
CheckButtons();
}
@@ -130,7 +128,7 @@ void BreakPointDialog::CheckButtons()
// "New" button is enabled if the combo box edit contains a valid line
// number that is not already present in the combo box list; otherwise
// "OK" and "Delete" buttons are enabled:
- USHORT nLine;
+ size_t nLine;
if (lcl_ParseText(aComboBox.GetText(), nLine)
&& m_aModifiedBreakPointList.FindBreakPoint(nLine) == 0)
{
@@ -165,7 +163,7 @@ IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox *, pBox )
aDelButton.Enable();
USHORT nEntry = pBox->GetEntryPos( pBox->GetText() );
- BreakPoint* pBrk = m_aModifiedBreakPointList.GetObject( nEntry );
+ BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry );
DBG_ASSERT( pBrk, "Kein passender Breakpoint zur Liste ?" );
UpdateFields( pBrk );
@@ -200,13 +198,13 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton )
{
// Checkbox beruecksichtigen!
String aText( aComboBox.GetText() );
- USHORT nLine;
- BOOL bValid = lcl_ParseText( aText, nLine );
+ size_t nLine;
+ bool bValid = lcl_ParseText( aText, nLine );
if ( bValid )
{
BreakPoint* pBrk = new BreakPoint( nLine );
pBrk->bEnabled = aCheckBox.IsChecked();
- pBrk->nStopAfter = (ULONG) aNumericField.GetValue();
+ pBrk->nStopAfter = (size_t) aNumericField.GetValue();
m_aModifiedBreakPointList.InsertSorted( pBrk );
String aEntryStr( RTL_CONSTASCII_USTRINGPARAM( "# " ) );
aEntryStr += String::CreateFromInt32( pBrk->nLine );
@@ -229,11 +227,11 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton )
}
else if ( pButton == &aDelButton )
{
- USHORT nEntry = aComboBox.GetEntryPos( aComboBox.GetText() );
- BreakPoint* pBrk = m_aModifiedBreakPointList.GetObject( nEntry );
+ size_t nEntry = aComboBox.GetEntryPos( aComboBox.GetText() );
+ BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry );
if ( pBrk )
{
- delete m_aModifiedBreakPointList.Remove( pBrk );
+ delete m_aModifiedBreakPointList.remove( pBrk );
aComboBox.RemoveEntry( nEntry );
if ( nEntry && !( nEntry < aComboBox.GetEntryCount() ) )
nEntry--;
@@ -272,8 +270,8 @@ void BreakPointDialog::UpdateFields( BreakPoint* pBrk )
BreakPoint* BreakPointDialog::GetSelectedBreakPoint()
{
- USHORT nEntry = aComboBox.GetEntryPos( aComboBox.GetText() );
- BreakPoint* pBrk = m_aModifiedBreakPointList.GetObject( nEntry );
+ size_t nEntry = aComboBox.GetEntryPos( aComboBox.GetText() );
+ BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry );
return pBrk;
}
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index ab17abc62..ffd3bedd2 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -56,8 +56,9 @@
#include <com/sun/star/script/XLibraryContainer2.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
-#include <list>
-using ::std::list;
+#include <map>
+using ::std::map;
+using ::std::pair;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -553,7 +554,7 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox )
// Die Macros sollen in der Reihenfolge angezeigt werden,
// wie sie im Modul stehen.
- list< SbMethod* > aMacros;
+ map< sal_uInt16, SbMethod* > aMacros;
size_t nMacroCount = pModule->GetMethods()->Count();
for ( size_t iMeth = 0; iMeth < nMacroCount; iMeth++ )
{
@@ -562,26 +563,14 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox )
continue;
DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" );
// Eventuell weiter vorne ?
- USHORT nStart, nEnd;
+ sal_uInt16 nStart, nEnd;
pMethod->GetLineRange( nStart, nEnd );
- list< SbMethod* >::iterator itr;
- for ( itr = aMacros.begin(); itr != aMacros.end(); ++itr )
- {
- USHORT nS, nE;
- SbMethod* pM = *itr;
- DBG_ASSERT( pM, "Macro nicht in Liste ?!" );
- pM->GetLineRange( nS, nE );
- if ( nS > nStart ) {
- break;
- }
- }
- if ( itr != aMacros.end() ) ++itr;
- aMacros.insert( itr, pMethod );
+ aMacros.insert( map< sal_uInt16, SbMethod*>::value_type( nStart, pMethod ) );
}
aMacroBox.SetUpdateMode( FALSE );
- for ( list< SbMethod* >::iterator itr = aMacros.begin(); itr != aMacros.end(); ++itr )
- aMacroBox.InsertEntry( (*itr)->GetName() );
+ for ( map< sal_uInt16, SbMethod* >::iterator it = aMacros.begin(); it != aMacros.end(); ++it )
+ aMacroBox.InsertEntry( (*it).second->GetName() );
aMacroBox.SetUpdateMode( TRUE );
if ( aMacroBox.GetEntryCount() )
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 2b03fb2c5..c0079b333 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -54,6 +54,7 @@ class SfxItemSet;
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <hash_map>
+#include <vector>
#define LINE_SEP_CR 0x0D
#define LINE_SEP 0x0A
@@ -84,14 +85,13 @@ struct BasicStatus
struct BreakPoint
{
- BOOL bEnabled;
- BOOL bTemp;
- ULONG nLine;
- ULONG nStopAfter;
- ULONG nHitCount;
-
- BreakPoint( ULONG nL ) { nLine = nL; nStopAfter = 0; nHitCount = 0; bEnabled = TRUE; bTemp = FALSE; }
+ bool bEnabled;
+ bool bTemp;
+ size_t nLine;
+ size_t nStopAfter;
+ size_t nHitCount;
+ BreakPoint( size_t nL ) { nLine = nL; nStopAfter = 0; nHitCount = 0; bEnabled = true; bTemp = false; }
};
class BasicDockingWindow : public DockingWindow
@@ -109,11 +109,11 @@ public:
BasicDockingWindow( Window* pParent );
};
-DECLARE_LIST( BreakPL, BreakPoint* )
-class BreakPointList : public BreakPL
+class BreakPointList
{
private:
void operator =(BreakPointList); // not implemented
+ ::std::vector< BreakPoint* > maBreakPoints;
public:
BreakPointList();
@@ -127,10 +127,17 @@ public:
void transfer(BreakPointList & rList);
void InsertSorted( BreakPoint* pBrk );
- BreakPoint* FindBreakPoint( ULONG nLine );
- void AdjustBreakPoints( ULONG nLine, BOOL bInserted );
+ BreakPoint* FindBreakPoint( size_t nLine );
+ void AdjustBreakPoints( size_t nLine, bool bInserted );
void SetBreakPointsInBasic( SbModule* pModule );
void ResetHitCount();
+
+ size_t size() const;
+ BreakPoint* at( size_t i );
+ const BreakPoint* at( size_t i ) const;
+ BreakPoint* remove( BreakPoint* ptr );
+ void push_back( BreakPoint* item );
+ void clear();
};
// helper class for sorting TabBar
@@ -204,7 +211,7 @@ public:
virtual void StoreData();
virtual void UpdateData();
virtual BOOL CanClose();
-
+
// return number of pages to be printed
virtual sal_Int32 countPages( Printer* pPrinter ) = 0;
// print page
@@ -275,7 +282,7 @@ private:
ScriptDocument m_aDocument;
String m_aLibName;
String m_aCurrentName;
- USHORT m_nCurrentType;
+ USHORT m_nCurrentType;
public:
LibInfoItem( const ScriptDocument& rDocument, const String& rLibName, const String& rCurrentName, USHORT nCurrentType );