1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26 
27 #include "res_DataLabel.hxx"
28 #include "res_DataLabel_IDs.hrc"
29 
30 #include "Strings.hrc"
31 #include "ResId.hxx"
32 #include "chartview/ChartSfxItemIds.hxx"
33 #include "NoWarningThisInCTOR.hxx"
34 #include "dlg_NumberFormat.hxx"
35 
36 // header for class SvxNumberInfoItem
37 #include <svx/numinf.hxx>
38 #include <svl/eitem.hxx>
39 // for SfxUInt32Item
40 #include <svl/intitem.hxx>
41 // header for class SfxStringItem
42 #include <svl/stritem.hxx>
43 //SfxIntegerListItem
44 #include <svl/ilstitem.hxx>
45 #include <editeng/eeitem.hxx>
46 #include <editeng/frmdiritem.hxx>
47 
48 // header for define RET_OK
49 #include <vcl/msgbox.hxx>
50 #include <svx/svxids.hrc>
51 // header for SvNumberFormatter
52 #include <svl/zforlist.hxx>
53 #include <svtools/controldims.hrc>
54 
55 
56 //.............................................................................
57 namespace chart
58 {
59 //.............................................................................
60 
61 namespace
62 {
63 
lcl_ReadNumberFormatFromItemSet(const SfxItemSet & rSet,sal_uInt16 nValueWhich,sal_uInt16 nSourceFormatWhich,sal_uLong & rnFormatKeyOut,bool & rbSourceFormatOut,bool & rbSourceFormatMixedStateOut)64 bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, sal_uInt16 nValueWhich, sal_uInt16 nSourceFormatWhich, sal_uLong& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
65 {
66     bool bSet = false;
67     const SfxPoolItem *pItem1 = NULL;
68     if( rSet.GetItemState( nValueWhich, sal_True, &pItem1 ) == SFX_ITEM_SET )
69     {
70         const SfxUInt32Item * pNumItem = dynamic_cast< const SfxUInt32Item * >( pItem1 );
71         if( pNumItem )
72         {
73             rnFormatKeyOut = pNumItem->GetValue();
74             bSet = true;
75         }
76     }
77 
78     rbSourceFormatMixedStateOut=true;
79     const SfxPoolItem *pItem2 = NULL;
80     if( rSet.GetItemState( nSourceFormatWhich, sal_True, &pItem2 ) == SFX_ITEM_SET )
81     {
82         const SfxBoolItem * pBoolItem = dynamic_cast< const SfxBoolItem * >( pItem2 );
83         if( pBoolItem )
84         {
85             rbSourceFormatOut = pBoolItem->GetValue();
86             rbSourceFormatMixedStateOut=false;
87         }
88     }
89     return bSet;
90 }
91 
lcl_setBoolItemToCheckBox(const SfxItemSet & rInAttrs,sal_uInt16 nWhichId,CheckBox & rCheckbox)92 void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, sal_uInt16 nWhichId, CheckBox& rCheckbox )
93 {
94     rCheckbox.EnableTriState( sal_False );
95 
96     const SfxPoolItem *pPoolItem = NULL;
97     if( rInAttrs.GetItemState(nWhichId, sal_True, &pPoolItem) == SFX_ITEM_SET )
98         rCheckbox.Check( ((const SfxBoolItem*)pPoolItem)->GetValue() );
99     else
100     {
101         rCheckbox.EnableTriState( sal_True );
102         rCheckbox.SetState( STATE_DONTKNOW );
103     }
104 }
105 
106 }//end anonymous namespace
107 
DataLabelResources(Window * pWindow,const SfxItemSet & rInAttrs)108 DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs )
109     : m_aCBNumber(pWindow, SchResId(CB_VALUE_AS_NUMBER)),
110     m_aPB_NumberFormatForValue(pWindow, SchResId(PB_NUMBERFORMAT)),
111     m_aCBPercent(pWindow, SchResId(CB_VALUE_AS_PERCENTAGE)),
112     m_aPB_NumberFormatForPercent(pWindow, SchResId(PB_PERCENT_NUMBERFORMAT)),
113     m_aCBCategory(pWindow, SchResId(CB_CATEGORY)),
114     m_aCBSymbol(pWindow, SchResId(CB_SYMBOL)),
115     m_aSeparatorResources(pWindow),
116     m_aFT_LabelPlacement(pWindow, SchResId(FT_LABEL_PLACEMENT)),
117     m_aLB_LabelPlacement(pWindow, SchResId(LB_LABEL_PLACEMENT)),
118     m_aFL_Rotate(pWindow, SchResId(FL_LABEL_ROTATE)),
119     m_aDC_Dial(pWindow, SchResId(CT_LABEL_DIAL)),
120     m_aFT_Degrees(pWindow, SchResId(FT_LABEL_DEGREES)),
121     m_aNF_Degrees(pWindow, SchResId(NF_LABEL_DEGREES)),
122     m_aFT_TextDirection(pWindow, SchResId(FT_LABEL_TEXTDIR)),
123     m_aLB_TextDirection(pWindow, SchResId(LB_LABEL_TEXTDIR), &m_aFT_TextDirection),
124     m_pNumberFormatter(0),
125     m_bNumberFormatMixedState(true),
126     m_bPercentFormatMixedState(true),
127     m_nNumberFormatForValue(0),
128     m_nNumberFormatForPercent(11),
129     m_bSourceFormatMixedState(true),
130     m_bPercentSourceMixedState(true),
131     m_bSourceFormatForValue(true),
132     m_bSourceFormatForPercent(true),
133     m_pWindow(pWindow),
134     m_pPool(rInAttrs.GetPool())
135 {
136     //fill label placement list
137     std::map< sal_Int32, XubString > aPlacementToStringMap;
138     for( sal_Int32 nEnum=0; nEnum<m_aLB_LabelPlacement.GetEntryCount(); ++nEnum )
139         aPlacementToStringMap[nEnum]=m_aLB_LabelPlacement.GetEntry(static_cast<sal_uInt16>(nEnum));
140 
141     ::com::sun::star::uno::Sequence < sal_Int32 > aAvailabelPlacementList;
142     const SfxPoolItem *pPoolItem = NULL;
143     if( rInAttrs.GetItemState(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, sal_True, &pPoolItem) == SFX_ITEM_SET )
144         aAvailabelPlacementList =((const SfxIntegerListItem*)pPoolItem)->GetConstSequence();
145 
146     m_aLB_LabelPlacement.Clear();
147     for( sal_Int32 nN=0; nN<aAvailabelPlacementList.getLength(); ++nN )
148     {
149         sal_uInt16 nListBoxPos = static_cast<sal_uInt16>( nN );
150         sal_Int32 nPlacement = aAvailabelPlacementList[nN];
151         m_aPlacementToListBoxMap[nPlacement]=nListBoxPos;
152         m_aListBoxToPlacementMap[nListBoxPos]=nPlacement;
153         m_aLB_LabelPlacement.InsertEntry( aPlacementToStringMap[nPlacement] );
154     }
155     m_aLB_LabelPlacement.SetDropDownLineCount(m_aLB_LabelPlacement.GetEntryCount());
156 
157     //replace&resize push buttons and resize checkboxes
158     Size aControlDistance( pWindow->LogicToPixel( Size(RSC_SP_CTRL_DESC_X,RSC_SP_CTRL_GROUP_Y), MapMode(MAP_APPFONT) ) );
159     long nPBWidth = ::std::max( m_aPB_NumberFormatForPercent.CalcMinimumSize().getWidth(), m_aPB_NumberFormatForValue.CalcMinimumSize().getWidth() )
160         + 20; //the min with is to small to fit, hm... so add alittle
161     long nCBXWidth = ::std::max( m_aCBNumber.CalcMinimumSize().getWidth(), m_aCBPercent.CalcMinimumSize().getWidth() );
162     long nNewPBXPos = m_aCBNumber.GetPosPixel().X() + nCBXWidth + aControlDistance.Width();
163     long nPageWidth = pWindow->LogicToPixel( Size(260,185), MapMode(MAP_APPFONT) ).getWidth();
164     if( nNewPBXPos + nPBWidth > nPageWidth )
165     {
166         if( nPBWidth > nPageWidth/2 )
167             nPBWidth = nPageWidth/2;
168         nNewPBXPos = nPageWidth-nPBWidth;
169         nCBXWidth = nPageWidth-m_aCBNumber.GetPosPixel().X()-nPBWidth-aControlDistance.Width();
170     }
171     m_aPB_NumberFormatForValue.SetPosPixel( Point( nNewPBXPos, m_aPB_NumberFormatForValue.GetPosPixel().Y() ) );
172     m_aPB_NumberFormatForPercent.SetPosPixel( Point( nNewPBXPos, m_aPB_NumberFormatForPercent.GetPosPixel().Y() ) );
173 
174     Size aPBSize( m_aPB_NumberFormatForPercent.GetSizePixel() );
175     aPBSize.setWidth( nPBWidth );
176     m_aPB_NumberFormatForValue.SetSizePixel( aPBSize );
177     m_aPB_NumberFormatForPercent.SetSizePixel( aPBSize );
178 
179     Size aCBSize( m_aCBNumber.GetSizePixel() );
180     aCBSize.setWidth(nCBXWidth);
181     m_aCBNumber.SetSizePixel( aCBSize );
182     m_aCBPercent.SetSizePixel( aCBSize );
183 
184     //place and align separator and label placement listboxes
185     Size aSize( m_aFT_LabelPlacement.GetSizePixel() );
186     aSize.setWidth( m_aFT_LabelPlacement.CalcMinimumSize().getWidth() );
187     m_aFT_LabelPlacement.SetSizePixel(aSize);
188 
189     long nWantedMinLeftBorder = m_aFT_LabelPlacement.GetPosPixel().X() + aSize.getWidth () + aControlDistance.Width();
190 
191     m_aSeparatorResources.PositionBelowControl(m_aCBSymbol);
192     m_aSeparatorResources.AlignListBoxWidthAndXPos( nWantedMinLeftBorder, -1, m_aLB_LabelPlacement.CalcMinimumSize().getWidth() );
193     m_aSeparatorResources.Show(true);
194 
195     aSize = m_aLB_LabelPlacement.GetSizePixel();
196     aSize.setWidth( m_aSeparatorResources.GetCurrentListBoxSize().getWidth() );
197     m_aLB_LabelPlacement.SetSizePixel(aSize);
198     m_aLB_LabelPlacement.SetPosPixel( Point( m_aSeparatorResources.GetCurrentListBoxPosition().X(), m_aLB_LabelPlacement.GetPosPixel().Y() ) );
199 
200     //some click handler
201     m_aPB_NumberFormatForValue.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
202     m_aPB_NumberFormatForPercent.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
203     m_aCBNumber.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
204     m_aCBPercent.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
205     m_aCBCategory.SetClickHdl(  LINK( this, DataLabelResources, CheckHdl ));
206     m_aCBSymbol.SetClickHdl(  LINK( this, DataLabelResources, CheckHdl ));
207 
208     m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
209     m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
210 
211     if( rInAttrs.GetItemState(SCHATTR_DATADESCR_NO_PERCENTVALUE, sal_True, &pPoolItem) == SFX_ITEM_SET )
212     {
213         bool bForbidPercentValue = (static_cast< const SfxBoolItem & >( rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE )).GetValue() );
214         if( bForbidPercentValue )
215             m_aCBPercent.Enable(false);
216     }
217 
218     m_aDC_Dial.SetLinkedField( &m_aNF_Degrees );
219 }
220 
~DataLabelResources()221 DataLabelResources::~DataLabelResources()
222 {
223 }
224 
SetNumberFormatter(SvNumberFormatter * pFormatter)225 void DataLabelResources::SetNumberFormatter( SvNumberFormatter* pFormatter )
226 {
227     m_pNumberFormatter = pFormatter;
228 }
229 
IMPL_LINK(DataLabelResources,NumberFormatDialogHdl,PushButton *,pButton)230 IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
231 {
232     if( !m_pPool || !m_pNumberFormatter )
233     {
234         DBG_ERROR("Missing item pool or number formatter");
235         return 1;
236     }
237 
238     if( pButton == &m_aPB_NumberFormatForValue && !m_aCBNumber.IsChecked())
239         m_aCBNumber.Check();
240     else if( pButton == &m_aPB_NumberFormatForPercent && !m_aCBPercent.IsChecked())
241         m_aCBPercent.Check();
242 
243     SfxItemSet aNumberSet = NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( *m_pPool );
244     aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
245 
246     bool bPercent = ( pButton == &m_aPB_NumberFormatForPercent );
247 
248     sal_uLong& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue;
249     bool& rUseSourceFormat = bPercent ? m_bSourceFormatForPercent : m_bSourceFormatForValue;
250     bool& rbMixedState = bPercent ? m_bPercentFormatMixedState : m_bNumberFormatMixedState;
251     bool& rbSourceMixedState = bPercent ? m_bPercentSourceMixedState : m_bSourceFormatMixedState;
252 
253     if(!rbMixedState)
254         aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey ));
255     aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));
256 
257     NumberFormatDialog aDlg(m_pWindow, aNumberSet);
258     if( bPercent )
259         aDlg.SetText( String( SchResId( STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE ) ) );
260     if( RET_OK == aDlg.Execute() )
261     {
262         const SfxItemSet* pResult = aDlg.GetOutputItemSet();
263         if( pResult )
264         {
265             bool bOldSource = rUseSourceFormat;
266             sal_uLong nOldFormat = rnFormatKey;
267             bool bOldMixedState = rbMixedState || rbSourceMixedState;
268 
269             rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState );
270 
271             //todo this maybe can be removed when the numberformatter dialog does handle mixed state for source format correctly
272             if( bOldMixedState && bOldSource == rUseSourceFormat && nOldFormat == rnFormatKey )
273                 rbMixedState = rbSourceMixedState = true;
274         }
275     }
276     return 0;
277 }
278 
IMPL_LINK(DataLabelResources,CheckHdl,CheckBox *,pBox)279 IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
280 {
281     if( pBox )
282         pBox->EnableTriState( sal_False );
283     EnableControls();
284     return 0;
285 }
286 
EnableControls()287 void DataLabelResources::EnableControls()
288 {
289     m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() );
290 
291     //enable separator
292     {
293         long nNumberOfCheckedLabelParts = 0;
294         if( m_aCBNumber.IsChecked() )
295             ++nNumberOfCheckedLabelParts;
296         if( m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() )
297             ++nNumberOfCheckedLabelParts;
298         if( m_aCBCategory.IsChecked() )
299             ++nNumberOfCheckedLabelParts;
300         m_aSeparatorResources.Enable( nNumberOfCheckedLabelParts > 1 );
301         bool bEnableTextDir = nNumberOfCheckedLabelParts > 0;
302         m_aFT_TextDirection.Enable( bEnableTextDir );
303         m_aLB_TextDirection.Enable( bEnableTextDir );
304         bool bEnablePlacement = nNumberOfCheckedLabelParts > 0 && m_aLB_LabelPlacement.GetEntryCount()>1;
305         m_aFT_LabelPlacement.Enable( bEnablePlacement );
306         m_aLB_LabelPlacement.Enable( bEnablePlacement );
307     }
308 
309     m_aPB_NumberFormatForValue.Enable( m_pNumberFormatter && m_aCBNumber.IsChecked() );
310     m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() );
311 
312     bool bEnableRotation = ( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() );
313     m_aFL_Rotate.Enable( bEnableRotation );
314     m_aDC_Dial.Enable( bEnableRotation );
315     m_aFT_Degrees.Enable( bEnableRotation );
316     m_aNF_Degrees.Enable( bEnableRotation );
317 }
318 
FillItemSet(SfxItemSet & rOutAttrs) const319 sal_Bool DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
320 {
321     if( m_aCBNumber.IsChecked() )
322     {
323         if( !m_bNumberFormatMixedState )
324             rOutAttrs.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, m_nNumberFormatForValue ));
325         if( !m_bSourceFormatMixedState )
326             rOutAttrs.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, m_bSourceFormatForValue ));
327     }
328     if( m_aCBPercent.IsChecked() )
329     {
330         if( !m_bPercentFormatMixedState )
331             rOutAttrs.Put( SfxUInt32Item( SCHATTR_PERCENT_NUMBERFORMAT_VALUE, m_nNumberFormatForPercent ));
332         if( !m_bPercentSourceMixedState )
333             rOutAttrs.Put( SfxBoolItem( SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_bSourceFormatForPercent ));
334     }
335 
336     if( m_aCBNumber.GetState()!= STATE_DONTKNOW )
337         rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_NUMBER, m_aCBNumber.IsChecked() ) );
338     if( m_aCBPercent.GetState()!= STATE_DONTKNOW )
339         rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_aCBPercent.IsChecked() ) );
340     if( m_aCBCategory.GetState()!= STATE_DONTKNOW )
341         rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_CATEGORY, m_aCBCategory.IsChecked() ) );
342     if( m_aCBSymbol.GetState()!= STATE_DONTKNOW )
343         rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, m_aCBSymbol.IsChecked()) );
344 
345     rOutAttrs.Put( SfxStringItem( SCHATTR_DATADESCR_SEPARATOR, m_aSeparatorResources.GetValue() ) );
346     ::std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_aLB_LabelPlacement.GetSelectEntryPos()) );
347     if(aIt!=m_aListBoxToPlacementMap.end())
348     {
349         sal_Int32 nValue = aIt->second;
350         rOutAttrs.Put( SfxInt32Item( SCHATTR_DATADESCR_PLACEMENT, nValue ) );
351     }
352 
353     if( m_aLB_TextDirection.GetSelectEntryCount() > 0 )
354         rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLB_TextDirection.GetSelectEntryValue() ) );
355 
356     if( m_aDC_Dial.IsVisible() )
357     {
358         sal_Int32 nDegrees = m_aDC_Dial.GetRotation();
359         rOutAttrs.Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
360     }
361 
362     return sal_True;
363 }
364 
Reset(const SfxItemSet & rInAttrs)365 void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
366 {
367     // default state
368     m_aCBSymbol.Enable( sal_False );
369 
370     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, m_aCBNumber );
371     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_aCBPercent );
372     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, m_aCBCategory );
373     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, m_aCBSymbol );
374 
375     m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
376     m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent ,  m_bPercentSourceMixedState);
377 
378     const SfxPoolItem *pPoolItem = NULL;
379     if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, sal_True, &pPoolItem) == SFX_ITEM_SET )
380         m_aSeparatorResources.SetValue( ((const SfxStringItem*)pPoolItem)->GetValue() );
381     else
382         m_aSeparatorResources.SetDefault();
383 
384     if( rInAttrs.GetItemState(SCHATTR_DATADESCR_PLACEMENT, sal_True, &pPoolItem) == SFX_ITEM_SET )
385     {
386         sal_Int32 nPlacement = ((const SfxInt32Item*)pPoolItem)->GetValue();
387         ::std::map< sal_Int32, sal_uInt16 >::const_iterator aIt( m_aPlacementToListBoxMap.find(nPlacement) );
388         if(aIt!=m_aPlacementToListBoxMap.end())
389         {
390             sal_uInt16 nPos = aIt->second;
391             m_aLB_LabelPlacement.SelectEntryPos( nPos );
392         }
393         else
394             m_aLB_LabelPlacement.SetNoSelection();
395     }
396     else
397         m_aLB_LabelPlacement.SetNoSelection();
398 
399     if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
400         m_aLB_TextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
401 
402     if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, sal_True, &pPoolItem ) == SFX_ITEM_SET )
403     {
404         sal_Int32 nDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
405         m_aDC_Dial.SetRotation( nDegrees );
406     }
407     else
408     m_aDC_Dial.SetRotation( 0 );
409 
410     EnableControls();
411 }
412 
413 //.............................................................................
414 } //namespace chart
415 //.............................................................................
416