LibreOffice Module chart2 (master) 1
VLineProperties.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <VLineProperties.hxx>
21#include <com/sun/star/drawing/LineStyle.hpp>
22#include <com/sun/star/drawing/LineCap.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
25
26namespace chart
27{
28using namespace ::com::sun::star;
29
30// get line properties from a propertyset
31
33{
34 Color <<= sal_Int32(0x000000); //type sal_Int32 UNO_NAME_LINECOLOR
36 <<= drawing::LineStyle_SOLID; //type drawing::LineStyle for property UNO_NAME_LINESTYLE
37 Transparence <<= sal_Int16(0); //type sal_Int16 for property UNO_NAME_LINETRANSPARENCE
38 Width <<= sal_Int32(0); //type sal_Int32 for property UNO_NAME_LINEWIDTH
39 LineCap <<= drawing::LineCap_BUTT; //type drawing::LineCap for property UNO_NAME_LINECAP
40}
41
43{
44 if (xProp.is())
45 {
46 try
47 {
48 Color = xProp->getPropertyValue("LineColor");
49 LineStyle = xProp->getPropertyValue("LineStyle");
50 Transparence = xProp->getPropertyValue("LineTransparence");
51 Width = xProp->getPropertyValue("LineWidth");
52 DashName = xProp->getPropertyValue("LineDashName");
53 LineCap = xProp->getPropertyValue("LineCap");
54 }
55 catch (const uno::Exception&)
56 {
57 TOOLS_WARN_EXCEPTION("chart2", "");
58 }
59 }
60 else
61 LineStyle <<= drawing::LineStyle_NONE;
62}
63
65{
66 bool bRet = false;
67
68 drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
69 LineStyle >>= aLineStyle;
70 if (aLineStyle != drawing::LineStyle_NONE)
71 {
72 sal_Int16 nLineTransparence = 0;
73 Transparence >>= nLineTransparence;
74 if (nLineTransparence != 100)
75 {
76 bRet = true;
77 }
78 }
79
80 return bRet;
81}
82
83} //namespace chart
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define TOOLS_WARN_EXCEPTION(area, stream)
void initFromPropertySet(const css::uno::Reference< css::beans::XPropertySet > &xProp)
LineStyle