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