[Libreoffice-commits] .: basic/inc basic/source vbahelper/source

Noel Power noelp at kemper.freedesktop.org
Wed Oct 20 11:58:50 PDT 2010


 basic/inc/basic/sbx.hxx                  |    4 
 basic/source/classes/propacc.cxx         |    8 -
 basic/source/runtime/methods1.cxx        |    9 -
 basic/source/sbx/sbxobj.cxx              |   80 ----------------
 vbahelper/source/vbahelper/vbahelper.cxx |  152 -------------------------------
 vbahelper/source/vbahelper/vbashapes.cxx |   11 --
 6 files changed, 264 deletions(-)

New commits:
commit aaf95710d88a2db24bb1b7915a4f38e12f9030ac
Author: Povilas Kanapickas <povilas.kanapickas at gmail.com>
Date:   Wed Oct 20 19:57:00 2010 +0100

    remove non-compiled code

diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx
index 32d8a03..897b57c 100644
--- a/basic/inc/basic/sbx.hxx
+++ b/basic/inc/basic/sbx.hxx
@@ -77,11 +77,7 @@ struct SbxParamInfo
     ~SbxParamInfo() {}
 };
 
-//#if 0 // _SOLAR__PRIVATE
 SV_DECL_PTRARR_DEL(SbxParams,SbxParamInfo*,4,4)
-//#else
-//typedef SvPtrarr SbxParams;
-//#endif
 
 #endif
 
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx
index b7f49db..1094508 100644
--- a/basic/source/classes/propacc.cxx
+++ b/basic/source/classes/propacc.cxx
@@ -392,15 +392,7 @@ void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite
     // Get class names of struct
     String aServiceName( RTL_CONSTASCII_USTRINGPARAM("stardiv.uno.beans.PropertySet") );
 
-#if 0
-    // search service and instantiate
-    Reference< XMultiServiceFactory > xServiceManager = getProcessServiceFactory();
-    Reference< XInterface > xInterface;
-    if( xProv.is() )
-        xInterface = xProv->newInstance();
-#else
     Reference< XInterface > xInterface = (OWeakObject*) new SbPropertyValues();
-#endif
 
     SbxVariableRef refVar = rPar.Get(0);
     if( xInterface.is() )
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 8c8e6ec..e03833e 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -534,15 +534,6 @@ RTLFUNC(DoEvents)
 // don't undstand what upstream are up to
 // we already process application events etc. in between
 // basic runtime pcode ( on a timed basis )
-#if 0
-    // Dummy implementation as the following code leads
-    // to performance problems for unknown reasons
-    //Timer aTimer;
-    //aTimer.SetTimeout( 1 );
-    //aTimer.Start();
-    //while ( aTimer.IsActive() )
-    //	Application::Reschedule();
-#endif
     // always return 0
     rPar.Get(0)->PutInteger( 0 );
 }
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index c32f018..b964300 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -1062,86 +1062,6 @@ void SbxObject::GarbageCollection( ULONG nObjects )
 */
 
 {
-    (void)nObjects;
-    
-    static BOOL bInGarbageCollection = FALSE;
-    if ( bInGarbageCollection )
-        return;
-    bInGarbageCollection = TRUE;
-
-#if 0
-    // erstes Object dieser Runde anspringen
-    BOOL bAll = !nObjects;
-    if ( bAll )
-        rObjects.First();
-    SbxObject *pObj = rObjects.GetCurObject();
-    if ( !pObj )
-        pObj = rObjects.First();
-
-    while ( pObj && 0 != nObjects-- )
-    {
-        // hat der Parent nur noch 1 Ref-Count?
-        SbxObject *pParent = PTR_CAST( SbxObject, pObj->GetParent() );
-        if ( pParent && 1 == pParent->GetRefCount() )
-        {
-            // dann alle Properies des Objects durchsuchen
-            SbxArray *pProps = pObj->GetProperties();
-            for ( USHORT n = 0; n < pProps->Count(); ++n )
-            {
-                // verweist die Property auf den Parent des Object?
-                SbxVariable *pProp = pProps->Get(n);
-                const SbxValues &rValues = pProp->GetValues_Impl();
-                if ( SbxOBJECT == rValues.eType &&
-                     pParent == rValues.pObj )
-                {
-#ifdef DBG_UTIL
-                    DbgOutf( "SBX: %s.%s with Object %s was garbage",
-                             pObj->GetName().GetStr(),
-                             pProp->GetName().GetStr(),
-                             pParent->GetName().GetStr() );
-#endif
-                    // dann freigeben
-                    pProp->SbxValue::Clear();
-                    Sound::Beep();
-                    break;
-                }
-            }
-        }
-
-        // zum n"achsten
-        pObj = rObjects.Next();
-        if ( !bAll && !pObj )
-            pObj = rObjects.First();
-    }
-#endif
-
-// AB 28.10. Zur 507a vorerst raus, da SfxBroadcaster::Enable() wegfaellt
-#if 0
-#ifdef DBG_UTIL
-    SbxVarList_Impl &rVars = GetSbxData_Impl()->aVars;
-    DbgOutf( "SBX: garbage collector done, %lu objects remainding",
-             rVars.Count() );
-    if ( rVars.Count() > 200 && rVars.Count() < 210 )
-    {
-        SvFileStream aStream( "d:\\tmp\\dump.sbx", STREAM_STD_WRITE );
-        SfxBroadcaster::Enable(FALSE);
-        for ( ULONG n = 0; n < rVars.Count(); ++n )
-        {
-            SbxVariable *pVar = rVars.GetObject(n);
-            SbxObject *pObj = PTR_CAST(SbxObject, pVar);
-            USHORT nFlags = pVar->GetFlags();
-            pVar->SetFlag(SBX_NO_BROADCAST);
-            if ( pObj )
-                pObj->Dump(aStream);
-            else if ( !pVar->GetParent() || !pVar->GetParent()->ISA(SbxObject) )
-                pVar->Dump(aStream);
-            pVar->SetFlags(nFlags);
-        }
-        SfxBroadcaster::Enable(TRUE);
-    }
-#endif
-#endif
-    bInGarbageCollection = FALSE;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 78c4f24..d7996bc 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -119,158 +119,6 @@ nViewNo && !pView->GetObjectShell()->IsInPlaceActive() )
     }
     return false;
 }
