summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/bastype3.cxx
diff options
context:
space:
mode:
authornpower Developer <npower@openoffice.org>2010-03-02 12:39:31 +0000
committernpower Developer <npower@openoffice.org>2010-03-02 12:39:31 +0000
commit07716c77cc6b451aa4717b7811fd5f5c2aa22967 (patch)
tree0b22431906616b33ce426d6edb40fb275a7b8b34 /basctl/source/basicide/bastype3.cxx
parent97412488d9fcd77c21dbeb821dec122008cd2e32 (diff)
npower13_objectmodule: #i109734# object module stuff
Diffstat (limited to 'basctl/source/basicide/bastype3.cxx')
-rw-r--r--basctl/source/basicide/bastype3.cxx46
1 files changed, 44 insertions, 2 deletions
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index a0320d89e88a..de9eff56ca24 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -131,6 +131,14 @@ void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry )
}
}
}
+ else if ( eType == OBJ_TYPE_DOCUMENT_OBJECTS
+ || eType == OBJ_TYPE_USERFORMS
+ || eType == OBJ_TYPE_NORMAL_MODULES
+ || eType == OBJ_TYPE_CLASS_MODULES )
+ {
+ String aLibName( aDesc.GetLibName() );
+ ImpCreateLibSubSubEntriesInVBAMode( pEntry, aDocument, aLibName );
+ }
else {
DBG_ERROR( "BasicTreeListBox::RequestingChilds: Unknown Type!" );
}
@@ -201,6 +209,7 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
}
SbxVariable* pVar = 0;
+ bool bDocumentObjects = false;
if ( aEntries.Count() )
{
for ( USHORT n = 0; n < aEntries.Count(); n++ )
@@ -223,6 +232,12 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
case OBJ_TYPE_MODULE:
{
DBG_ASSERT( pVar && pVar->IsA( TYPE(StarBASIC) ), "FindVariable: Ungueltiges Basic" );
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( bDocumentObjects )
+ {
+ sal_uInt16 nIndex = 0;
+ aName = aName.GetToken( 0, ' ', nIndex );
+ }
pVar = ((StarBASIC*)pVar)->FindModule( aName );
}
break;
@@ -237,6 +252,15 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
// sbx dialogs removed
}
break;
+ case OBJ_TYPE_DOCUMENT_OBJECTS:
+ bDocumentObjects = true;
+ case OBJ_TYPE_USERFORMS:
+ case OBJ_TYPE_NORMAL_MODULES:
+ case OBJ_TYPE_CLASS_MODULES:
+ {
+ // skip, to find the child entry.
+ continue;
+ }
default:
{
DBG_ERROR( "FindVariable: Unbekannter Typ!" );
@@ -257,12 +281,13 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
ScriptDocument aDocument( ScriptDocument::getApplicationScriptDocument() );
LibraryLocation eLocation = LIBRARY_LOCATION_UNKNOWN;
String aLibName;
+ String aLibSubName;
String aName;
String aMethodName;
BasicEntryType eType = OBJ_TYPE_UNKNOWN;
if ( !pEntry )
- return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType );
+ return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType );
EntryArray aEntries;
@@ -329,6 +354,15 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
eType = pBE->GetType();
}
break;
+ case OBJ_TYPE_DOCUMENT_OBJECTS:
+ case OBJ_TYPE_USERFORMS:
+ case OBJ_TYPE_NORMAL_MODULES:
+ case OBJ_TYPE_CLASS_MODULES:
+ {
+ aLibSubName = GetEntryText( pLE );
+ eType = pBE->GetType();
+ }
+ break;
default:
{
DBG_ERROR( "GetEntryDescriptor: Unbekannter Typ!" );
@@ -342,7 +376,7 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
}
}
- return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType );
+ return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType );
}
USHORT BasicTreeListBox::ConvertType( BasicEntryType eType )
@@ -424,6 +458,14 @@ bool BasicTreeListBox::IsValidEntry( SvLBoxEntry* pEntry )
bIsValid = BasicIDE::HasMethod( aDocument, aLibName, aName, aMethodName );
}
break;
+ case OBJ_TYPE_DOCUMENT_OBJECTS:
+ case OBJ_TYPE_USERFORMS:
+ case OBJ_TYPE_NORMAL_MODULES:
+ case OBJ_TYPE_CLASS_MODULES:
+ {
+ bIsValid = true;
+ }
+ break;
default: ;
}