[Libreoffice-commits] core.git: basctl/source basic/qa basic/source include/basic include/sfx2 sd/source sfx2/source

Noel Grandin noel at peralex.com
Tue May 19 02:11:33 PDT 2015


 basctl/source/basicide/iderdll.cxx       |    4 ++--
 basctl/source/basicide/iderdll2.hxx      |    2 +-
 basic/qa/cppunit/basictest.hxx           |    8 ++++----
 basic/source/classes/sb.cxx              |   16 ++++++++--------
 basic/source/classes/sbxmod.cxx          |    8 ++++----
 basic/source/inc/sbintern.hxx            |    4 ++--
 include/basic/sbstar.hxx                 |   18 +++++++++---------
 include/sfx2/app.hxx                     |    2 +-
 sd/source/ui/slideshow/slideshowimpl.cxx |    4 ++--
 sd/source/ui/slideshow/slideshowimpl.hxx |    2 +-
 sfx2/source/appl/app.cxx                 |    8 ++++----
 11 files changed, 38 insertions(+), 38 deletions(-)

New commits:
commit ae451af87d01de3806abf1db474017d002092e4c
Author: Noel Grandin <noel at peralex.com>
Date:   Thu May 14 09:20:01 2015 +0200

    basic: used typed LINKs
    
    Change-Id: I8770a782e7ff5529e30aee13558711bdd8a4070d

diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index 24a2bf4..535397b 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -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))
diff --git a/basctl/source/basicide/iderdll2.hxx b/basctl/source/basicide/iderdll2.hxx
index 6359d17..e64b6a0 100644
--- a/basctl/source/basicide/iderdll2.hxx
+++ b/basctl/source/basicide/iderdll2.hxx
@@ -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();
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index 1638e05..f8ac9f8 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -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
 
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 3365053..01e6d94 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -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;
 }
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index a5b487c..568340e 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -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)
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index a82674e..931ad30 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -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...
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index fbe8d1d..4f75dc6 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -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();
 
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index cf4b02c..cf2b132 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -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 & );
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index de631df..adce12b 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -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
             }
 
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index 41270ad..3e8f00f 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -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;
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 290ded1..43fc768 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -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
 


More information about the Libreoffice-commits mailing list