forked from lpxxn/docx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshape.cpp
43 lines (31 loc) · 818 Bytes
/
shape.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "shape.h"
#include "./oxml/oxmlshape.h"
#include "text.h"
#include "./parts/imagepart.h"
namespace Docx {
InlineShape::InlineShape(CT_Inline *inlinev)
: m_inline(inlinev)
{
}
Length InlineShape::width() const
{
QString value = m_inline->m_extent.attribute(QStringLiteral("cx"), "0");
return Length(value.toInt());
}
void InlineShape::setWidth(const Length &width)
{
m_inline->m_extent.setAttribute(QStringLiteral("cx"), QString::number(width.emu()));
}
Length InlineShape::height() const
{
QString value = m_inline->m_extent.attribute(QStringLiteral("cy"), "0");
return Length(value.toInt());
}
void InlineShape::setHeight(const Length &height)
{
m_inline->m_extent.setAttribute(QStringLiteral("cy"), QString::number(height.emu()));
}
InlineShape::~InlineShape()
{
}
}