-#if 0
-namespace excel // all in this namespace probably can be moved to sc
-{
-
-
-const ::rtl::OUString REPLACE_CELLS_WARNING(  RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning"));
-class PasteCellsWarningReseter
-{
-private:
-    bool bInitialWarningState;
-    static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException )
-    {
-        static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-        static uno::Reference<uno::XComponentContext > xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
-        static uno::Reference<lang::XMultiComponentFactory > xServiceManager(
-                xContext->getServiceManager(), uno::UNO_QUERY_THROW );
-        static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW );
-        return xProps;
-    }
-
-    bool getReplaceCellsWarning() throw ( uno::RuntimeException )
-    {
-        sal_Bool res = sal_False;
-        getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
-        return ( res == sal_True );
-    }
-
-    void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException )
-    {
-        getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) );
-    }
-public:
-    PasteCellsWarningReseter() throw ( uno::RuntimeException )
-    {
-        bInitialWarningState = getReplaceCellsWarning();
-        if ( bInitialWarningState )
-            setReplaceCellsWarning( false );
-    }
-    ~PasteCellsWarningReseter()
-    {
-        if ( bInitialWarningState )
-        {
-            // don't allow dtor to throw
-            try
-            {
-                setReplaceCellsWarning( true );
-            }
-            catch ( uno::Exception& /*e*/ ){}
-        }
-    }
-};
-
-void
-implnPaste()
-{
-    PasteCellsWarningReseter resetWarningBox;
-    ScTabViewShell* pViewShell = getCurrentBestViewShell();
-    if ( pViewShell )
-    {
-        pViewShell->PasteFromSystem();
-        pViewShell->CellContentChanged();
-    }
-}
-
-
-void
-implnCopy()
-{
-    ScTabViewShell* pViewShell = getCurrentBestViewShell();
-    if ( pViewShell )
-        pViewShell->CopyToClip(NULL,false,false,true);
-}
-
-void
-implnCut()
-{
-    ScTabViewShell* pViewShell =  getCurrentBestViewShell();
-    if ( pViewShell )
-        pViewShell->CutToClip( NULL, TRUE );
-}
-void implnPasteSpecial(SfxViewShell* pViewShell, USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
-{
-    PasteCellsWarningReseter resetWarningBox;
-    sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
-    InsCellCmd eMoveMode = INS_NONE;
-
-    if ( !pTabViewShell )
-        // none active, try next best
-        pTabViewShell = getCurrentBestViewShell();
-    if ( pTabViewShell )
-    {
-        ScViewData* pView = pTabViewShell->GetViewData();
-        Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
-        if ( pView && pWin )
-        {
-            if ( bAsLink && bOtherDoc )
-                pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK
-            else
-            {
-                ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
-                ScDocument* pDoc = NULL;
-                if ( pOwnClip )
-                    pDoc = pOwnClip->GetDocument();
-                pTabViewShell->PasteFromClip( nFlags, pDoc,
-                    nFunction, bSkipEmpty, bTranspose, bAsLink,
-                    eMoveMode, IDF_NONE, TRUE );
-                pTabViewShell->CellContentChanged();
-            }
-        }
-    }
-
-}
-
-ScDocShell*
-getDocShell( css::uno::Reference< css::frame::XModel>& xModel )
-{
-    uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
-    ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
-    ScDocShell* pDocShell = NULL;
-    if ( pModel )
-        pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
-    return pDocShell;
-
-}
-
-ScTabViewShell*
-getBestViewShell(  css::uno::Reference< css::frame::XModel>& xModel )
-{
-    ScDocShell* pDocShell = getDocShell( xModel );
-    if ( pDocShell )
-        return pDocShell->GetBestViewShell();
-    return NULL;
-}
-
-ScTabViewShell*
-getCurrentBestViewShell()
-{
-    uno::Reference< frame::XModel > xModel = getCurrentDocument();
-    return getBestViewShell( xModel );
-}
-
-SfxViewFrame*
-getCurrentViewFrame()
-{
-    ScTabViewShell* pViewShell = getCurrentBestViewShell();
-    if ( pViewShell )
-        return pViewShell->GetViewFrame();
-    return NULL;
-}
-};
-
-#endif
 
 uno::Reference< beans::XIntrospectionAccess >
 getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index 590426a..018da92 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -477,15 +477,4 @@ ScVbaShapes::createName( rtl::OUString sName )
     return sName;
 }
 
-#if 0
-//TODO helperapi using a writer document
-awt::Point
-calculateTopLeftMargin( uno::Reference< XHelperInterface > xDocument )
-{
-    awt::Point aPoint( 0, 0 );
-    uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY_THROW );
-    return awt::Point();
-}
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list