Update ooo320-m1
[ooovba.git] / chart2 / source / view / main / VLineProperties.cxx
blob6d3d01ccca2bf3783ea310a4b4cd47c8e1ddbf6b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: VLineProperties.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
34 #include "VLineProperties.hxx"
35 #include "macros.hxx"
36 #include <com/sun/star/drawing/LineStyle.hpp>
38 //.............................................................................
39 namespace chart
41 //.............................................................................
42 using namespace ::com::sun::star;
44 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 // get line properties from a propertyset
47 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
50 VLineProperties::VLineProperties()
52 this->Color = uno::makeAny( sal_Int32(0x000000) ); //type sal_Int32 UNO_NAME_LINECOLOR
53 this->LineStyle = uno::makeAny( drawing::LineStyle_SOLID ); //type drawing::LineStyle for property UNO_NAME_LINESTYLE
54 this->Transparence = uno::makeAny( sal_Int16(0) );//type sal_Int16 for property UNO_NAME_LINETRANSPARENCE
55 this->Width = uno::makeAny( sal_Int32(0) );//type sal_Int32 for property UNO_NAME_LINEWIDTH
58 void VLineProperties::initFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp, bool bUseSeriesPropertyNames )
60 if(xProp.is())
62 if( bUseSeriesPropertyNames ) try
64 this->Color = xProp->getPropertyValue( C2U( "BorderColor" ) );
65 this->LineStyle = xProp->getPropertyValue( C2U( "BorderStyle" ) );
66 this->Transparence = xProp->getPropertyValue( C2U( "BorderTransparency" ) );
67 this->Width = xProp->getPropertyValue( C2U( "BorderWidth" ) );
68 this->DashName = xProp->getPropertyValue( C2U( "BorderDashName" ) );
70 catch( uno::Exception& e )
72 ASSERT_EXCEPTION( e );
74 else try
76 this->Color = xProp->getPropertyValue( C2U( "LineColor" ) );
77 this->LineStyle = xProp->getPropertyValue( C2U( "LineStyle" ) );
78 this->Transparence = xProp->getPropertyValue( C2U( "LineTransparence" ) );
79 this->Width = xProp->getPropertyValue( C2U( "LineWidth" ) );
80 this->DashName = xProp->getPropertyValue( C2U( "LineDashName" ) );
82 catch( uno::Exception& e )
84 ASSERT_EXCEPTION( e );
87 else
88 this->LineStyle = uno::makeAny( drawing::LineStyle_NONE );
91 bool VLineProperties::isLineVisible() const
93 bool bRet = false;
95 drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
96 this->LineStyle >>= aLineStyle;
97 if( aLineStyle != drawing::LineStyle_NONE )
99 sal_Int16 nLineTransparence=0;
100 this->Transparence >>= nLineTransparence;
101 if(100!=nLineTransparence)
103 bRet = true;
107 return bRet;
110 //.............................................................................
111 } //namespace chart
112 //.............................................................................