Files
core/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.cpp
Elen.Subbotina 6138139c4e исправлен проект - подключен "старый" DocxFormat (тот который с AVS - без вытирания буста)
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53593 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-20 22:37:54 +03:00

92 lines
2.2 KiB
C++

// auto inserted precompiled begin
#include "precompiled_docxformat.h"
// auto inserted precompiled end
#include "Spacing.h"
namespace OOX
{
namespace Logic
{
Spacing::Spacing()
{
}
Spacing::~Spacing()
{
}
Spacing::Spacing(const XML::XNode& node)
{
fromXML(node);
}
const Spacing& Spacing::operator =(const XML::XNode& node)
{
fromXML(node);
return *this;
}
void Spacing::fromXML(const XML::XNode& node)
{
const XML::XElement element(node);
if (element.attribute("after").exist())
{
int after = element.attribute("after").value();
After = UniversalUnit(after, UniversalUnit::Dx);
}
if (element.attribute("before").exist())
{
int before = element.attribute("before").value();
Before = UniversalUnit(before, UniversalUnit::Dx);
}
AfterLines = element.attribute("afterLines").value();
BeforeLines = element.attribute("beforeLines").value();
LineRule = element.attribute("lineRule").value();
if (element.attribute("line").exist())
{
int line = element.attribute("line").value();
Line = UniversalUnit(line, UniversalUnit::Dx);
}
BeforeAutospacing = element.attribute("beforeAutospacing").value();
AfterAutospacing = element.attribute("afterAutospacing").value();
}
const XML::XNode Spacing::toXML() const
{
return
XML::XElement(ns.w + "spacing",
XML::XAttribute(ns.w + "after", After) +
XML::XAttribute(ns.w + "afterAutospacing", AfterAutospacing) +
XML::XAttribute(ns.w + "afterLines", AfterLines) +
XML::XAttribute(ns.w + "before", Before) +
XML::XAttribute(ns.w + "beforeAutospacing", BeforeAutospacing) +
XML::XAttribute(ns.w + "beforeLines", BeforeLines) +
XML::XAttribute(ns.w + "line", Line) +
XML::XAttribute(ns.w + "lineRule", LineRule)
);
}
const bool Spacing::isSimple() const
{
return true;
//return (!After.is_init() && !Before.is_init() && !Line.is_init() && !AfterLines.is_init() && !BeforeLines.is_init() && !LineRule.is_init()
// && !BeforeAutospacing.is_init() && !AfterAutospacing.is_init());
}
} // namespace Logic
} // namespace OOX