1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_chart2.hxx"
30*cdf0e10cSrcweir #include "DataPointItemConverter.hxx"
31*cdf0e10cSrcweir #include "SchWhichPairs.hxx"
32*cdf0e10cSrcweir #include "macros.hxx"
33*cdf0e10cSrcweir #include "ItemPropertyMap.hxx"
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include "GraphicPropertyItemConverter.hxx"
36*cdf0e10cSrcweir #include "CharacterPropertyItemConverter.hxx"
37*cdf0e10cSrcweir #include "StatisticsItemConverter.hxx"
38*cdf0e10cSrcweir #include "SeriesOptionsItemConverter.hxx"
39*cdf0e10cSrcweir #include "DataSeriesHelper.hxx"
40*cdf0e10cSrcweir #include "DiagramHelper.hxx"
41*cdf0e10cSrcweir #include "ChartModelHelper.hxx"
42*cdf0e10cSrcweir #include "ChartTypeHelper.hxx"
43*cdf0e10cSrcweir #include <svx/chrtitem.hxx>
44*cdf0e10cSrcweir #include <com/sun/star/chart2/DataPointLabel.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/chart2/Symbol.hpp>
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir // header for class XFillColorItem
48*cdf0e10cSrcweir #include <svx/xflclit.hxx>
49*cdf0e10cSrcweir #include <svl/intitem.hxx>
50*cdf0e10cSrcweir #include <editeng/sizeitem.hxx>
51*cdf0e10cSrcweir // header for class SfxStringItem
52*cdf0e10cSrcweir #include <svl/stritem.hxx>
53*cdf0e10cSrcweir #include <editeng/brshitem.hxx>
54*cdf0e10cSrcweir //SfxIntegerListItem
55*cdf0e10cSrcweir #include <svl/ilstitem.hxx>
56*cdf0e10cSrcweir #define _SVSTDARR_ULONGS
57*cdf0e10cSrcweir #include <svl/svstdarr.hxx>
58*cdf0e10cSrcweir #include <vcl/graph.hxx>
59*cdf0e10cSrcweir #include <com/sun/star/graphic/XGraphic.hpp>
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir // for SVX_SYMBOLTYPE_...
62*cdf0e10cSrcweir #include <svx/tabline.hxx>
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir #include <functional>
65*cdf0e10cSrcweir #include <algorithm>
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir using namespace ::com::sun::star;
68*cdf0e10cSrcweir using namespace ::com::sun::star::chart2;
69*cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir namespace
72*cdf0e10cSrcweir {
73*cdf0e10cSrcweir ::comphelper::ItemPropertyMapType & lcl_GetDataPointPropertyMap()
74*cdf0e10cSrcweir {
75*cdf0e10cSrcweir     static ::comphelper::ItemPropertyMapType aDataPointPropertyMap(
76*cdf0e10cSrcweir         ::comphelper::MakeItemPropertyMap
77*cdf0e10cSrcweir //        IPM_MAP_ENTRY( CHATTR_PIE_SEGMENT_OFFSET, "Offset", 0 )
78*cdf0e10cSrcweir         IPM_MAP_ENTRY( SCHATTR_STYLE_SHAPE, "Geometry3D", 0 )
79*cdf0e10cSrcweir         );
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     return aDataPointPropertyMap;
82*cdf0e10cSrcweir };
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir sal_Int32 lcl_getSymbolStyleForSymbol( const chart2::Symbol & rSymbol )
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir     sal_Int32 nStyle = SVX_SYMBOLTYPE_UNKNOWN;
87*cdf0e10cSrcweir     switch( rSymbol.Style )
88*cdf0e10cSrcweir     {
89*cdf0e10cSrcweir         case chart2::SymbolStyle_NONE:
90*cdf0e10cSrcweir             nStyle = SVX_SYMBOLTYPE_NONE;
91*cdf0e10cSrcweir             break;
92*cdf0e10cSrcweir         case chart2::SymbolStyle_AUTO:
93*cdf0e10cSrcweir             nStyle = SVX_SYMBOLTYPE_AUTO;
94*cdf0e10cSrcweir             break;
95*cdf0e10cSrcweir         case chart2::SymbolStyle_GRAPHIC:
96*cdf0e10cSrcweir             nStyle = SVX_SYMBOLTYPE_BRUSHITEM;
97*cdf0e10cSrcweir             break;
98*cdf0e10cSrcweir         case chart2::SymbolStyle_STANDARD:
99*cdf0e10cSrcweir             nStyle = rSymbol.StandardSymbol;
100*cdf0e10cSrcweir             break;
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir         case chart2::SymbolStyle_POLYGON:
103*cdf0e10cSrcweir             // to avoid warning
104*cdf0e10cSrcweir         case chart2::SymbolStyle_MAKE_FIXED_SIZE:
105*cdf0e10cSrcweir             // nothing
106*cdf0e10cSrcweir             break;
107*cdf0e10cSrcweir     }
108*cdf0e10cSrcweir     return nStyle;
109*cdf0e10cSrcweir }
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso  )
112*cdf0e10cSrcweir {
113*cdf0e10cSrcweir     bool bChanged = false;
114*cdf0e10cSrcweir     if( !xPropertySet.is() )
115*cdf0e10cSrcweir         return bChanged;
116*cdf0e10cSrcweir     rtl::OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? C2U( "NumberFormat" ) : C2U( "PercentageNumberFormat" );
117*cdf0e10cSrcweir     sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     if( SFX_ITEM_SET != rItemSet.GetItemState( nSourceWhich ) )
120*cdf0e10cSrcweir         return bChanged;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     uno::Any aValue;
123*cdf0e10cSrcweir     bool bUseSourceFormat = (static_cast< const SfxBoolItem & >(
124*cdf0e10cSrcweir                 rItemSet.Get( nSourceWhich )).GetValue() );
125*cdf0e10cSrcweir     if( !bUseSourceFormat )
126*cdf0e10cSrcweir     {
127*cdf0e10cSrcweir         SfxItemState aState = rItemSet.GetItemState( nWhichId );
128*cdf0e10cSrcweir         if( aState == SFX_ITEM_SET )
129*cdf0e10cSrcweir         {
130*cdf0e10cSrcweir             sal_Int32 nFmt = static_cast< sal_Int32 >(
131*cdf0e10cSrcweir                 static_cast< const SfxUInt32Item & >(
132*cdf0e10cSrcweir                     rItemSet.Get( nWhichId )).GetValue());
133*cdf0e10cSrcweir             aValue = uno::makeAny(nFmt);
134*cdf0e10cSrcweir         }
135*cdf0e10cSrcweir         else
136*cdf0e10cSrcweir             return bChanged;
137*cdf0e10cSrcweir     }
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     uno::Any aOldValue( xPropertySet->getPropertyValue(aPropertyName) );
140*cdf0e10cSrcweir     if( bOverwriteAttributedDataPointsAlso )
141*cdf0e10cSrcweir     {
142*cdf0e10cSrcweir         Reference< chart2::XDataSeries > xSeries( xPropertySet, uno::UNO_QUERY);
143*cdf0e10cSrcweir         if( aValue != aOldValue ||
144*cdf0e10cSrcweir             ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, aPropertyName, aOldValue ) )
145*cdf0e10cSrcweir         {
146*cdf0e10cSrcweir             ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, aPropertyName, aValue );
147*cdf0e10cSrcweir             bChanged = true;
148*cdf0e10cSrcweir         }
149*cdf0e10cSrcweir     }
150*cdf0e10cSrcweir     else if( aOldValue != aValue )
151*cdf0e10cSrcweir     {
152*cdf0e10cSrcweir         xPropertySet->setPropertyValue(aPropertyName, aValue );
153*cdf0e10cSrcweir         bChanged = true;
154*cdf0e10cSrcweir     }
155*cdf0e10cSrcweir     return bChanged;
156*cdf0e10cSrcweir }
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso  )
159*cdf0e10cSrcweir {
160*cdf0e10cSrcweir     bool bChanged = false;
161*cdf0e10cSrcweir     if( !xPropertySet.is() )
162*cdf0e10cSrcweir         return bChanged;
163*cdf0e10cSrcweir     rtl::OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? C2U( "NumberFormat" ) : C2U( "PercentageNumberFormat" );
164*cdf0e10cSrcweir     sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir     if( SFX_ITEM_SET != rItemSet.GetItemState( nWhichId ) )
167*cdf0e10cSrcweir         return bChanged;
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir     uno::Any aNewValue;
170*cdf0e10cSrcweir     bool bUseSourceFormat = (static_cast< const SfxBoolItem & >(
171*cdf0e10cSrcweir                 rItemSet.Get( nWhichId )).GetValue() );
172*cdf0e10cSrcweir     if( !bUseSourceFormat )
173*cdf0e10cSrcweir     {
174*cdf0e10cSrcweir         SfxItemState aState = rItemSet.GetItemState( nFormatWhich );
175*cdf0e10cSrcweir         if( aState == SFX_ITEM_SET )
176*cdf0e10cSrcweir         {
177*cdf0e10cSrcweir             sal_Int32 nFormatKey = static_cast< sal_Int32 >(
178*cdf0e10cSrcweir             static_cast< const SfxUInt32Item & >(
179*cdf0e10cSrcweir                 rItemSet.Get( nFormatWhich )).GetValue());
180*cdf0e10cSrcweir             aNewValue <<= nFormatKey;
181*cdf0e10cSrcweir         }
182*cdf0e10cSrcweir         else
183*cdf0e10cSrcweir             return bChanged;
184*cdf0e10cSrcweir     }
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir     uno::Any aOldValue( xPropertySet->getPropertyValue(aPropertyName) );
187*cdf0e10cSrcweir     if( bOverwriteAttributedDataPointsAlso )
188*cdf0e10cSrcweir     {
189*cdf0e10cSrcweir         Reference< chart2::XDataSeries > xSeries( xPropertySet, uno::UNO_QUERY);
190*cdf0e10cSrcweir         if( aNewValue != aOldValue ||
191*cdf0e10cSrcweir             ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, aPropertyName, aOldValue ) )
192*cdf0e10cSrcweir         {
193*cdf0e10cSrcweir             ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, aPropertyName, aNewValue );
194*cdf0e10cSrcweir             bChanged = true;
195*cdf0e10cSrcweir         }
196*cdf0e10cSrcweir     }
197*cdf0e10cSrcweir     else if( aOldValue != aNewValue )
198*cdf0e10cSrcweir     {
199*cdf0e10cSrcweir         xPropertySet->setPropertyValue( aPropertyName, aNewValue );
200*cdf0e10cSrcweir         bChanged = true;
201*cdf0e10cSrcweir     }
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir     return bChanged;
204*cdf0e10cSrcweir }
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir } // anonymous namespace
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir namespace chart
209*cdf0e10cSrcweir {
210*cdf0e10cSrcweir namespace wrapper
211*cdf0e10cSrcweir {
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir DataPointItemConverter::DataPointItemConverter(
214*cdf0e10cSrcweir     const uno::Reference< frame::XModel > & xChartModel,
215*cdf0e10cSrcweir     const uno::Reference< uno::XComponentContext > & xContext,
216*cdf0e10cSrcweir     const uno::Reference< beans::XPropertySet > & rPropertySet,
217*cdf0e10cSrcweir     const uno::Reference< XDataSeries > & xSeries,
218*cdf0e10cSrcweir     SfxItemPool& rItemPool,
219*cdf0e10cSrcweir     SdrModel& rDrawModel,
220*cdf0e10cSrcweir     NumberFormatterWrapper * pNumFormatter,
221*cdf0e10cSrcweir     const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
222*cdf0e10cSrcweir     GraphicPropertyItemConverter::eGraphicObjectType eMapTo /* = FILL_PROPERTIES */,
223*cdf0e10cSrcweir     ::std::auto_ptr< awt::Size > pRefSize /* = NULL */,
224*cdf0e10cSrcweir     bool bDataSeries /* = false */,
225*cdf0e10cSrcweir     bool bUseSpecialFillColor /* = false */,
226*cdf0e10cSrcweir     sal_Int32 nSpecialFillColor /* =0 */,
227*cdf0e10cSrcweir     bool bOverwriteLabelsForAttributedDataPointsAlso /*false*/,
228*cdf0e10cSrcweir     sal_Int32 nNumberFormat,
229*cdf0e10cSrcweir     sal_Int32 nPercentNumberFormat
230*cdf0e10cSrcweir     ) :
231*cdf0e10cSrcweir         ItemConverter( rPropertySet, rItemPool ),
232*cdf0e10cSrcweir         m_pNumberFormatterWrapper( pNumFormatter ),
233*cdf0e10cSrcweir         m_bDataSeries( bDataSeries ),
234*cdf0e10cSrcweir         m_bOverwriteLabelsForAttributedDataPointsAlso(m_bDataSeries && bOverwriteLabelsForAttributedDataPointsAlso),
235*cdf0e10cSrcweir         m_bUseSpecialFillColor(bUseSpecialFillColor),
236*cdf0e10cSrcweir         m_nSpecialFillColor(nSpecialFillColor),
237*cdf0e10cSrcweir         m_nNumberFormat(nNumberFormat),
238*cdf0e10cSrcweir         m_nPercentNumberFormat(nPercentNumberFormat),
239*cdf0e10cSrcweir         m_aAvailableLabelPlacements(),
240*cdf0e10cSrcweir         m_bForbidPercentValue(true)
241*cdf0e10cSrcweir {
242*cdf0e10cSrcweir     m_aConverters.push_back( new GraphicPropertyItemConverter(
243*cdf0e10cSrcweir                                  rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, eMapTo ));
244*cdf0e10cSrcweir     m_aConverters.push_back( new CharacterPropertyItemConverter( rPropertySet, rItemPool, pRefSize,
245*cdf0e10cSrcweir                                                                  C2U( "ReferencePageSize" )));
246*cdf0e10cSrcweir     if( bDataSeries )
247*cdf0e10cSrcweir     {
248*cdf0e10cSrcweir         m_aConverters.push_back( new StatisticsItemConverter( xChartModel, rPropertySet, rItemPool ));
249*cdf0e10cSrcweir         m_aConverters.push_back( new SeriesOptionsItemConverter( xChartModel, xContext, rPropertySet, rItemPool ));
250*cdf0e10cSrcweir     }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir     uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
253*cdf0e10cSrcweir     uno::Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xSeries ) );
254*cdf0e10cSrcweir     bool bFound = false;
255*cdf0e10cSrcweir     bool bAmbiguous = false;
256*cdf0e10cSrcweir     sal_Bool bSwapXAndY = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
257*cdf0e10cSrcweir     m_aAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements( xChartType, DiagramHelper::getDimension( xDiagram ), bSwapXAndY, xSeries );
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir     m_bForbidPercentValue = AxisType::CATEGORY != ChartTypeHelper::getAxisType( xChartType, 0 );
260*cdf0e10cSrcweir }
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir DataPointItemConverter::~DataPointItemConverter()
263*cdf0e10cSrcweir {
264*cdf0e10cSrcweir     ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
265*cdf0e10cSrcweir                      ::comphelper::DeleteItemConverterPtr() );
266*cdf0e10cSrcweir }
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir void DataPointItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
269*cdf0e10cSrcweir {
270*cdf0e10cSrcweir     ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
271*cdf0e10cSrcweir                      ::comphelper::FillItemSetFunc( rOutItemSet ));
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir     // own items
274*cdf0e10cSrcweir     ItemConverter::FillItemSet( rOutItemSet );
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir     if( m_bUseSpecialFillColor )
277*cdf0e10cSrcweir     {
278*cdf0e10cSrcweir         Color aColor(m_nSpecialFillColor);
279*cdf0e10cSrcweir         rOutItemSet.Put( XFillColorItem( String(), aColor ) );
280*cdf0e10cSrcweir     }
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir bool DataPointItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
284*cdf0e10cSrcweir {
285*cdf0e10cSrcweir     bool bResult = false;
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir     ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
288*cdf0e10cSrcweir                      ::comphelper::ApplyItemSetFunc( rItemSet, bResult ));
289*cdf0e10cSrcweir 
290*cdf0e10cSrcweir     // own items
291*cdf0e10cSrcweir     return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
292*cdf0e10cSrcweir }
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir const sal_uInt16 * DataPointItemConverter::GetWhichPairs() const
295*cdf0e10cSrcweir {
296*cdf0e10cSrcweir     // must span all used items!
297*cdf0e10cSrcweir     if( m_bDataSeries )
298*cdf0e10cSrcweir         return nRowWhichPairs;
299*cdf0e10cSrcweir     return nDataPointWhichPairs;
300*cdf0e10cSrcweir }
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir bool DataPointItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const
303*cdf0e10cSrcweir {
304*cdf0e10cSrcweir     ::comphelper::ItemPropertyMapType & rMap( lcl_GetDataPointPropertyMap());
305*cdf0e10cSrcweir     ::comphelper::ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId ));
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir     if( aIt == rMap.end())
308*cdf0e10cSrcweir         return false;
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir     rOutProperty =(*aIt).second;
311*cdf0e10cSrcweir     return true;
312*cdf0e10cSrcweir }
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir bool DataPointItemConverter::ApplySpecialItem(
316*cdf0e10cSrcweir     sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
317*cdf0e10cSrcweir     throw( uno::Exception )
318*cdf0e10cSrcweir {
319*cdf0e10cSrcweir     bool bChanged = false;
320*cdf0e10cSrcweir     uno::Any aValue;
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir     switch( nWhichId )
323*cdf0e10cSrcweir     {
324*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_NUMBER:
325*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
326*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_CATEGORY:
327*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_SYMBOL:
328*cdf0e10cSrcweir         {
329*cdf0e10cSrcweir             const SfxBoolItem & rItem = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId ));
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir             uno::Any aOldValue( GetPropertySet()->getPropertyValue( C2U( "Label" ) ));
332*cdf0e10cSrcweir             chart2::DataPointLabel aLabel;
333*cdf0e10cSrcweir             if( aOldValue >>= aLabel )
334*cdf0e10cSrcweir             {
335*cdf0e10cSrcweir                 sal_Bool& rValue = (SCHATTR_DATADESCR_SHOW_NUMBER==nWhichId) ? aLabel.ShowNumber : (
336*cdf0e10cSrcweir                     (SCHATTR_DATADESCR_SHOW_PERCENTAGE==nWhichId) ? aLabel.ShowNumberInPercent : (
337*cdf0e10cSrcweir                     (SCHATTR_DATADESCR_SHOW_CATEGORY==nWhichId) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol ));
338*cdf0e10cSrcweir                 sal_Bool bOldValue = rValue;
339*cdf0e10cSrcweir                 rValue = static_cast< sal_Bool >( rItem.GetValue() );
340*cdf0e10cSrcweir                 if( m_bOverwriteLabelsForAttributedDataPointsAlso )
341*cdf0e10cSrcweir                 {
342*cdf0e10cSrcweir                     Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
343*cdf0e10cSrcweir                     if( bOldValue != rValue ||
344*cdf0e10cSrcweir                         DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, C2U( "Label" ), aOldValue ) )
345*cdf0e10cSrcweir                     {
346*cdf0e10cSrcweir                         DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, C2U( "Label" ), uno::makeAny( aLabel ) );
347*cdf0e10cSrcweir                         bChanged = true;
348*cdf0e10cSrcweir                     }
349*cdf0e10cSrcweir                 }
350*cdf0e10cSrcweir                 else if( bOldValue != rValue )
351*cdf0e10cSrcweir                 {
352*cdf0e10cSrcweir                     GetPropertySet()->setPropertyValue( C2U( "Label" ), uno::makeAny( aLabel ));
353*cdf0e10cSrcweir                     bChanged = true;
354*cdf0e10cSrcweir                 }
355*cdf0e10cSrcweir             }
356*cdf0e10cSrcweir         }
357*cdf0e10cSrcweir         break;
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir         case SID_ATTR_NUMBERFORMAT_VALUE:
360*cdf0e10cSrcweir         case SCHATTR_PERCENT_NUMBERFORMAT_VALUE:  //fall through intended
361*cdf0e10cSrcweir         {
362*cdf0e10cSrcweir             bChanged = lcl_NumberFormatFromItemToPropertySet( nWhichId, rItemSet, GetPropertySet(), m_bOverwriteLabelsForAttributedDataPointsAlso );
363*cdf0e10cSrcweir         }
364*cdf0e10cSrcweir         break;
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir         case SID_ATTR_NUMBERFORMAT_SOURCE:
367*cdf0e10cSrcweir         case SCHATTR_PERCENT_NUMBERFORMAT_SOURCE: //fall through intended
368*cdf0e10cSrcweir         {
369*cdf0e10cSrcweir             bChanged = lcl_UseSourceFormatFromItemToPropertySet( nWhichId, rItemSet, GetPropertySet(), m_bOverwriteLabelsForAttributedDataPointsAlso );
370*cdf0e10cSrcweir         }
371*cdf0e10cSrcweir         break;
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SEPARATOR:
374*cdf0e10cSrcweir         {
375*cdf0e10cSrcweir             rtl::OUString aNewValue = static_cast< const SfxStringItem & >( rItemSet.Get( nWhichId )).GetValue();
376*cdf0e10cSrcweir             rtl::OUString aOldValue;
377*cdf0e10cSrcweir             try
378*cdf0e10cSrcweir             {
379*cdf0e10cSrcweir                 GetPropertySet()->getPropertyValue( C2U( "LabelSeparator" ) ) >>= aOldValue;
380*cdf0e10cSrcweir                 if( m_bOverwriteLabelsForAttributedDataPointsAlso )
381*cdf0e10cSrcweir                 {
382*cdf0e10cSrcweir                     Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
383*cdf0e10cSrcweir                     if( !aOldValue.equals(aNewValue) ||
384*cdf0e10cSrcweir                         DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, C2U( "LabelSeparator" ), uno::makeAny( aOldValue ) ) )
385*cdf0e10cSrcweir                     {
386*cdf0e10cSrcweir                         DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, C2U( "LabelSeparator" ), uno::makeAny( aNewValue ) );
387*cdf0e10cSrcweir                         bChanged = true;
388*cdf0e10cSrcweir                     }
389*cdf0e10cSrcweir                 }
390*cdf0e10cSrcweir                 else if( !aOldValue.equals(aNewValue) )
391*cdf0e10cSrcweir                 {
392*cdf0e10cSrcweir                     GetPropertySet()->setPropertyValue( C2U( "LabelSeparator" ), uno::makeAny( aNewValue ));
393*cdf0e10cSrcweir                     bChanged = true;
394*cdf0e10cSrcweir                 }
395*cdf0e10cSrcweir             }
396*cdf0e10cSrcweir             catch( uno::Exception& e )
397*cdf0e10cSrcweir 	        {
398*cdf0e10cSrcweir                 ASSERT_EXCEPTION( e );
399*cdf0e10cSrcweir             }
400*cdf0e10cSrcweir         }
401*cdf0e10cSrcweir         break;
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir         case SCHATTR_DATADESCR_PLACEMENT:
404*cdf0e10cSrcweir         {
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir             try
407*cdf0e10cSrcweir             {
408*cdf0e10cSrcweir                 sal_Int32 nNew = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
409*cdf0e10cSrcweir                 sal_Int32 nOld =0;
410*cdf0e10cSrcweir                 if( !(GetPropertySet()->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nOld) )
411*cdf0e10cSrcweir                 {
412*cdf0e10cSrcweir                     if( m_aAvailableLabelPlacements.getLength() )
413*cdf0e10cSrcweir                         nOld = m_aAvailableLabelPlacements[0];
414*cdf0e10cSrcweir                 }
415*cdf0e10cSrcweir                 if( m_bOverwriteLabelsForAttributedDataPointsAlso )
416*cdf0e10cSrcweir                 {
417*cdf0e10cSrcweir                     Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
418*cdf0e10cSrcweir                     if( nOld!=nNew ||
419*cdf0e10cSrcweir                         DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, C2U( "LabelPlacement" ), uno::makeAny( nOld ) ) )
420*cdf0e10cSrcweir                     {
421*cdf0e10cSrcweir                         DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, C2U( "LabelPlacement" ), uno::makeAny( nNew ) );
422*cdf0e10cSrcweir                         bChanged = true;
423*cdf0e10cSrcweir                     }
424*cdf0e10cSrcweir                 }
425*cdf0e10cSrcweir                 else if( nOld!=nNew )
426*cdf0e10cSrcweir                 {
427*cdf0e10cSrcweir                     GetPropertySet()->setPropertyValue( C2U( "LabelPlacement" ), uno::makeAny( nNew ));
428*cdf0e10cSrcweir                     bChanged = true;
429*cdf0e10cSrcweir                 }
430*cdf0e10cSrcweir             }
431*cdf0e10cSrcweir             catch( uno::Exception& e )
432*cdf0e10cSrcweir 	        {
433*cdf0e10cSrcweir                 ASSERT_EXCEPTION( e );
434*cdf0e10cSrcweir             }
435*cdf0e10cSrcweir         }
436*cdf0e10cSrcweir         break;
437*cdf0e10cSrcweir 
438*cdf0e10cSrcweir         case SCHATTR_STYLE_SYMBOL:
439*cdf0e10cSrcweir         {
440*cdf0e10cSrcweir             sal_Int32 nStyle =
441*cdf0e10cSrcweir                 static_cast< const SfxInt32Item & >(
442*cdf0e10cSrcweir                     rItemSet.Get( nWhichId )).GetValue();
443*cdf0e10cSrcweir             chart2::Symbol aSymbol;
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir             GetPropertySet()->getPropertyValue( C2U( "Symbol" )) >>= aSymbol;
446*cdf0e10cSrcweir             sal_Int32 nOldStyle = lcl_getSymbolStyleForSymbol( aSymbol );
447*cdf0e10cSrcweir 
448*cdf0e10cSrcweir             if( nStyle != nOldStyle )
449*cdf0e10cSrcweir             {
450*cdf0e10cSrcweir                 bool bDeleteSymbol = false;
451*cdf0e10cSrcweir                 switch( nStyle )
452*cdf0e10cSrcweir                 {
453*cdf0e10cSrcweir                     case SVX_SYMBOLTYPE_NONE:
454*cdf0e10cSrcweir                         aSymbol.Style = chart2::SymbolStyle_NONE;
455*cdf0e10cSrcweir                         break;
456*cdf0e10cSrcweir                     case SVX_SYMBOLTYPE_AUTO:
457*cdf0e10cSrcweir                         aSymbol.Style = chart2::SymbolStyle_AUTO;
458*cdf0e10cSrcweir                         break;
459*cdf0e10cSrcweir                     case SVX_SYMBOLTYPE_BRUSHITEM:
460*cdf0e10cSrcweir                         aSymbol.Style = chart2::SymbolStyle_GRAPHIC;
461*cdf0e10cSrcweir                         break;
462*cdf0e10cSrcweir                     case SVX_SYMBOLTYPE_UNKNOWN:
463*cdf0e10cSrcweir                         bDeleteSymbol = true;
464*cdf0e10cSrcweir                         break;
465*cdf0e10cSrcweir 
466*cdf0e10cSrcweir                     default:
467*cdf0e10cSrcweir                         aSymbol.Style = chart2::SymbolStyle_STANDARD;
468*cdf0e10cSrcweir                         aSymbol.StandardSymbol = nStyle;
469*cdf0e10cSrcweir                 }
470*cdf0e10cSrcweir 
471*cdf0e10cSrcweir                 if( bDeleteSymbol )
472*cdf0e10cSrcweir                     GetPropertySet()->setPropertyValue( C2U( "Symbol" ), uno::Any());
473*cdf0e10cSrcweir                 else
474*cdf0e10cSrcweir                     GetPropertySet()->setPropertyValue( C2U( "Symbol" ),
475*cdf0e10cSrcweir                                                         uno::makeAny( aSymbol ));
476*cdf0e10cSrcweir                 bChanged = true;
477*cdf0e10cSrcweir             }
478*cdf0e10cSrcweir         }
479*cdf0e10cSrcweir         break;
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir         case SCHATTR_SYMBOL_SIZE:
482*cdf0e10cSrcweir         {
483*cdf0e10cSrcweir             Size aSize = static_cast< const SvxSizeItem & >(
484*cdf0e10cSrcweir                 rItemSet.Get( nWhichId )).GetSize();
485*cdf0e10cSrcweir             chart2::Symbol aSymbol;
486*cdf0e10cSrcweir 
487*cdf0e10cSrcweir             GetPropertySet()->getPropertyValue( C2U( "Symbol" )) >>= aSymbol;
488*cdf0e10cSrcweir             if( aSize.getWidth() != aSymbol.Size.Width ||
489*cdf0e10cSrcweir                 aSize.getHeight() != aSymbol.Size.Height )
490*cdf0e10cSrcweir             {
491*cdf0e10cSrcweir                 aSymbol.Size.Width = aSize.getWidth();
492*cdf0e10cSrcweir                 aSymbol.Size.Height = aSize.getHeight();
493*cdf0e10cSrcweir 
494*cdf0e10cSrcweir                 GetPropertySet()->setPropertyValue( C2U( "Symbol" ), uno::makeAny( aSymbol ));
495*cdf0e10cSrcweir                 bChanged = true;
496*cdf0e10cSrcweir             }
497*cdf0e10cSrcweir         }
498*cdf0e10cSrcweir         break;
499*cdf0e10cSrcweir 
500*cdf0e10cSrcweir         case SCHATTR_SYMBOL_BRUSH:
501*cdf0e10cSrcweir         {
502*cdf0e10cSrcweir             const SvxBrushItem & rBrshItem( static_cast< const SvxBrushItem & >(
503*cdf0e10cSrcweir                                                 rItemSet.Get( nWhichId )));
504*cdf0e10cSrcweir             uno::Any aXGraphicAny;
505*cdf0e10cSrcweir             const Graphic *pGraphic( rBrshItem.GetGraphic());
506*cdf0e10cSrcweir             if( pGraphic )
507*cdf0e10cSrcweir             {
508*cdf0e10cSrcweir                 uno::Reference< graphic::XGraphic > xGraphic( pGraphic->GetXGraphic());
509*cdf0e10cSrcweir                 if( xGraphic.is())
510*cdf0e10cSrcweir                 {
511*cdf0e10cSrcweir                     aXGraphicAny <<= xGraphic;
512*cdf0e10cSrcweir                     chart2::Symbol aSymbol;
513*cdf0e10cSrcweir                     GetPropertySet()->getPropertyValue( C2U( "Symbol" )) >>= aSymbol;
514*cdf0e10cSrcweir                     if( aSymbol.Graphic != xGraphic )
515*cdf0e10cSrcweir                     {
516*cdf0e10cSrcweir                         aSymbol.Graphic = xGraphic;
517*cdf0e10cSrcweir                         GetPropertySet()->setPropertyValue( C2U( "Symbol" ), uno::makeAny( aSymbol ));
518*cdf0e10cSrcweir                         bChanged = true;
519*cdf0e10cSrcweir                     }
520*cdf0e10cSrcweir                 }
521*cdf0e10cSrcweir             }
522*cdf0e10cSrcweir         }
523*cdf0e10cSrcweir         break;
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir         case SCHATTR_TEXT_DEGREES:
526*cdf0e10cSrcweir         {
527*cdf0e10cSrcweir             double fValue = static_cast< double >(
528*cdf0e10cSrcweir                 static_cast< const SfxInt32Item & >(
529*cdf0e10cSrcweir                     rItemSet.Get( nWhichId )).GetValue()) / 100.0;
530*cdf0e10cSrcweir             double fOldValue = 0.0;
531*cdf0e10cSrcweir             bool bPropExisted =
532*cdf0e10cSrcweir                 ( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fOldValue );
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir             if( ! bPropExisted ||
535*cdf0e10cSrcweir                 ( bPropExisted && fOldValue != fValue ))
536*cdf0e10cSrcweir             {
537*cdf0e10cSrcweir                 GetPropertySet()->setPropertyValue( C2U( "TextRotation" ), uno::makeAny( fValue ));
538*cdf0e10cSrcweir                 bChanged = true;
539*cdf0e10cSrcweir             }
540*cdf0e10cSrcweir         }
541*cdf0e10cSrcweir         break;
542*cdf0e10cSrcweir     }
543*cdf0e10cSrcweir 
544*cdf0e10cSrcweir     return bChanged;
545*cdf0e10cSrcweir }
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir void DataPointItemConverter::FillSpecialItem(
548*cdf0e10cSrcweir     sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
549*cdf0e10cSrcweir     throw( uno::Exception )
550*cdf0e10cSrcweir {
551*cdf0e10cSrcweir     switch( nWhichId )
552*cdf0e10cSrcweir     {
553*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_NUMBER:
554*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
555*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_CATEGORY:
556*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SHOW_SYMBOL:
557*cdf0e10cSrcweir         {
558*cdf0e10cSrcweir             chart2::DataPointLabel aLabel;
559*cdf0e10cSrcweir             if( GetPropertySet()->getPropertyValue( C2U( "Label" )) >>= aLabel )
560*cdf0e10cSrcweir             {
561*cdf0e10cSrcweir                 sal_Bool bValue = (SCHATTR_DATADESCR_SHOW_NUMBER==nWhichId) ? aLabel.ShowNumber : (
562*cdf0e10cSrcweir                     (SCHATTR_DATADESCR_SHOW_PERCENTAGE==nWhichId) ? aLabel.ShowNumberInPercent : (
563*cdf0e10cSrcweir                     (SCHATTR_DATADESCR_SHOW_CATEGORY==nWhichId) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol ));
564*cdf0e10cSrcweir 
565*cdf0e10cSrcweir                 rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir                 if( m_bOverwriteLabelsForAttributedDataPointsAlso )
568*cdf0e10cSrcweir                 {
569*cdf0e10cSrcweir                     if( DataSeriesHelper::hasAttributedDataPointDifferentValue(
570*cdf0e10cSrcweir                         Reference< chart2::XDataSeries >( GetPropertySet(), uno::UNO_QUERY), C2U( "Label" ), uno::makeAny(aLabel) ) )
571*cdf0e10cSrcweir                     {
572*cdf0e10cSrcweir                         rOutItemSet.InvalidateItem(nWhichId);
573*cdf0e10cSrcweir                     }
574*cdf0e10cSrcweir                 }
575*cdf0e10cSrcweir             }
576*cdf0e10cSrcweir         }
577*cdf0e10cSrcweir         break;
578*cdf0e10cSrcweir 
579*cdf0e10cSrcweir         case SID_ATTR_NUMBERFORMAT_VALUE:
580*cdf0e10cSrcweir         {
581*cdf0e10cSrcweir             sal_Int32 nKey = 0;
582*cdf0e10cSrcweir             if( !(GetPropertySet()->getPropertyValue( C2U( "NumberFormat" )) >>= nKey) )
583*cdf0e10cSrcweir                 nKey = m_nNumberFormat;
584*cdf0e10cSrcweir             rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey ));
585*cdf0e10cSrcweir         }
586*cdf0e10cSrcweir         break;
587*cdf0e10cSrcweir 
588*cdf0e10cSrcweir         case SCHATTR_PERCENT_NUMBERFORMAT_VALUE:
589*cdf0e10cSrcweir         {
590*cdf0e10cSrcweir             sal_Int32 nKey = 0;
591*cdf0e10cSrcweir             if( !(GetPropertySet()->getPropertyValue( C2U( "PercentageNumberFormat" )) >>= nKey) )
592*cdf0e10cSrcweir                 nKey = m_nPercentNumberFormat;
593*cdf0e10cSrcweir             rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey ));
594*cdf0e10cSrcweir         }
595*cdf0e10cSrcweir         break;
596*cdf0e10cSrcweir 
597*cdf0e10cSrcweir         case SID_ATTR_NUMBERFORMAT_SOURCE:
598*cdf0e10cSrcweir         {
599*cdf0e10cSrcweir             bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( C2U( "NumberFormat" )).hasValue());
600*cdf0e10cSrcweir             rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
601*cdf0e10cSrcweir         }
602*cdf0e10cSrcweir         break;
603*cdf0e10cSrcweir         case SCHATTR_PERCENT_NUMBERFORMAT_SOURCE:
604*cdf0e10cSrcweir         {
605*cdf0e10cSrcweir             bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( C2U( "PercentageNumberFormat" )).hasValue());
606*cdf0e10cSrcweir             rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
607*cdf0e10cSrcweir         }
608*cdf0e10cSrcweir         break;
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir         case SCHATTR_DATADESCR_SEPARATOR:
611*cdf0e10cSrcweir         {
612*cdf0e10cSrcweir             rtl::OUString aValue;
613*cdf0e10cSrcweir             try
614*cdf0e10cSrcweir             {
615*cdf0e10cSrcweir                 GetPropertySet()->getPropertyValue( C2U( "LabelSeparator" ) ) >>= aValue;
616*cdf0e10cSrcweir                 rOutItemSet.Put( SfxStringItem( nWhichId, aValue ));
617*cdf0e10cSrcweir             }
618*cdf0e10cSrcweir             catch( uno::Exception& e )
619*cdf0e10cSrcweir 	        {
620*cdf0e10cSrcweir                 ASSERT_EXCEPTION( e );
621*cdf0e10cSrcweir             }
622*cdf0e10cSrcweir         }
623*cdf0e10cSrcweir         break;
624*cdf0e10cSrcweir 
625*cdf0e10cSrcweir         case SCHATTR_DATADESCR_PLACEMENT:
626*cdf0e10cSrcweir         {
627*cdf0e10cSrcweir             try
628*cdf0e10cSrcweir             {
629*cdf0e10cSrcweir                 sal_Int32 nPlacement=0;
630*cdf0e10cSrcweir                 if( GetPropertySet()->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nPlacement )
631*cdf0e10cSrcweir                     rOutItemSet.Put( SfxInt32Item( nWhichId, nPlacement ));
632*cdf0e10cSrcweir                 else if( m_aAvailableLabelPlacements.getLength() )
633*cdf0e10cSrcweir                     rOutItemSet.Put( SfxInt32Item( nWhichId, m_aAvailableLabelPlacements[0] ));
634*cdf0e10cSrcweir             }
635*cdf0e10cSrcweir             catch( uno::Exception& e )
636*cdf0e10cSrcweir 	        {
637*cdf0e10cSrcweir                 ASSERT_EXCEPTION( e );
638*cdf0e10cSrcweir             }
639*cdf0e10cSrcweir         }
640*cdf0e10cSrcweir         break;
641*cdf0e10cSrcweir 
642*cdf0e10cSrcweir         case SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS:
643*cdf0e10cSrcweir         {
644*cdf0e10cSrcweir             SvULongs aList;
645*cdf0e10cSrcweir             for ( sal_Int32 nN=0; nN<m_aAvailableLabelPlacements.getLength(); nN++ )
646*cdf0e10cSrcweir                 aList.Insert( m_aAvailableLabelPlacements[nN], sal::static_int_cast< sal_uInt16 >(nN) );
647*cdf0e10cSrcweir             rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
648*cdf0e10cSrcweir         }
649*cdf0e10cSrcweir         break;
650*cdf0e10cSrcweir 
651*cdf0e10cSrcweir         case SCHATTR_DATADESCR_NO_PERCENTVALUE:
652*cdf0e10cSrcweir         {
653*cdf0e10cSrcweir             rOutItemSet.Put( SfxBoolItem( nWhichId, m_bForbidPercentValue ));
654*cdf0e10cSrcweir         }
655*cdf0e10cSrcweir         break;
656*cdf0e10cSrcweir 
657*cdf0e10cSrcweir         case SCHATTR_STYLE_SYMBOL:
658*cdf0e10cSrcweir         {
659*cdf0e10cSrcweir             chart2::Symbol aSymbol;
660*cdf0e10cSrcweir             if( GetPropertySet()->getPropertyValue( C2U( "Symbol" )) >>= aSymbol )
661*cdf0e10cSrcweir                 rOutItemSet.Put( SfxInt32Item( nWhichId, lcl_getSymbolStyleForSymbol( aSymbol ) ));
662*cdf0e10cSrcweir         }
663*cdf0e10cSrcweir         break;
664*cdf0e10cSrcweir 
665*cdf0e10cSrcweir         case SCHATTR_SYMBOL_SIZE:
666*cdf0e10cSrcweir         {
667*cdf0e10cSrcweir             chart2::Symbol aSymbol;
668*cdf0e10cSrcweir             if( GetPropertySet()->getPropertyValue( C2U( "Symbol" )) >>= aSymbol )
669*cdf0e10cSrcweir                 rOutItemSet.Put(
670*cdf0e10cSrcweir                     SvxSizeItem( nWhichId, Size( aSymbol.Size.Width, aSymbol.Size.Height ) ));
671*cdf0e10cSrcweir         }
672*cdf0e10cSrcweir         break;
673*cdf0e10cSrcweir 
674*cdf0e10cSrcweir         case SCHATTR_SYMBOL_BRUSH:
675*cdf0e10cSrcweir         {
676*cdf0e10cSrcweir             chart2::Symbol aSymbol;
677*cdf0e10cSrcweir             if(( GetPropertySet()->getPropertyValue( C2U( "Symbol" )) >>= aSymbol )
678*cdf0e10cSrcweir                && aSymbol.Graphic.is() )
679*cdf0e10cSrcweir             {
680*cdf0e10cSrcweir                 rOutItemSet.Put( SvxBrushItem( Graphic( aSymbol.Graphic ), GPOS_MM, SCHATTR_SYMBOL_BRUSH ));
681*cdf0e10cSrcweir             }
682*cdf0e10cSrcweir         }
683*cdf0e10cSrcweir         break;
684*cdf0e10cSrcweir 
685*cdf0e10cSrcweir         case SCHATTR_TEXT_DEGREES:
686*cdf0e10cSrcweir         {
687*cdf0e10cSrcweir             double fValue = 0;
688*cdf0e10cSrcweir 
689*cdf0e10cSrcweir             if( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fValue )
690*cdf0e10cSrcweir             {
691*cdf0e10cSrcweir                 rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast< sal_Int32 >(
692*cdf0e10cSrcweir                                                    ::rtl::math::round( fValue * 100.0 ) ) ));
693*cdf0e10cSrcweir             }
694*cdf0e10cSrcweir         }
695*cdf0e10cSrcweir         break;
696*cdf0e10cSrcweir    }
697*cdf0e10cSrcweir }
698*cdf0e10cSrcweir 
699*cdf0e10cSrcweir } //  namespace wrapper
700*cdf0e10cSrcweir } //  namespace chart
701