1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dxfblkrd.cxx,v $
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"
35 #include <dxfblkrd.hxx>
38 //----------------------------------------------------------------------------
39 //---------------- DXFBlock --------------------------------------------------
40 //----------------------------------------------------------------------------
54 void DXFBlock::Read(DXFGroupReader
& rDGR
)
64 while (rDGR
.Read()!=0)
68 case 2: strncpy( sName
, rDGR
.GetS(), DXF_MAX_STRING_LEN
+ 1 ); break;
69 case 3: strncpy( sAlsoName
, rDGR
.GetS(), DXF_MAX_STRING_LEN
+ 1 ); break;
70 case 70: nFlags
=rDGR
.GetI(); break;
71 case 10: aBasePoint
.fx
=rDGR
.GetF(); break;
72 case 20: aBasePoint
.fy
=rDGR
.GetF(); break;
73 case 30: aBasePoint
.fz
=rDGR
.GetF(); break;
74 case 1: strncpy( sXRef
, rDGR
.GetS(), DXF_MAX_STRING_LEN
+ 1 ); break;
77 DXFEntities::Read(rDGR
);
81 //----------------------------------------------------------------------------
82 //---------------- DXFBlocks -------------------------------------------------
83 //----------------------------------------------------------------------------
86 DXFBlocks::DXFBlocks()
92 DXFBlocks::~DXFBlocks()
98 void DXFBlocks::Read(DXFGroupReader
& rDGR
)
100 DXFBlock
* pB
, * * ppSucc
;
103 while (*ppSucc
!=NULL
) ppSucc
=&((*ppSucc
)->pSucc
);
106 while (rDGR
.GetG()!=0) rDGR
.Read();
107 if (strcmp(rDGR
.GetS(),"ENDSEC")==0 ||
108 strcmp(rDGR
.GetS(),"EOF")==0) break;
109 if (strcmp(rDGR
.GetS(),"BLOCK")==0) {
120 DXFBlock
* DXFBlocks::Search(const char * sName
) const
123 for (pB
=pFirst
; pB
!=NULL
; pB
=pB
->pSucc
) {
124 if (strcmp(sName
,pB
->sName
)==0) break;
130 void DXFBlocks::Clear()
134 while (pFirst
!=NULL
) {