summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Bregas <ab@openoffice.org>2002-08-09 09:27:16 +0000
committerAndreas Bregas <ab@openoffice.org>2002-08-09 09:27:16 +0000
commiteecfeca2d3017fc0503c418b2961138cc55c5aa8 (patch)
treef7d3c47b16f884803b496f60d54c0f22047d2329 /basic
parent156a3564c006379623612d9d2c11109cf78e5d05 (diff)
#92464# FindNextStmnt method with FollowJumps option
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 7fa85f5b3627..71dda1d03019 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sbxmod.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: gh $ $Date: 2002-07-10 10:54:53 $
+ * last change: $Author: ab $ $Date: 2002-08-09 10:27:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -818,12 +818,24 @@ void SbModule::GlobalRunDeInit( void )
const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol ) const
{
+ return FindNextStmnt( p, nLine, nCol, FALSE );
+}
+
+const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol,
+ BOOL bFollowJumps, const SbiImage* pImg ) const
+{
USHORT nPC = (USHORT) ( p - (const BYTE*) pImage->GetCode() );
while( nPC < pImage->GetCodeSize() )
{
SbiOpcode eOp = (SbiOpcode ) ( *p++ );
nPC++;
- if( eOp >= SbOP1_START && eOp <= SbOP1_END )
+ if( bFollowJumps && eOp == _JUMP && pImg )
+ {
+ DBG_ASSERT( pImg, "FindNextStmnt: pImg==NULL with FollowJumps option" );
+ USHORT nOp1 = *p++; nOp1 |= *p++ << 8;
+ p = (const BYTE*) pImg->GetCode() + nOp1;
+ }
+ else if( eOp >= SbOP1_START && eOp <= SbOP1_END )
p += 2, nPC += 2;
else if( eOp == _STMNT )
{