summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-11-01 15:17:35 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-11-01 15:17:35 +0100
commitd00aea1a6e428a46a5032122d6f22c054e3c07a2 (patch)
treebc3521661c975af92d5407ff359635d8acca49de /sfx2
parent952bfc2f29732777c0cdd79170f6a47ecc3ac4c7 (diff)
undoapi: removed SfxMacroConfig::CheckMacro/IsBasic, SfxObjectShell::IsBasic, SfxCallMacro - this was dead code
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/macrconf.hxx7
-rw-r--r--sfx2/inc/sfx2/objsh.hxx1
-rw-r--r--sfx2/inc/sfxbasic.hxx4
-rw-r--r--sfx2/source/control/macrconf.cxx165
-rw-r--r--sfx2/source/doc/objmisc.cxx9
-rw-r--r--sfx2/source/view/viewfrm.cxx10
6 files changed, 0 insertions, 196 deletions
diff --git a/sfx2/inc/sfx2/macrconf.hxx b/sfx2/inc/sfx2/macrconf.hxx
index 6b50ddf3497a..d84edd626d7b 100644
--- a/sfx2/inc/sfx2/macrconf.hxx
+++ b/sfx2/inc/sfx2/macrconf.hxx
@@ -59,8 +59,6 @@ class SFX2_DLLPUBLIC SfxMacroInfo
{
friend class SfxMacroConfig;
friend class SfxEventConfiguration;
-friend SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo);
-friend SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo);
String* pHelpText;
sal_uInt16 nRefCnt;
@@ -80,8 +78,6 @@ public:
const String& rModuleName, const String& rMethodName);
~SfxMacroInfo();
sal_Bool operator==(const SfxMacroInfo& rOther) const;
- int Load (SvStream&);
- int Store (SvStream&);
String GetMacroName() const;
String GetQualifiedName() const;
String GetFullQualifiedName() const;
@@ -127,7 +123,6 @@ public:
static String RequestHelp( sal_uInt16 nId );
static sal_Bool IsMacroSlot( sal_uInt16 nId );
- static sal_Bool IsBasic( SbxObject*, const String&, BasicManager* );
static ErrCode Call( SbxObject*, const String&, BasicManager*,
SbxArray *pArgs=NULL, SbxValue *pRet=NULL );
//ASDBG obsolete >= 582
@@ -141,8 +136,6 @@ public:
SfxMacroInfo* GetMacroInfo(sal_uInt16 nId) const;
sal_Bool ExecuteMacro(sal_uInt16 nId, const String& rArgs ) const;
sal_Bool ExecuteMacro( SfxObjectShell*, const SvxMacro*, const String& ) const;
- sal_Bool CheckMacro(sal_uInt16 nId) const;
- sal_Bool CheckMacro( SfxObjectShell*, const SvxMacro* ) const;
//#if 0 // _SOLAR__PRIVATE
SAL_DLLPRIVATE static void Release_Impl();
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index c2120dd1a32c..d256dbee81c0 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -363,7 +363,6 @@ public:
virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet& );
- sal_Bool IsBasic( const String & rCode, SbxObject * pVCtrl = NULL );
ErrCode CallBasic( const String& rMacro, const String& rBasicName,
SbxObject* pVCtrl, SbxArray* pArgs = 0, SbxValue* pRet = 0 );
diff --git a/sfx2/inc/sfxbasic.hxx b/sfx2/inc/sfxbasic.hxx
index ff5f097500a5..fe4a7070ea18 100644
--- a/sfx2/inc/sfxbasic.hxx
+++ b/sfx2/inc/sfxbasic.hxx
@@ -34,9 +34,5 @@ class SbMethod;
SbMethod* SfxQueryMacro( BasicManager* pMgr, const String& rMacro );
-ErrCode SfxCallMacro( BasicManager* pMgr, const String& rMacro,
- SbxArray *pArgs = 0, SbxValue *pRet = 0 );
-
-
#endif
diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx
index 9e8657ae0c82..11a02f9ae9ec 100644
--- a/sfx2/source/control/macrconf.cxx
+++ b/sfx2/source/control/macrconf.cxx
@@ -152,26 +152,6 @@ SbMethod* SfxQueryMacro( BasicManager* pMgr , const String& rMacro )
return SfxQueryMacro_Impl( pMgr, aMacro, aLibName, aModule );
}
-ErrCode SfxCallMacro( BasicManager* pMgr, const String& rCode,
- SbxArray *pArgs, SbxValue *pRet )
-{
- ErrCode nErr;
- SfxApplication *pApp = SFX_APP();
- pApp->EnterBasicCall();
- SbMethod* pMethod = SfxQueryMacro( pMgr, rCode );
- if ( pMethod )
- {
- if ( pArgs )
- pMethod->SetParameters( pArgs );
- nErr = pMethod->Call( pRet );
- }
- else
- nErr = ERRCODE_BASIC_PROC_UNDEFINED;
-
- pApp->LeaveBasicCall();
- return nErr;
-}
-
//==========================================================================
SfxMacroInfo::SfxMacroInfo( const String& rURL ) :
@@ -411,83 +391,6 @@ void SfxMacroInfo::SetHelpText( const String& rName )
*pHelpText = rName;
}
-//==========================================================================
-
-SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo)
-{
- sal_uInt16 nAppBasic, nFileVersion;
- String aDocName;
-
- rStream >> nFileVersion;
- if ( nVersion < nCompatVersion )
- {
- // In der 1.Version ohne Versionskennung
- nAppBasic = nVersion;
- nFileVersion = 1;
- rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
- }
- else
- {
- String aInput;
- rStream >> nAppBasic;
- rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); // Vorsicht: kann bei AppName Unsinn sein!
- rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(aInput,RTL_TEXTENCODING_UTF8);
-
- if ( nFileVersion == nCompatVersion )
- rInfo.aMethodName = aInput;
- else
- {
- sal_uInt16 nCount = aInput.GetTokenCount('.');
- rInfo.aMethodName = aInput.GetToken( nCount-1, '.' );
- if ( nCount > 1 )
- rInfo.aModuleName = aInput.GetToken( nCount-2, '.' );
- if ( nCount > 2 )
- rInfo.aLibName = aInput.GetToken( 0, '.' );
- }
- }
-
- rInfo.bAppBasic = (sal_Bool) nAppBasic;
- return rStream;
-}
-
-int SfxMacroInfo::Load( SvStream& rStream )
-{
- rStream >> (*this);
- nSlotId = SFX_APP()->GetMacroConfig()->GetSlotId(this);
- return 0;
-}
-
-//==========================================================================
-
-SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo)
-{
- if ( rInfo.bAppBasic )
- {
- rStream << nVersion
- << (sal_uInt16) rInfo.bAppBasic;
- rStream.WriteByteString(rInfo.GetBasicName(),RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
- }
- else
- {
- rStream << nVersion
- << (sal_uInt16) rInfo.bAppBasic;
- rStream.WriteByteString(SFX_APP()->GetName(),RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
- }
-
- return rStream;
-}
-
sal_Bool SfxMacroInfo::Compare( const SvxMacro& rMacro ) const
{
String aName = rMacro.GetLibName();
@@ -757,62 +660,6 @@ sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMac
return ( nErr == ERRCODE_NONE );
}
-sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro ) const
-{
- SfxApplication *pApp = SFX_APP();
-
- // Name des Macros oder Scripts bzw. ScriptCode
- String aCode( pMacro->GetMacName() );
- ErrCode nErr = ERRCODE_NONE;
-
- // BasicManager von Document oder Application
- pApp->EnterBasicCall();
- BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
- BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
-
- // Da leider der Name zwischendurch h"aufig gewechselt hat ...
- if( SFX_APP()->GetName() == pMacro->GetLibName() ||
- pMacro->GetLibName().EqualsAscii("StarDesktop") )
- pMgr = pAppMgr;
- else if ( pMgr == pAppMgr )
- pMgr = NULL;
-
- if ( !pMgr || !SfxQueryMacro( pMgr, aCode ) )
- nErr = SbxERR_NO_METHOD;
- pApp->LeaveBasicCall();
- return ( nErr == ERRCODE_NONE );
-}
-
-//==========================================================================
-
-sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const
-{
- const SfxMacroInfo* pInfo = GetMacroInfo( nId );
- if ( !pInfo )
- return sal_False;
-
- // Basic nur initialisieren, wenn default nicht ::com::sun::star::script::JavaScript; dann mu\s
- // in IsBasic() sowieso das Basic angelegt werden
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- SfxApplication *pApp = SFX_APP();
- pApp->EnterBasicCall();
-
- // BasicManager von Document oder Application
- BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
- BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
-
- if( SFX_APP()->GetName() == pInfo->GetBasicName() )
- pMgr = SFX_APP()->GetBasicManager();
- else if ( pMgr == pAppMgr )
- pMgr = NULL;
-
- String aFull( pInfo->GetQualifiedName() );
- sal_Bool bIsBasic = pMgr ? IsBasic( 0, aFull, pMgr ) : sal_False;
- pApp->LeaveBasicCall();
- return bIsBasic;
-}
-
//==========================================================================
IMPL_LINK( SfxMacroConfig, CallbackHdl_Impl, SfxMacroConfig*, pConfig )
@@ -829,18 +676,6 @@ IMPL_LINK( SfxMacroConfig, EventHdl_Impl, SfxMacroInfo*, pInfo )
return 0;
}
-sal_Bool SfxMacroConfig::IsBasic(
- SbxObject* /*pVCtrl*/,
- const String& rCode,
- BasicManager* pMgr )
-{
- sal_Bool bFound;
- SFX_APP()->EnterBasicCall();
- bFound = SfxQueryMacro( pMgr, rCode ) != 0;
- SFX_APP()->LeaveBasicCall();
- return bFound;
-}
-
ErrCode SfxMacroConfig::Call(
SbxObject* /*pVCtrl*/,
const String& rCode,
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a0dbc988d6ce..18571366e80e 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1651,13 +1651,6 @@ SfxModule* SfxObjectShell::GetModule() const
return GetFactory().GetModule();
}
-sal_Bool SfxObjectShell::IsBasic(
- const String & rCode, SbxObject * pVCtrl )
-{
- if( !rCode.Len() ) return sal_False;
- return SfxMacroConfig::IsBasic( pVCtrl, rCode, GetBasicManager() );
-}
-
ErrCode SfxObjectShell::CallBasic( const String& rMacro,
const String& rBasic, SbxObject* pVCtrl, SbxArray* pArgs,
SbxValue* pRet )
@@ -1669,12 +1662,10 @@ ErrCode SfxObjectShell::CallBasic( const String& rMacro,
return ERRCODE_IO_ACCESSDENIED;
}
- pApp->EnterBasicCall();
BasicManager *pMgr = GetBasicManager();
if( pApp->GetName() == rBasic )
pMgr = pApp->GetBasicManager();
ErrCode nRet = SfxMacroConfig::Call( pVCtrl, rMacro, pMgr, pArgs, pRet );
- pApp->LeaveBasicCall();
return nRet;
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 39ba693758c8..8e63753b00b5 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2883,8 +2883,6 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro )
}
}
- pSfxApp->EnterBasicCall();
-
BasicManager* pBasMgr = 0;
if ( aLocation.EqualsIgnoreCaseAscii( "application" ) )
{
@@ -3017,19 +3015,11 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro )
}
}
}
-
- pSfxApp->LeaveBasicCall();
}
else
{
// add code for "session only" macro
}
-
- /*
- FILE* pFile = fopen( "macro.bas", "a" );
- fprintf( pFile, "%s", ::rtl::OUStringToOString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8).getStr() );
- fclose ( pFile );
- */
}
void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )