Update ooo320-m1
[ooovba.git] / goodies / source / filter.vcl / icgm / chart.cxx
blob74797cfa244d2670bdbbb9a90a3926e5e8e1444a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chart.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_goodies.hxx"
34 #include <main.hxx>
35 #include <chart.hxx>
37 // ---------------------------------------------------------------
39 CGMChart::CGMChart( CGM& rCGM ) :
40 mpCGM ( &rCGM )
42 for ( sal_Int8 i = 0; i < 7; i++ )
44 mDataNode[ i ].nBoxX1 = mDataNode[ i ].nBoxY1 = 0 ;
45 mDataNode[ i ].nBoxX2 = mDataNode[ i ].nBoxY2 = 0 ;
47 mDataNode[ i ].nZoneEnum = i;
51 // ---------------------------------------------------------------
53 CGMChart::~CGMChart()
55 // delete the whole textentry structure
57 TextEntry* pTextEntry;
58 while( ( pTextEntry = (TextEntry*)maTextEntryList.First() ) != NULL )
60 DeleteTextEntry( pTextEntry );
64 // ---------------------------------------------------------------
66 void CGMChart::DeleteTextEntry( TextEntry* pTextEntry )
68 if ( pTextEntry )
70 delete pTextEntry->pText;
71 for ( TextAttribute* pTAttr = pTextEntry->pAttribute; pTAttr != NULL ; )
73 TextAttribute* pTempTAttr = pTAttr;
74 pTAttr = pTAttr->pNextAttribute;
75 delete pTempTAttr;
77 delete pTextEntry;
78 maTextEntryList.Remove( pTextEntry );
82 // ---------------------------------------------------------------
84 void CGMChart::InsertTextEntry( TextEntry* pTextEntry )
86 maTextEntryList.Insert( pTextEntry );
89 // ---------------------------------------------------------------
91 // ---------------------------------------------------------------
92 void CGMChart::ResetAnnotation()
94 mDataNode[ 0 ].nZoneEnum = 0;
97 // ---------------------------------------------------------------
99 sal_Bool CGMChart::IsAnnotation()
101 return ( mDataNode[ 0 ].nZoneEnum == 0 );