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 <tools/debug.hxx>
30 : : #include "impastpl.hxx"
31 : :
32 : : using ::rtl::OUString;
33 : :
34 : : //#############################################################################
35 : : //
36 : : // Class XMLFamilyData_Impl
37 : : //
38 : :
39 : : ///////////////////////////////////////////////////////////////////////////////
40 : : //
41 : : // ctor/dtor class XMLFamilyData_Impl
42 : : //
43 : :
44 : 2750 : XMLFamilyData_Impl::XMLFamilyData_Impl(
45 : : sal_Int32 nFamily,
46 : : const ::rtl::OUString& rStrName,
47 : : const UniReference < SvXMLExportPropertyMapper > &rMapper,
48 : : const OUString& rStrPrefix,
49 : : sal_Bool bAsFam )
50 : : : pCache( 0 ), mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ),
51 [ + - ]: 2750 : mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), bAsFamily( bAsFam )
52 : :
53 : : {
54 [ + - ][ + - ]: 2750 : mpParentList = new SvXMLAutoStylePoolParentsP_Impl;
55 [ + - ][ + - ]: 2750 : mpNameList = new SvXMLAutoStylePoolNamesP_Impl;
56 : 2750 : }
57 : :
58 [ + - ]: 12541 : XMLFamilyData_Impl::~XMLFamilyData_Impl()
59 : : {
60 [ + + ][ + - ]: 12541 : delete mpParentList;
61 [ + + ]: 12541 : delete mpNameList;
62 : : DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" );
63 [ - + ]: 12541 : if( pCache )
64 : : {
65 [ # # ]: 0 : for ( size_t i = 0, n = pCache->size(); i < n; ++i )
66 [ # # ]: 0 : delete (*pCache)[ i ];
67 : 0 : pCache->clear();
68 [ # # ]: 0 : delete pCache;
69 : : }
70 : 12541 : }
71 : :
72 : 16 : void XMLFamilyData_Impl::ClearEntries()
73 : : {
74 [ + - ]: 16 : delete mpParentList;
75 [ + - ]: 16 : mpParentList = new SvXMLAutoStylePoolParentsP_Impl;
76 : : DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" );
77 [ - + ]: 16 : if( pCache )
78 : : {
79 [ # # ]: 0 : for ( size_t i = 0, n = pCache->size(); i < n; ++i )
80 [ # # ]: 0 : delete (*pCache)[ i ];
81 : 0 : pCache->clear();
82 : : }
83 : 16 : }
84 : :
85 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|