summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-06-27 16:26:29 +0100
committerNoel Power <noel.power@suse.com>2013-06-27 16:39:09 +0100
commiteebf0a6dfa9490a9f59a4e392517a0c93d3da1df (patch)
treef6005fb1ca9f43601a704dbe7c5d22aa1ebb236a /basctl
parent5504e8d78173af2b4a9fbcbcd59df5add839db3b (diff)
Revert "tweak object catalog to improve switching modules in large Libraries"
This reverts commit 21eeeccfa64a4c03554c1fe3715d38c1695245ab.
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/basobj2.cxx37
1 files changed, 9 insertions, 28 deletions
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 1b1689b97ff5..7e62558930c8 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -42,7 +42,7 @@
#include <vector>
#include <algorithm>
#include <memory>
-#include "basic/basmgr.hxx"
+
namespace basctl
{
@@ -405,23 +405,13 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt
OUString aOUSource;
if ( rDocument.getModule( rLibName, rModName, aOUSource ) )
{
- BasicManager* pBasMgr = rDocument.getBasicManager();
- StarBASIC* pSb = pBasMgr ? pBasMgr->GetLib( rLibName ) : NULL;
- SbModule* pMod = pSb ? pSb->FindModule( rModName ) : NULL;
-
- SbModuleRef xModule;
- if ( !pMod )
- {
- xModule = new SbModule( rModName );
- xModule->SetSource32( aOUSource );
- pMod = xModule;
- }
-
- sal_uInt16 nCount = pMod->GetMethods()->Count();
+ SbModuleRef xModule = new SbModule( rModName );
+ xModule->SetSource32( aOUSource );
+ sal_uInt16 nCount = xModule->GetMethods()->Count();
sal_uInt16 nRealCount = nCount;
for ( sal_uInt16 i = 0; i < nCount; i++ )
{
- SbMethod* pMethod = (SbMethod*)pMod->GetMethods()->Get( i );
+ SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
if( pMethod->IsHidden() )
--nRealCount;
}
@@ -430,7 +420,7 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt
sal_uInt16 iTarget = 0;
for ( sal_uInt16 i = 0 ; i < nCount; ++i )
{
- SbMethod* pMethod = (SbMethod*)pMod->GetMethods()->Get( i );
+ SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
if( pMethod->IsHidden() )
continue;
SAL_WARN_IF( !pMethod, "basctl.basicide","Method not found! (NULL)" );
@@ -455,18 +445,9 @@ bool HasMethod (
OUString aOUSource;
if ( rDocument.hasModule( rLibName, rModName ) && rDocument.getModule( rLibName, rModName, aOUSource ) )
{
- // Check if we really need to scan the source ( again )
- BasicManager* pBasMgr = rDocument.getBasicManager();
- StarBASIC* pSb = pBasMgr ? pBasMgr->GetLib( rLibName ) : NULL;
- SbModule* pMod = pSb ? pSb->FindModule( rModName ) : NULL;
- SbModuleRef xModule;
- if ( !pMod )
- {
- xModule = new SbModule( rModName );
- xModule->SetSource32( aOUSource );
- pMod = xModule;
- }
- SbxArray* pMethods = pMod->GetMethods();
+ SbModuleRef xModule = new SbModule( rModName );
+ xModule->SetSource32( aOUSource );
+ SbxArray* pMethods = xModule->GetMethods();
if ( pMethods )
{
SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, SbxCLASS_METHOD );