bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / graphicfilter / icgm / chart.cxx
blobd66ca34418833a256710a0067ae6bbf03e27395f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <main.hxx>
22 #include <chart.hxx>
24 // ---------------------------------------------------------------
26 CGMChart::CGMChart( CGM& rCGM ) :
27 mpCGM ( &rCGM )
29 for ( sal_Int8 i = 0; i < 7; i++ )
31 mDataNode[ i ].nBoxX1 = mDataNode[ i ].nBoxY1 = 0 ;
32 mDataNode[ i ].nBoxX2 = mDataNode[ i ].nBoxY2 = 0 ;
34 mDataNode[ i ].nZoneEnum = i;
38 // ---------------------------------------------------------------
40 CGMChart::~CGMChart()
42 // delete the whole textentry structure
44 while( !maTextEntryList.empty() )
46 DeleteTextEntry( maTextEntryList[ 0 ] );
50 // ---------------------------------------------------------------
52 void CGMChart::DeleteTextEntry( TextEntry* pTextEntry )
54 if ( pTextEntry )
56 delete pTextEntry->pText;
57 for ( TextAttribute* pTAttr = pTextEntry->pAttribute; pTAttr != NULL ; )
59 TextAttribute* pTempTAttr = pTAttr;
60 pTAttr = pTAttr->pNextAttribute;
61 delete pTempTAttr;
63 ::std::vector< TextEntry* >::iterator it;
64 for ( it = maTextEntryList.begin(); it != maTextEntryList.end(); ++it )
66 if ( *it == pTextEntry )
68 maTextEntryList.erase( it );
69 break;
72 delete pTextEntry;
76 // ---------------------------------------------------------------
78 void CGMChart::InsertTextEntry( TextEntry* pTextEntry )
80 maTextEntryList.push_back( pTextEntry );
83 // ---------------------------------------------------------------
85 // ---------------------------------------------------------------
86 void CGMChart::ResetAnnotation()
88 mDataNode[ 0 ].nZoneEnum = 0;
91 // ---------------------------------------------------------------
93 sal_Bool CGMChart::IsAnnotation()
95 return ( mDataNode[ 0 ].nZoneEnum == 0 );
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */