LCOV - code coverage report
Current view: top level - sc/source/ui/app - msgpool.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 29 29 100.0 %
Date: 2012-08-25 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 38 72 52.8 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include "scitems.hxx"
      30                 :            : #include <svx/dialogs.hrc>
      31                 :            : 
      32                 :            : #include "sc.hrc"
      33                 :            : #include "docpool.hxx"
      34                 :            : #include "msgpool.hxx"
      35                 :            : 
      36                 :            : //------------------------------------------------------------------------
      37                 :            : 
      38                 :            : static SfxItemInfo const aMsgItemInfos[] =
      39                 :            : {
      40                 :            :     { 0,                         SFX_ITEM_POOLABLE },   // SCITEM_STRING
      41                 :            :     { 0,                         SFX_ITEM_POOLABLE },   // SCITEM_SEARCHDATA - nicht mehr benutzt !!!
      42                 :            :     { SID_SORT,                  SFX_ITEM_POOLABLE },   // SCITEM_SORTDATA
      43                 :            :     { SID_QUERY,                 SFX_ITEM_POOLABLE },   // SCITEM_QUERYDATA
      44                 :            :     { SID_SUBTOTALS,             SFX_ITEM_POOLABLE },   // SCITEM_SUBTDATA
      45                 :            :     { SID_CONSOLIDATE,           SFX_ITEM_POOLABLE },   // SCITEM_CONSOLIDATEDATA
      46                 :            :     { SID_PIVOT_TABLE,           SFX_ITEM_POOLABLE },   // SCITEM_PIVOTDATA
      47                 :            :     { SID_SOLVE,                 SFX_ITEM_POOLABLE },   // SCITEM_SOLVEDATA
      48                 :            :     { SID_SCUSERLISTS,           SFX_ITEM_POOLABLE },   // SCITEM_USERLIST
      49                 :            :     { SID_PRINTER_NOTFOUND_WARN, SFX_ITEM_POOLABLE }    // SCITEM_PRINTWARN
      50                 :            : };
      51                 :            : 
      52                 :            : //------------------------------------------------------------------------
      53                 :            : 
      54                 :         51 : ScMessagePool::ScMessagePool()
      55                 :            :     :   SfxItemPool         ( rtl::OUString("ScMessagePool"),
      56                 :            :                               MSGPOOL_START, MSGPOOL_END,
      57                 :            :                               aMsgItemInfos, NULL ),
      58                 :            :     //
      59                 :            :     aGlobalStringItem       ( SfxStringItem         ( SCITEM_STRING, String() ) ),
      60                 :            :     aGlobalSearchItem       ( SvxSearchItem         ( SCITEM_SEARCHDATA ) ),
      61                 :            :     aGlobalSortItem         ( ScSortItem            ( SCITEM_SORTDATA, NULL ) ),
      62                 :            :     aGlobalQueryItem        ( ScQueryItem           ( SCITEM_QUERYDATA, NULL, NULL ) ),
      63                 :            :     aGlobalSubTotalItem     ( ScSubTotalItem        ( SCITEM_SUBTDATA, NULL, NULL ) ),
      64                 :            :     aGlobalConsolidateItem  ( ScConsolidateItem     ( SCITEM_CONSOLIDATEDATA, NULL ) ),
      65                 :            :     aGlobalPivotItem        ( ScPivotItem           ( SCITEM_PIVOTDATA, NULL, NULL, false ) ),
      66                 :            :     aGlobalSolveItem        ( ScSolveItem           ( SCITEM_SOLVEDATA, NULL ) ),
      67                 :            :     aGlobalUserListItem     ( ScUserListItem        ( SCITEM_USERLIST ) ),
      68                 :            :     //
      69 [ +  - ][ +  - ]:         51 :     aPrintWarnItem          ( SfxBoolItem           ( SCITEM_PRINTWARN, false ) )
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
      70                 :            : {
      71         [ +  - ]:         51 :     ppPoolDefaults = new SfxPoolItem*[MSGPOOL_END - MSGPOOL_START + 1];
      72                 :            : 
      73                 :         51 :     ppPoolDefaults[SCITEM_STRING            - MSGPOOL_START] = &aGlobalStringItem;
      74                 :         51 :     ppPoolDefaults[SCITEM_SEARCHDATA        - MSGPOOL_START] = &aGlobalSearchItem;
      75                 :         51 :     ppPoolDefaults[SCITEM_SORTDATA          - MSGPOOL_START] = &aGlobalSortItem;
      76                 :         51 :     ppPoolDefaults[SCITEM_QUERYDATA         - MSGPOOL_START] = &aGlobalQueryItem;
      77                 :         51 :     ppPoolDefaults[SCITEM_SUBTDATA          - MSGPOOL_START] = &aGlobalSubTotalItem;
      78                 :         51 :     ppPoolDefaults[SCITEM_CONSOLIDATEDATA   - MSGPOOL_START] = &aGlobalConsolidateItem;
      79                 :         51 :     ppPoolDefaults[SCITEM_PIVOTDATA         - MSGPOOL_START] = &aGlobalPivotItem;
      80                 :         51 :     ppPoolDefaults[SCITEM_SOLVEDATA         - MSGPOOL_START] = &aGlobalSolveItem;
      81                 :         51 :     ppPoolDefaults[SCITEM_USERLIST          - MSGPOOL_START] = &aGlobalUserListItem;
      82                 :         51 :     ppPoolDefaults[SCITEM_PRINTWARN         - MSGPOOL_START] = &aPrintWarnItem;
      83                 :            : 
      84         [ +  - ]:         51 :     SetDefaults( ppPoolDefaults );
      85                 :            : 
      86 [ +  - ][ +  - ]:         51 :     pDocPool = new ScDocumentPool;
      87                 :            : 
      88         [ +  - ]:         51 :     SetSecondaryPool( pDocPool );
      89                 :         51 : }
      90                 :            : 
      91                 :            : 
      92 [ +  - ][ +  - ]:         18 : ScMessagePool::~ScMessagePool()
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
      93                 :            : {
      94         [ +  - ]:         18 :     Delete();
      95         [ +  - ]:         18 :     SetSecondaryPool( NULL );       // before deleting defaults (accesses defaults)
      96                 :            : 
      97         [ +  + ]:        198 :     for ( sal_uInt16 i=0; i <= MSGPOOL_END-MSGPOOL_START; i++ )
      98                 :        180 :         SetRefCount( *ppPoolDefaults[i], 0 );
      99                 :            : 
     100         [ +  - ]:         18 :     delete[] ppPoolDefaults;
     101                 :            : 
     102         [ +  - ]:         18 :     SfxItemPool::Free(pDocPool);
     103         [ -  + ]:         36 : }
     104                 :            : 
     105                 :            : 
     106                 :      39106 : SfxMapUnit ScMessagePool::GetMetric( sal_uInt16 nWhich ) const
     107                 :            : {
     108                 :            :     //  eigene Attribute: Twips, alles andere 1/100 mm
     109                 :            : 
     110 [ +  - ][ +  + ]:      39106 :     if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
     111                 :       1752 :         return SFX_MAPUNIT_TWIP;
     112                 :            :     else
     113                 :      39106 :         return SFX_MAPUNIT_100TH_MM;
     114                 :            : }
     115                 :            : 
     116                 :            : 
     117                 :            : 
     118                 :            : 
     119                 :            : 
     120                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10