basic: used typed LINKs
Change-Id: I8770a782e7ff5529e30aee13558711bdd8a4070d
This commit is contained in:
parent
acc4c466c3
commit
ae451af87d
@ -174,9 +174,9 @@ void ExtraData::SetSearchItem (const SvxSearchItem& rItem)
|
||||
pSearchItem.reset(static_cast<SvxSearchItem*>(rItem.Clone()));
|
||||
}
|
||||
|
||||
IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic)
|
||||
IMPL_STATIC_LINK_TYPED(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, sal_uInt16)
|
||||
{
|
||||
long nRet = 0;
|
||||
sal_uInt16 nRet = 0;
|
||||
if (Shell* pShell = GetShell())
|
||||
{
|
||||
if (BasicManager* pBasMgr = FindBasicManager(pBasic))
|
||||
|
@ -50,7 +50,7 @@ private:
|
||||
bool bShellInCriticalSection;
|
||||
|
||||
protected:
|
||||
DECL_STATIC_LINK( ExtraData, GlobalBasicBreakHdl, StarBASIC * );
|
||||
DECL_STATIC_LINK_TYPED( ExtraData, GlobalBasicBreakHdl, StarBASIC *, sal_uInt16 );
|
||||
|
||||
public:
|
||||
ExtraData();
|
||||
|
@ -125,7 +125,7 @@ class MacroSnippet
|
||||
return !mbError;
|
||||
}
|
||||
|
||||
DECL_LINK( BasicErrorHdl, StarBASIC * );
|
||||
DECL_LINK_TYPED( BasicErrorHdl, StarBASIC *, bool );
|
||||
|
||||
static ErrorDetail GetError()
|
||||
{
|
||||
@ -140,18 +140,18 @@ class MacroSnippet
|
||||
|
||||
void ResetError()
|
||||
{
|
||||
StarBASIC::SetGlobalErrorHdl( Link<>() );
|
||||
StarBASIC::SetGlobalErrorHdl( Link<StarBASIC*,bool>() );
|
||||
mbError = false;
|
||||
}
|
||||
};
|
||||
|
||||
IMPL_LINK( MacroSnippet, BasicErrorHdl, StarBASIC *, /*pBasic*/)
|
||||
IMPL_LINK_TYPED( MacroSnippet, BasicErrorHdl, StarBASIC *, /*pBasic*/, bool)
|
||||
{
|
||||
fprintf(stderr,"(%d:%d)\n",
|
||||
StarBASIC::GetLine(), StarBASIC::GetCol1());
|
||||
fprintf(stderr,"Basic error: %s\n", OUStringToOString( StarBASIC::GetErrorText(), RTL_TEXTENCODING_UTF8 ).getStr() );
|
||||
mbError = true;
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1486,7 +1486,7 @@ sal_uInt16 StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
|
||||
bBreak = true;
|
||||
if( GetSbData()->aBreakHdl.IsSet() )
|
||||
{
|
||||
return (sal_uInt16) GetSbData()->aBreakHdl.Call( this );
|
||||
return GetSbData()->aBreakHdl.Call( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1500,7 +1500,7 @@ sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
|
||||
bBreak = false;
|
||||
if( GetSbData()->aBreakHdl.IsSet() )
|
||||
{
|
||||
return (sal_uInt16) GetSbData()->aBreakHdl.Call( this );
|
||||
return GetSbData()->aBreakHdl.Call( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1510,7 +1510,7 @@ sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
|
||||
|
||||
sal_uInt16 StarBASIC::BreakHdl()
|
||||
{
|
||||
return (sal_uInt16) ( aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE );
|
||||
return aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE;
|
||||
}
|
||||
|
||||
// Calls for error handler and break handler
|
||||
@ -1721,7 +1721,7 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
|
||||
bool bRet;
|
||||
if( GetSbData()->aErrHdl.IsSet() )
|
||||
{
|
||||
bRet = (bool) GetSbData()->aErrHdl.Call( this );
|
||||
bRet = GetSbData()->aErrHdl.Call( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1769,7 +1769,7 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In
|
||||
SetErrorData( code, l, c1, c2 );
|
||||
if( GetSbData()->aErrHdl.IsSet() )
|
||||
{
|
||||
return (bool) GetSbData()->aErrHdl.Call( this );
|
||||
return GetSbData()->aErrHdl.Call( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1848,17 +1848,17 @@ bool StarBASIC::ErrorHdl()
|
||||
return aErrorHdl.IsSet() && aErrorHdl.Call( this );
|
||||
}
|
||||
|
||||
Link<> StarBASIC::GetGlobalErrorHdl()
|
||||
Link<StarBASIC*,bool> StarBASIC::GetGlobalErrorHdl()
|
||||
{
|
||||
return GetSbData()->aErrHdl;
|
||||
}
|
||||
|
||||
void StarBASIC::SetGlobalErrorHdl( const Link<>& rLink )
|
||||
void StarBASIC::SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rLink )
|
||||
{
|
||||
GetSbData()->aErrHdl = rLink;
|
||||
}
|
||||
|
||||
void StarBASIC::SetGlobalBreakHdl( const Link<>& rLink )
|
||||
void StarBASIC::SetGlobalBreakHdl( const Link<StarBASIC*,sal_uInt16>& rLink )
|
||||
{
|
||||
GetSbData()->aBreakHdl = rLink;
|
||||
}
|
||||
|
@ -1724,7 +1724,7 @@ bool SbModule::ExceedsLegacyModuleSize()
|
||||
|
||||
class ErrorHdlResetter
|
||||
{
|
||||
Link<> mErrHandler;
|
||||
Link<StarBASIC*,bool> mErrHandler;
|
||||
bool mbError;
|
||||
public:
|
||||
ErrorHdlResetter() : mbError( false )
|
||||
@ -1739,14 +1739,14 @@ public:
|
||||
// restore error handler
|
||||
StarBASIC::SetGlobalErrorHdl(mErrHandler);
|
||||
}
|
||||
DECL_LINK( BasicErrorHdl, StarBASIC * );
|
||||
DECL_LINK_TYPED( BasicErrorHdl, StarBASIC *, bool );
|
||||
bool HasError() { return mbError; }
|
||||
};
|
||||
|
||||
IMPL_LINK( ErrorHdlResetter, BasicErrorHdl, StarBASIC *, /*pBasic*/)
|
||||
IMPL_LINK_TYPED( ErrorHdlResetter, BasicErrorHdl, StarBASIC *, /*pBasic*/, bool)
|
||||
{
|
||||
mbError = true;
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void SbModule::GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache)
|
||||
|
@ -91,8 +91,8 @@ struct SbiGlobals
|
||||
SbModule* pMod; // currently active module
|
||||
SbModule* pCompMod; // currently compiled module
|
||||
short nInst; // number of BASICs
|
||||
Link<> aErrHdl; // global error handler
|
||||
Link<> aBreakHdl; // global break handler
|
||||
Link<StarBASIC*,bool> aErrHdl; // global error handler
|
||||
Link<StarBASIC*,sal_uInt16> aBreakHdl; // global break handler
|
||||
SbError nCode;
|
||||
sal_Int32 nLine;
|
||||
sal_Int32 nCol1,nCol2; // from... to...
|
||||
|
@ -54,8 +54,8 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
|
||||
SbxArrayRef xUnoListeners; // Listener handled by CreateUnoListener
|
||||
|
||||
// Handler-Support:
|
||||
Link<> aErrorHdl; // Error handler
|
||||
Link<> aBreakHdl; // Breakpoint handler
|
||||
Link<StarBASIC*,bool> aErrorHdl; // Error handler
|
||||
Link<StarBASIC*,sal_uInt16> aBreakHdl; // Breakpoint handler
|
||||
bool bNoRtl; // if true: do not search RTL
|
||||
bool bBreak; // if true: Break, otherwise Step
|
||||
bool bDocBasic;
|
||||
@ -148,14 +148,14 @@ public:
|
||||
static SbError GetSfxFromVBError( sal_uInt16 nError );
|
||||
bool IsBreak() const { return bBreak; }
|
||||
|
||||
static Link<> GetGlobalErrorHdl();
|
||||
static void SetGlobalErrorHdl( const Link<>& rNewHdl );
|
||||
Link<> GetErrorHdl() const { return aErrorHdl; }
|
||||
void SetErrorHdl( const Link<>& r ) { aErrorHdl = r; }
|
||||
static Link<StarBASIC*,bool> GetGlobalErrorHdl();
|
||||
static void SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rNewHdl );
|
||||
Link<StarBASIC*,bool> GetErrorHdl() const { return aErrorHdl; }
|
||||
void SetErrorHdl( const Link<StarBASIC*,bool>& r ) { aErrorHdl = r; }
|
||||
|
||||
static void SetGlobalBreakHdl( const Link<>& rNewHdl );
|
||||
Link<> GetBreakHdl() const { return aBreakHdl; }
|
||||
void SetBreakHdl( const Link<>& r ) { aBreakHdl = r; }
|
||||
static void SetGlobalBreakHdl( const Link<StarBASIC*,sal_uInt16>& rNewHdl );
|
||||
Link<StarBASIC*,sal_uInt16> GetBreakHdl() const { return aBreakHdl; }
|
||||
void SetBreakHdl( const Link<StarBASIC*,sal_uInt16>& r ) { aBreakHdl = r; }
|
||||
|
||||
SbxArrayRef getUnoListeners();
|
||||
|
||||
|
@ -118,7 +118,7 @@ class SFX2_DLLPUBLIC SfxApplication: public SfxShell
|
||||
|
||||
SfxAppData_Impl* pAppData_Impl;
|
||||
|
||||
DECL_DLLPRIVATE_LINK( GlobalBasicErrorHdl_Impl, StarBASIC* );
|
||||
DECL_DLLPRIVATE_LINK_TYPED( GlobalBasicErrorHdl_Impl, StarBASIC*, bool );
|
||||
|
||||
static SfxApplication* Create();
|
||||
void SettingsChange( sal_uInt16, const AppSettings & );
|
||||
|
@ -669,7 +669,7 @@ void SAL_CALL SlideshowImpl::disposing()
|
||||
#if HAVE_FEATURE_SCRIPTING
|
||||
// restore StarBASICErrorHdl
|
||||
StarBASIC::SetGlobalErrorHdl(maStarBASICGlobalErrorHdl);
|
||||
maStarBASICGlobalErrorHdl = Link<>();
|
||||
maStarBASICGlobalErrorHdl = Link<StarBASIC*,bool>();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -983,7 +983,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
|
||||
#if HAVE_FEATURE_SCRIPTING
|
||||
// disable basic ide error handling
|
||||
maStarBASICGlobalErrorHdl = StarBASIC::GetGlobalErrorHdl();
|
||||
StarBASIC::SetGlobalErrorHdl( Link<>() );
|
||||
StarBASIC::SetGlobalErrorHdl( Link<StarBASIC*,bool>() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ private:
|
||||
Pointer maPencil;
|
||||
std::vector< VclPtr< ::sd::Window> > maDrawModeWindows;
|
||||
VclPtr< ::sd::Window> mpOldActiveWindow;
|
||||
Link<> maStarBASICGlobalErrorHdl;
|
||||
Link<StarBASIC*,bool> maStarBASICGlobalErrorHdl;
|
||||
unsigned long mnChildMask;
|
||||
bool mbGridVisible;
|
||||
bool mbBordVisible;
|
||||
|
@ -481,11 +481,11 @@ extern "C" void *basicide_macro_organizer(sal_Int16);
|
||||
|
||||
#endif
|
||||
|
||||
IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
|
||||
IMPL_LINK_TYPED( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic, bool )
|
||||
{
|
||||
#if !HAVE_FEATURE_SCRIPTING
|
||||
(void) pStarBasic;
|
||||
return 0;
|
||||
return false;
|
||||
#else
|
||||
|
||||
#ifndef DISABLE_DYNLOADING
|
||||
@ -499,11 +499,11 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
|
||||
aMod.release();
|
||||
|
||||
// call basicide_handle_basic_error in basctl
|
||||
long nRet = pSymbol ? pSymbol( pStarBasic ) : 0;
|
||||
bool nRet = pSymbol && pSymbol( pStarBasic );
|
||||
|
||||
#else
|
||||
|
||||
long nRet = basicide_handle_basic_error( pStarBasic );
|
||||
bool nRet = basicide_handle_basic_error( pStarBasic );
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user