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 .
21 #include "dxfblkrd.hxx"
24 //---------------- DXFBlock --------------------------------------------------
39 void DXFBlock::Read(DXFGroupReader
& rDGR
)
49 while (rDGR
.Read()!=0)
53 case 2: m_sName
= rDGR
.GetS(); break;
54 case 3: m_sAlsoName
= rDGR
.GetS(); break;
55 case 70: nFlags
=rDGR
.GetI(); break;
56 case 10: aBasePoint
.fx
=rDGR
.GetF(); break;
57 case 20: aBasePoint
.fy
=rDGR
.GetF(); break;
58 case 30: aBasePoint
.fz
=rDGR
.GetF(); break;
59 case 1: m_sXRef
= rDGR
.GetS(); break;
62 DXFEntities::Read(rDGR
);
66 //---------------- DXFBlocks -------------------------------------------------
69 DXFBlocks::DXFBlocks()
75 DXFBlocks::~DXFBlocks()
81 void DXFBlocks::Read(DXFGroupReader
& rDGR
)
83 DXFBlock
* pB
, * * ppSucc
;
86 while (*ppSucc
!=nullptr) ppSucc
=&((*ppSucc
)->pSucc
);
89 while (rDGR
.GetG()!=0) rDGR
.Read();
90 if (rDGR
.GetS() == "ENDSEC" ||
91 rDGR
.GetS() == "EOF") break;
92 if (rDGR
.GetS() == "BLOCK") {
103 DXFBlock
* DXFBlocks::Search(OString
const& rName
) const
106 for (pB
=pFirst
; pB
!=nullptr; pB
=pB
->pSucc
) {
107 if (rName
== pB
->m_sName
) break;
113 void DXFBlocks::Clear()
117 while (pFirst
!=nullptr) {
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */