summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
Diffstat (limited to 'basic')
-rw-r--r--basic/inc/basic/sbmod.hxx8
-rw-r--r--basic/inc/basic/sbstar.hxx1
-rw-r--r--basic/source/classes/sbxmod.cxx49
3 files changed, 26 insertions, 32 deletions
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index abb482f7bfe5..0bc764e863fe 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -35,10 +35,12 @@
#include <rtl/ustring.hxx>
#include <vector>
+#include <deque>
+
class SbMethod;
class SbProperty;
class SbiRuntime;
-class SbiBreakpoints;
+typedef std::deque< USHORT > SbiBreakpoints;
class SbiImage;
class SbProcedureProperty;
class SbIfaceMapperMethod;
@@ -115,8 +117,8 @@ public:
const SbxObject* FindType( String aTypeName ) const;
virtual BOOL IsBreakable( USHORT nLine ) const;
- virtual USHORT GetBPCount() const;
- virtual USHORT GetBP( USHORT n ) const;
+ virtual size_t GetBPCount() const;
+ virtual USHORT GetBP( size_t n ) const;
virtual BOOL IsBP( USHORT nLine ) const;
virtual BOOL SetBP( USHORT nLine );
virtual BOOL ClearBP( USHORT nLine );
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index a234dc206ec7..7d189c363364 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -44,7 +44,6 @@ class SbiInstance; // runtime instance
class SbiRuntime; // currently running procedure
class SbiImage; // compiled image
class BasicLibInfo; // info block for basic manager
-class SbiBreakpoints;
class SbTextPortions;
class SbMethod;
class BasicManager;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 8b1069bbeab3..e70f38bbeaed 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -444,11 +444,7 @@ TYPEINIT1(SbJScriptMethod,SbMethod)
TYPEINIT1(SbObjModule,SbModule)
TYPEINIT1(SbUserFormModule,SbObjModule)
-SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4)
-SV_IMPL_VARARR(SbiBreakpoints,USHORT)
-
-
-SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
+typedef std::vector<HighlightPortion> HighlightPortions;
bool getDefaultVBAMode( StarBASIC* pb )
{
@@ -1478,15 +1474,15 @@ BOOL SbModule::IsBreakable( USHORT nLine ) const
return FALSE;
}
-USHORT SbModule::GetBPCount() const
+size_t SbModule::GetBPCount() const
{
- return pBreaks ? pBreaks->Count() : 0;
+ return pBreaks ? pBreaks->size() : 0;
}
-USHORT SbModule::GetBP( USHORT n ) const
+USHORT SbModule::GetBP( size_t n ) const
{
- if( pBreaks && n < pBreaks->Count() )
- return pBreaks->GetObject( n );
+ if( pBreaks && n < pBreaks->size() )
+ return pBreaks->operator[]( n );
else
return 0;
}
@@ -1495,11 +1491,9 @@ BOOL SbModule::IsBP( USHORT nLine ) const
{
if( pBreaks )
{
- const USHORT* p = pBreaks->GetData();
- USHORT n = pBreaks->Count();
- for( USHORT i = 0; i < n; i++, p++ )
+ for( size_t i = 0; i < pBreaks->size(); i++ )
{
- USHORT b = *p;
+ USHORT b = pBreaks->operator[]( i );
if( b == nLine )
return TRUE;
if( b < nLine )
@@ -1515,18 +1509,16 @@ BOOL SbModule::SetBP( USHORT nLine )
return FALSE;
if( !pBreaks )
pBreaks = new SbiBreakpoints;
- const USHORT* p = pBreaks->GetData();
- USHORT n = pBreaks->Count();
- USHORT i;
- for( i = 0; i < n; i++, p++ )
+ size_t i;
+ for( i = 0; i < pBreaks->size(); i++ )
{
- USHORT b = *p;
+ USHORT b = pBreaks->operator[]( i );
if( b == nLine )
return TRUE;
if( b < nLine )
break;
}
- pBreaks->Insert( &nLine, 1, i );
+ pBreaks->insert( pBreaks->begin() + i, nLine );
// #38568: Zur Laufzeit auch hier SbDEBUG_BREAK setzen
if( pINST && pINST->pRun )
@@ -1540,19 +1532,19 @@ BOOL SbModule::ClearBP( USHORT nLine )
BOOL bRes = FALSE;
if( pBreaks )
{
- const USHORT* p = pBreaks->GetData();
- USHORT n = pBreaks->Count();
- for( USHORT i = 0; i < n; i++, p++ )
+ for( size_t i = 0; i < pBreaks->size(); i++ )
{
- USHORT b = *p;
+ USHORT b = pBreaks->operator[]( i );
if( b == nLine )
{
- pBreaks->Remove( i, 1 ); bRes = TRUE; break;
+ pBreaks->erase( pBreaks->begin() + i );
+ bRes = TRUE;
+ break;
}
if( b < nLine )
break;
}
- if( !pBreaks->Count() )
+ if( pBreaks->empty() )
delete pBreaks, pBreaks = NULL;
}
return bRes;
@@ -1560,7 +1552,8 @@ BOOL SbModule::ClearBP( USHORT nLine )
void SbModule::ClearAllBP()
{
- delete pBreaks; pBreaks = NULL;
+ delete pBreaks;
+ pBreaks = NULL;
}
void
@@ -1588,7 +1581,7 @@ BOOL SbModule::LoadData( SvStream& rStrm, USHORT nVer )
Clear();
if( !SbxObject::LoadData( rStrm, 1 ) )
return FALSE;
- // Sicherheitshalber...
+ // Precaution...
SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH );
BYTE bImage;
rStrm >> bImage;