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 : :
30 : : #include <main.hxx>
31 : : #include <chart.hxx>
32 : :
33 : : // ---------------------------------------------------------------
34 : :
35 : 0 : CGMChart::CGMChart( CGM& rCGM ) :
36 : 0 : mpCGM ( &rCGM )
37 : : {
38 : 0 : for ( sal_Int8 i = 0; i < 7; i++ )
39 : : {
40 : 0 : mDataNode[ i ].nBoxX1 = mDataNode[ i ].nBoxY1 = 0 ;
41 : 0 : mDataNode[ i ].nBoxX2 = mDataNode[ i ].nBoxY2 = 0 ;
42 : :
43 : 0 : mDataNode[ i ].nZoneEnum = i;
44 : : }
45 : 0 : };
46 : :
47 : : // ---------------------------------------------------------------
48 : :
49 : 0 : CGMChart::~CGMChart()
50 : : {
51 : : // delete the whole textentry structure
52 : :
53 : 0 : while( !maTextEntryList.empty() )
54 : : {
55 : 0 : DeleteTextEntry( maTextEntryList[ 0 ] );
56 : : }
57 : 0 : };
58 : :
59 : : // ---------------------------------------------------------------
60 : :
61 : 0 : void CGMChart::DeleteTextEntry( TextEntry* pTextEntry )
62 : : {
63 : 0 : if ( pTextEntry )
64 : : {
65 : 0 : delete pTextEntry->pText;
66 : 0 : for ( TextAttribute* pTAttr = pTextEntry->pAttribute; pTAttr != NULL ; )
67 : : {
68 : 0 : TextAttribute* pTempTAttr = pTAttr;
69 : 0 : pTAttr = pTAttr->pNextAttribute;
70 : 0 : delete pTempTAttr;
71 : : }
72 : 0 : ::std::vector< TextEntry* >::iterator it;
73 : 0 : for ( it = maTextEntryList.begin(); it != maTextEntryList.end(); ++it )
74 : : {
75 : 0 : if ( *it == pTextEntry )
76 : : {
77 : 0 : maTextEntryList.erase( it );
78 : 0 : break;
79 : : }
80 : : }
81 : 0 : delete pTextEntry;
82 : : }
83 : 0 : };
84 : :
85 : : // ---------------------------------------------------------------
86 : :
87 : 0 : void CGMChart::InsertTextEntry( TextEntry* pTextEntry )
88 : : {
89 : 0 : maTextEntryList.push_back( pTextEntry );
90 : 0 : };
91 : :
92 : : // ---------------------------------------------------------------
93 : :
94 : : // ---------------------------------------------------------------
95 : 0 : void CGMChart::ResetAnnotation()
96 : : {
97 : 0 : mDataNode[ 0 ].nZoneEnum = 0;
98 : 0 : }
99 : :
100 : : // ---------------------------------------------------------------
101 : :
102 : 0 : sal_Bool CGMChart::IsAnnotation()
103 : : {
104 : 0 : return ( mDataNode[ 0 ].nZoneEnum == 0 );
105 : : };
106 : :
107 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|