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/.
10 #include <extendedprimitive2dxmldump.hxx>
11 #include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
12 #include <sdr/primitive2d/sdrcellprimitive.hxx>
13 #include <tools/XmlWriter.hxx>
17 ExtendedPrimitive2dXmlDump::ExtendedPrimitive2dXmlDump() {}
19 ExtendedPrimitive2dXmlDump::~ExtendedPrimitive2dXmlDump() {}
21 bool ExtendedPrimitive2dXmlDump::decomposeAndWrite(
22 const drawinglayer::primitive2d::BasePrimitive2D
& rPrimitive
, ::tools::XmlWriter
& rWriter
)
24 sal_uInt32 nId
= rPrimitive
.getPrimitive2DID();
25 if (nId
== PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D
)
27 OUString sCurrentElementTag
= idToString(nId
);
28 rWriter
.startElement("sdrCell");
29 rWriter
.attribute("id", sCurrentElementTag
);
30 rWriter
.attribute("idNumber", nId
);
32 auto& rSdrCellPrimitive2D
33 = dynamic_cast<const drawinglayer::primitive2d::SdrCellPrimitive2D
&>(rPrimitive
);
34 rWriter
.attribute("transparenceForShadow",
35 OString::number(rSdrCellPrimitive2D
.getTransparenceForShadow()));
37 drawinglayer::primitive2d::Primitive2DContainer aPrimitiveContainer
;
38 rPrimitive
.get2DDecomposition(aPrimitiveContainer
,
39 drawinglayer::geometry::ViewInformation2D());
40 Primitive2dXmlDump::decomposeAndWrite(aPrimitiveContainer
, rWriter
);
47 } // end namespace svx
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */