diff options
author | Bartosz Kosiorek <gang65@openoffice.org> | 2010-10-20 22:48:22 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@openoffice.org> | 2010-10-20 22:48:22 +0200 |
commit | 3ce776ee5b1e38236cbd001ba3ea60f5757fb0ed (patch) | |
tree | b0e7344df918308783b5eaa06c5489657006f359 /basic | |
parent | 4856f3fc585169d3135fcb9ea3ff4400b9c93d11 (diff) | |
parent | 8ea563dce6cc7e6a81cab56db220e07cc407ee5a (diff) |
svarray: merge with DEV300 m90
Diffstat (limited to 'basic')
-rw-r--r-- | basic/inc/basic/sbmod.hxx | 8 | ||||
-rw-r--r-- | basic/inc/basic/sbstar.hxx | 1 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 49 |
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; |