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

Generated by: LCOV version 1.10