summaryrefslogtreecommitdiff
path: root/chart2/source/tools/LineProperties.cxx
blob: 443704f4f0b27fb69597bf940bb5bcc184d20c25 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include "LineProperties.hxx"

using namespace com::sun::star;

LineProperties::LineProperties():
    mnLineWidth(0),
    meLineStyle(drawing::LineStyle_SOLID),
    maLineColor(0),
    mnLineTransparence(0),
    meLineJoint(drawing::LineJoint_ROUND)
{
}

LineProperties::LineProperties(const LineProperties& r):
    maDashName(r.maDashName),
    maLineDash(r.maLineDash),
    mnLineWidth(r.mnLineWidth),
    meLineStyle(r.meLineStyle),
    maLineColor(r.maLineColor),
    mnLineTransparence(r.mnLineTransparence),
    meLineJoint(r.meLineJoint)
{
}

uno::Any LineProperties::getPropertyValue(const OUString& rName)
{
    uno::Any aRet;
    if(rName == "LineDashName")
    {
        aRet <<= maDashName;
    }
    else if(rName == "LineDash")
    {
        aRet <<= maLineDash;
    }
    else if(rName == "LineWidth")
    {
        aRet <<= mnLineWidth;
    }
    else if(rName == "LineStyle")
    {
        aRet = uno::makeAny(meLineStyle);
    }
    else if(rName == "LineColor")
    {
        aRet <<= maLineColor;
    }
    else if(rName == "LineTransparence")
    {
        aRet <<= mnLineTransparence;
    }
    else if(rName == "LineJoint")
    {
        aRet <<= meLineJoint;
    }
    return aRet;
}

void LineProperties::setPropertyValue(const OUString& rName, const uno::Any& rAny)
{
    if(rName == "LineDashName")
    {
        rAny >>= maDashName;
    }
    else if(rName == "LineDash")
    {
        rAny >>= maLineDash;
    }
    else if(rName == "LineWidth")
    {
        rAny >>= mnLineWidth;
    }
    else if(rName == "LineStyle")
    {
        rAny >>= meLineStyle;
    }
    else if(rName == "LineColor")
    {
        rAny >>= maLineColor;
    }
    else if(rName == "LineTransparence")
    {
        rAny >>= mnLineTransparence;
    }
    else if(rName == "LineJoint")
    {
        rAny >>= meLineJoint;
    }
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */