1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <dxfblkrd.hxx>
25 //----------------------------------------------------------------------------
26 //---------------- DXFBlock --------------------------------------------------
27 //----------------------------------------------------------------------------
41 void DXFBlock::Read(DXFGroupReader
& rDGR
)
51 while (rDGR
.Read()!=0)
55 case 2: m_sName
= OString(rDGR
.GetS()); break;
56 case 3: m_sAlsoName
= OString(rDGR
.GetS()); break;
57 case 70: nFlags
=rDGR
.GetI(); break;
58 case 10: aBasePoint
.fx
=rDGR
.GetF(); break;
59 case 20: aBasePoint
.fy
=rDGR
.GetF(); break;
60 case 30: aBasePoint
.fz
=rDGR
.GetF(); break;
61 case 1: m_sXRef
= OString(rDGR
.GetS()); break;
64 DXFEntities::Read(rDGR
);
68 //----------------------------------------------------------------------------
69 //---------------- DXFBlocks -------------------------------------------------
70 //----------------------------------------------------------------------------
73 DXFBlocks::DXFBlocks()
79 DXFBlocks::~DXFBlocks()
85 void DXFBlocks::Read(DXFGroupReader
& rDGR
)
87 DXFBlock
* pB
, * * ppSucc
;
90 while (*ppSucc
!=NULL
) ppSucc
=&((*ppSucc
)->pSucc
);
93 while (rDGR
.GetG()!=0) rDGR
.Read();
94 if (strcmp(rDGR
.GetS(),"ENDSEC")==0 ||
95 strcmp(rDGR
.GetS(),"EOF")==0) break;
96 if (strcmp(rDGR
.GetS(),"BLOCK")==0) {
107 DXFBlock
* DXFBlocks::Search(OString
const& rName
) const
110 for (pB
=pFirst
; pB
!=NULL
; pB
=pB
->pSucc
) {
111 if (rName
== pB
->m_sName
) break;
117 void DXFBlocks::Clear()
121 while (pFirst
!=NULL
) {
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */