LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/xmloff/source/style - impastp1.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 15 22 68.2 %
Date: 2013-07-09 Functions: 3 3 100.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 <tools/debug.hxx>
      21             : #include "impastpl.hxx"
      22             : 
      23             : 
      24             : //#############################################################################
      25             : //
      26             : // Class XMLFamilyData_Impl
      27             : //
      28             : 
      29             : ///////////////////////////////////////////////////////////////////////////////
      30             : //
      31             : // ctor/dtor class XMLFamilyData_Impl
      32             : //
      33             : 
      34        1866 : XMLFamilyData_Impl::XMLFamilyData_Impl(
      35             :         sal_Int32 nFamily,
      36             :         const OUString& rStrName,
      37             :         const UniReference < SvXMLExportPropertyMapper > &rMapper,
      38             :         const OUString& rStrPrefix,
      39             :         sal_Bool bAsFam )
      40             :     : pCache( 0 ), mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ),
      41        1866 :       mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), bAsFamily( bAsFam )
      42             : 
      43             : {
      44        1866 :     mpParentList = new SvXMLAutoStylePoolParentsP_Impl;
      45        1866 :     mpNameList   = new SvXMLAutoStylePoolNamesP_Impl;
      46        1866 : }
      47             : 
      48       18086 : XMLFamilyData_Impl::~XMLFamilyData_Impl()
      49             : {
      50        9043 :     delete mpParentList;
      51        9043 :     delete mpNameList;
      52             :     DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" );
      53        9043 :     if( pCache )
      54             :     {
      55           0 :         for ( size_t i = 0, n = pCache->size(); i < n; ++i )
      56           0 :             delete (*pCache)[ i ];
      57           0 :         pCache->clear();
      58           0 :         delete pCache;
      59             :     }
      60        9043 : }
      61             : 
      62          16 : void XMLFamilyData_Impl::ClearEntries()
      63             : {
      64          16 :     delete mpParentList;
      65          16 :     mpParentList = new SvXMLAutoStylePoolParentsP_Impl;
      66             :     DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" );
      67          16 :     if( pCache )
      68             :     {
      69           0 :         for ( size_t i = 0, n = pCache->size(); i < n; ++i )
      70           0 :             delete (*pCache)[ i ];
      71           0 :         pCache->clear();
      72             :     }
      73          16 : }
      74             : 
      75             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10