mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-19 03:33:06 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53593 954022d7-b5bf-4e40-9824-e11837661b57
95 lines
2.3 KiB
C++
95 lines
2.3 KiB
C++
|
|
// auto inserted precompiled begin
|
|
#include "precompiled_docxformat.h"
|
|
// auto inserted precompiled end
|
|
|
|
#include "TextFrameProperties.h"
|
|
|
|
|
|
namespace OOX
|
|
{
|
|
namespace Logic
|
|
{
|
|
|
|
TextFrameProperties::TextFrameProperties()
|
|
{
|
|
}
|
|
|
|
|
|
TextFrameProperties::~TextFrameProperties()
|
|
{
|
|
}
|
|
|
|
|
|
TextFrameProperties::TextFrameProperties(const XML::XNode& node)
|
|
{
|
|
fromXML(node);
|
|
}
|
|
|
|
|
|
const TextFrameProperties& TextFrameProperties::operator =(const XML::XNode& node)
|
|
{
|
|
fromXML(node);
|
|
return *this;
|
|
}
|
|
|
|
|
|
void TextFrameProperties::fromXML(const XML::XNode& node)
|
|
{
|
|
const XML::XElement element(node);
|
|
HAnchor = element.attribute("hAnchor").value();
|
|
VAnchor = element.attribute("vAnchor").value();
|
|
Wrap = element.attribute("wrap").value();
|
|
if (element.attribute("x").exist())
|
|
{
|
|
int x = element.attribute("x").value();
|
|
X = UniversalUnit(x, UniversalUnit::Dx);
|
|
}
|
|
if (element.attribute("y").exist())
|
|
{
|
|
int y = element.attribute("y").value();
|
|
Y = UniversalUnit(y, UniversalUnit::Dx);
|
|
}
|
|
if (element.attribute("h").exist())
|
|
{
|
|
int h = element.attribute("h").value();
|
|
H = UniversalUnit(h, UniversalUnit::Dx);
|
|
}
|
|
if (element.attribute("w").exist())
|
|
{
|
|
int w = element.attribute("w").value();
|
|
W = UniversalUnit(w, UniversalUnit::Dx);
|
|
}
|
|
if (element.attribute("hSpace").exist())
|
|
{
|
|
int hSpace = element.attribute("hSpace").value();
|
|
HSpace = UniversalUnit(hSpace, UniversalUnit::Dx);
|
|
}
|
|
if (element.attribute("vSpace").exist())
|
|
{
|
|
int vSpace = element.attribute("vSpace").value();
|
|
VSpace = UniversalUnit(vSpace, UniversalUnit::Dx);
|
|
}
|
|
Lines = element.attribute("lines").value();
|
|
DropCap = element.attribute("dropCap").value();
|
|
}
|
|
|
|
|
|
const XML::XNode TextFrameProperties::toXML() const
|
|
{
|
|
return
|
|
XML::XElement(ns.w + "framePr",
|
|
XML::XAttribute(ns.w + "hAnchor", HAnchor) +
|
|
XML::XAttribute(ns.w + "vAnchor", VAnchor) +
|
|
XML::XAttribute(ns.w + "wrap", Wrap) +
|
|
XML::XAttribute(ns.w + "x", X) +
|
|
XML::XAttribute(ns.w + "y", Y) +
|
|
XML::XAttribute(ns.w + "h", H) +
|
|
XML::XAttribute(ns.w + "w", W) +
|
|
XML::XAttribute(ns.w + "hSpace", HSpace) +
|
|
XML::XAttribute(ns.w + "vSpace", VSpace)
|
|
);
|
|
}
|
|
|
|
} // namespace Logic
|
|
} // namespace OOX
|