LCOV - code coverage report
Current view: top level - libreoffice/sot/source/base - object.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 24 34 70.6 %
Date: 2012-12-27 Functions: 4 21 19.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <sot/object.hxx>
      21             : #include <sot/factory.hxx>
      22             : 
      23             : /************** class SotObject ******************************************/
      24           0 : class SotObjectFactory : public SotFactory
      25             : {
      26             : public:
      27             :          TYPEINFO();
      28           0 :         SotObjectFactory( const SvGlobalName & rName,
      29             :                               const String & rClassName,
      30             :                               CreateInstanceType pCreateFuncP )
      31           0 :             : SotFactory( rName, rClassName, pCreateFuncP )
      32           0 :         {}
      33             : };
      34           0 : TYPEINIT1(SotObjectFactory,SotFactory);
      35             : 
      36             : 
      37           0 : SO2_IMPL_BASIC_CLASS_DLL(SotObject,SotObjectFactory,
      38             :                     SvGlobalName( 0xf44b7830, 0xf83c, 0x11d0,
      39             :                             0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ) )
      40             : 
      41             : /*************************************************************************
      42             : |*    SotObject::SotObject()
      43             : |*
      44             : |*    Beschreibung
      45             : *************************************************************************/
      46        1391 : SotObject::SotObject()
      47             :     : nOwnerLockCount( 0 )
      48             :     , bOwner      ( sal_True )
      49             :     , bSVObject   ( sal_False )
      50        1391 :     , bInClose    ( sal_False )
      51             : {
      52        1391 :     SotFactory::IncSvObjectCount( this );
      53        1391 : }
      54             : 
      55             : /*************************************************************************
      56             : |*
      57             : |*    SotObject::~SotObject()
      58             : |*
      59             : *************************************************************************/
      60        1064 : SotObject::~SotObject()
      61             : {
      62        1064 :     SotFactory::DecSvObjectCount( this );
      63        2128 : }
      64             : 
      65             : /*************************************************************************
      66             : |*    SotObject::GetInterface()
      67             : |*
      68             : |*    Beschreibung: Um so3 zu helfen
      69             : *************************************************************************/
      70           0 : IUnknown * SotObject::GetInterface( const SvGlobalName & )
      71             : {
      72           0 :     return NULL;
      73             : }
      74             : 
      75             : //=========================================================================
      76         299 : void SotObject::OwnerLock
      77             : (
      78             :     sal_Bool bLock      /* sal_True, lock. sal_False, unlock. */
      79             : )
      80             : /*  [Beschreibung]
      81             : 
      82             :     Wenn der OwnerLock auf Null dekrementiert, dann wird die Methode
      83             :     DoClose gerufen. Dies geschieht unabh"angig vom Lock. bzw. RefCount.
      84             :     Ist der OwnerLock-Z"ahler != Null, dann wird kein DoClose durch
      85             :     <SotObject::FuzzyLock> gerufen.
      86             : */
      87             : {
      88         299 :     if( bLock )
      89             :     {
      90         236 :         nOwnerLockCount++;
      91         236 :         AddRef();
      92             :     }
      93          63 :     else if ( nOwnerLockCount )
      94             :     {
      95          63 :         if( 0 == --nOwnerLockCount )
      96          63 :             DoClose();
      97          63 :         ReleaseRef();
      98             :     }
      99         299 : }
     100             : 
     101             : //=========================================================================
     102          63 : sal_Bool SotObject::DoClose()
     103             : {
     104          63 :     sal_Bool bRet = sal_False;
     105          63 :     if( !bInClose )
     106             :     {
     107          63 :         SotObjectRef xHoldAlive( this );
     108          63 :         bInClose = sal_True;
     109          63 :         bRet = Close();
     110          63 :         bInClose = sal_False;
     111             :     }
     112          63 :     return bRet;
     113             : }
     114             : 
     115             : //=========================================================================
     116           0 : sal_Bool SotObject::Close()
     117             : {
     118           0 :     return sal_True;
     119             : }
     120             : 
     121             : 
     122             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10