xref: /AOO41X/main/filter/source/graphicfilter/icgm/chart.cxx (revision 93ed1f2908b97a4746d8a0cef01e9c4b6219d66b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_filter.hxx"
26 
27 #include <main.hxx>
28 #include <chart.hxx>
29 
30 // ---------------------------------------------------------------
31 
CGMChart(CGM & rCGM)32 CGMChart::CGMChart( CGM& rCGM ) :
33     mpCGM       ( &rCGM )
34 {
35     for ( sal_Int8 i = 0; i < 7; i++ )
36     {
37         mDataNode[ i ].nBoxX1 = mDataNode[ i ].nBoxY1 = 0 ;
38         mDataNode[ i ].nBoxX2 = mDataNode[ i ].nBoxY2 = 0 ;
39 
40         mDataNode[ i ].nZoneEnum = i;
41     }
42 };
43 
44 // ---------------------------------------------------------------
45 
~CGMChart()46 CGMChart::~CGMChart()
47 {
48     // delete the whole textentry structure
49 
50     TextEntry* pTextEntry;
51     while( ( pTextEntry = (TextEntry*)maTextEntryList.First() ) != NULL )
52     {
53         DeleteTextEntry( pTextEntry );
54     }
55 };
56 
57 // ---------------------------------------------------------------
58 
DeleteTextEntry(TextEntry * pTextEntry)59 void CGMChart::DeleteTextEntry( TextEntry* pTextEntry )
60 {
61     if ( pTextEntry )
62     {
63         delete pTextEntry->pText;
64         for ( TextAttribute* pTAttr = pTextEntry->pAttribute; pTAttr != NULL ; )
65         {
66             TextAttribute* pTempTAttr = pTAttr;
67             pTAttr = pTAttr->pNextAttribute;
68             delete pTempTAttr;
69         }
70         maTextEntryList.Remove( pTextEntry );
71         delete pTextEntry;
72     }
73 };
74 
75 // ---------------------------------------------------------------
76 
InsertTextEntry(TextEntry * pTextEntry)77 void CGMChart::InsertTextEntry( TextEntry* pTextEntry )
78 {
79     maTextEntryList.Insert( pTextEntry );
80 };
81 
82 // ---------------------------------------------------------------
83 
84 // ---------------------------------------------------------------
ResetAnnotation()85 void CGMChart::ResetAnnotation()
86 {
87     mDataNode[ 0 ].nZoneEnum = 0;
88 }
89 
90 // ---------------------------------------------------------------
91 
IsAnnotation()92 sal_Bool CGMChart::IsAnnotation()
93 {
94     return ( mDataNode[ 0 ].nZoneEnum == 0 );
95 };
96 
97