Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/controller/dialogs/res_DataLabel.cxx
Line
Count
Source
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 <sal/config.h>
21
22
#include <string_view>
23
24
#include "res_DataLabel.hxx"
25
26
#include <TextDirectionListBox.hxx>
27
#include <chartview/ChartSfxItemIds.hxx>
28
#include "dlg_NumberFormat.hxx"
29
30
#include <svx/numinf.hxx>
31
#include <svl/eitem.hxx>
32
#include <svl/intitem.hxx>
33
#include <svl/stritem.hxx>
34
#include <svl/ilstitem.hxx>
35
#include <editeng/eeitem.hxx>
36
#include <editeng/frmdiritem.hxx>
37
#include <svx/sdangitm.hxx>
38
#include <svx/svxids.hrc>
39
#include <tools/fldunit.hxx>
40
#include <osl/diagnose.h>
41
#include <vcl/vclenum.hxx>
42
43
namespace chart
44
{
45
46
namespace
47
{
48
49
const std::u16string_view our_aLBEntryMap[] = {u" ", u", ", u"; ", u"\n", u". "};
50
51
bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, TypedWhichId<SfxUInt32Item> nValueWhich, TypedWhichId<SfxBoolItem> nSourceFormatWhich, sal_uInt32& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
52
0
{
53
0
    bool bSet = false;
54
0
    if( const SfxUInt32Item* pNumItem = rSet.GetItemIfSet( nValueWhich ) )
55
0
    {
56
0
        rnFormatKeyOut = pNumItem->GetValue();
57
0
        bSet = true;
58
0
    }
59
60
0
    rbSourceFormatMixedStateOut=true;
61
0
    if( const SfxBoolItem * pBoolItem = rSet.GetItemIfSet( nSourceFormatWhich ) )
62
0
    {
63
0
        rbSourceFormatOut = pBoolItem->GetValue();
64
0
        rbSourceFormatMixedStateOut=false;
65
0
    }
66
0
    return bSet;
67
0
}
68
69
void lcl_setBoolItemToCheckBox(const SfxItemSet& rInAttrs, TypedWhichId<SfxBoolItem> nWhichId, weld::CheckButton& rCheckbox, weld::TriStateEnabled& rTriState)
70
0
{
71
0
    if( const SfxBoolItem* pPoolItem = rInAttrs.GetItemIfSet(nWhichId) )
72
0
    {
73
0
        rCheckbox.set_active(pPoolItem->GetValue());
74
0
        rTriState.bTriStateEnabled = false;
75
0
    }
76
0
    else
77
0
    {
78
0
        rCheckbox.set_state(TRISTATE_INDET);
79
0
        rTriState.bTriStateEnabled = true;
80
0
    }
81
0
}
82
83
}//end anonymous namespace
84
85
DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pParent, const SfxItemSet& rInAttrs)
86
0
    : m_pNumberFormatter(nullptr)
87
0
    , m_bNumberFormatMixedState(true)
88
0
    , m_bPercentFormatMixedState(true)
89
0
    , m_nNumberFormatForValue(0)
90
0
    , m_nNumberFormatForPercent(11)
91
0
    , m_bSourceFormatMixedState(true)
92
0
    , m_bPercentSourceMixedState(true)
93
0
    , m_bSourceFormatForValue(true)
94
0
    , m_bSourceFormatForPercent(true)
95
0
    , m_pWindow(pParent)
96
0
    , m_pPool(rInAttrs.GetPool())
97
0
    , m_xCBNumber(pBuilder->weld_check_button(u"CB_VALUE_AS_NUMBER"_ustr))
98
0
    , m_xPB_NumberFormatForValue(pBuilder->weld_button(u"PB_NUMBERFORMAT"_ustr))
99
0
    , m_xCBPercent(pBuilder->weld_check_button(u"CB_VALUE_AS_PERCENTAGE"_ustr))
100
0
    , m_xPB_NumberFormatForPercent(pBuilder->weld_button(u"PB_PERCENT_NUMBERFORMAT"_ustr))
101
0
    , m_xFT_NumberFormatForPercent(pBuilder->weld_label(u"STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE"_ustr))
102
0
    , m_xCBCategory(pBuilder->weld_check_button(u"CB_CATEGORY"_ustr))
103
0
    , m_xCBSymbol(pBuilder->weld_check_button(u"CB_SYMBOL"_ustr))
104
0
    , m_xCBDataSeries(pBuilder->weld_check_button(u"CB_DATA_SERIES_NAME"_ustr))
105
0
    , m_xCBWrapText(pBuilder->weld_check_button(u"CB_WRAP_TEXT"_ustr))
106
0
    , m_xLB_Separator(pBuilder->weld_combo_box(u"LB_TEXT_SEPARATOR"_ustr))
107
0
    , m_xLB_LabelPlacement(pBuilder->weld_combo_box(u"LB_LABEL_PLACEMENT"_ustr))
108
0
    , m_xBxOrientation(pBuilder->weld_widget(u"boxORIENTATION"_ustr))
109
0
    , m_xFT_Dial(pBuilder->weld_label(u"CT_LABEL_DIAL"_ustr))
110
0
    , m_xNF_Degrees(pBuilder->weld_metric_spin_button(u"NF_LABEL_DEGREES"_ustr, FieldUnit::DEGREE))
111
0
    , m_xBxTextDirection(pBuilder->weld_widget(u"boxTXT_DIRECTION"_ustr))
112
0
    , m_aLB_TextDirection(pBuilder->weld_combo_box(u"LB_LABEL_TEXTDIR"_ustr))
113
0
    , m_xDC_Dial(new svx::DialControl)
114
0
    , m_xDC_DialWin(new weld::CustomWeld(*pBuilder, u"CT_DIAL"_ustr, *m_xDC_Dial))
115
0
    , m_xCBCustomLeaderLines(pBuilder->weld_check_button(u"CB_CUSTOM_LEADER_LINES"_ustr))
116
0
{
117
0
    m_xDC_Dial->SetText(m_xFT_Dial->get_label());
118
119
    //fill label placement list
120
0
    std::map< sal_Int32, OUString > aPlacementToStringMap;
121
0
    for( sal_Int32 nEnum=0; nEnum<m_xLB_LabelPlacement->get_count(); ++nEnum )
122
0
        aPlacementToStringMap[nEnum] = m_xLB_LabelPlacement->get_text(static_cast<sal_uInt16>(nEnum));
123
124
125
0
    std::vector< sal_Int32 > aAvailablePlacementList;
126
0
    if( const SfxIntegerListItem* pPlacementsItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS) )
127
0
        aAvailablePlacementList = pPlacementsItem->GetList();
128
129
0
    m_xLB_LabelPlacement->clear();
130
0
    for( size_t nN=0; nN<aAvailablePlacementList.size(); ++nN )
131
0
    {
132
0
        sal_uInt16 nListBoxPos = static_cast<sal_uInt16>( nN );
133
0
        sal_Int32 nPlacement = aAvailablePlacementList[nN];
134
0
        m_aPlacementToListBoxMap[nPlacement]=nListBoxPos;
135
0
        m_aListBoxToPlacementMap[nListBoxPos]=nPlacement;
136
0
        m_xLB_LabelPlacement->append_text( aPlacementToStringMap[nPlacement] );
137
0
    }
138
139
    //some click handler
140
0
    m_xPB_NumberFormatForValue->connect_clicked( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
141
0
    m_xPB_NumberFormatForPercent->connect_clicked( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
142
0
    m_xCBNumber->connect_toggled( LINK( this, DataLabelResources, CheckHdl ));
143
0
    m_xCBPercent->connect_toggled( LINK( this, DataLabelResources, CheckHdl ));
144
0
    m_xCBCategory->connect_toggled(  LINK( this, DataLabelResources, CheckHdl ));
145
0
    m_xCBSymbol->connect_toggled(  LINK( this, DataLabelResources, CheckHdl ));
146
0
    m_xCBDataSeries->connect_toggled(  LINK( this, DataLabelResources, CheckHdl ));
147
0
    m_xCBWrapText->connect_toggled(  LINK( this, DataLabelResources, CheckHdl ));
148
0
    m_xCBCustomLeaderLines->connect_toggled( LINK( this, DataLabelResources, CheckHdl ));
149
150
0
    m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
151
0
    m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
152
153
0
    if( const SfxBoolItem* pNoPercentValueItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_NO_PERCENTVALUE) )
154
0
    {
155
0
        bool bForbidPercentValue = pNoPercentValueItem->GetValue();
156
0
        if( bForbidPercentValue )
157
0
            m_xCBPercent->set_sensitive(false);
158
0
    }
159
160
0
    m_xDC_Dial->SetLinkedField(m_xNF_Degrees.get());
161
0
}
162
163
DataLabelResources::~DataLabelResources()
164
0
{
165
0
}
166
167
void DataLabelResources::SetNumberFormatter( SvNumberFormatter* pFormatter )
168
0
{
169
0
    m_pNumberFormatter = pFormatter;
170
0
}
171
172
IMPL_LINK(DataLabelResources, NumberFormatDialogHdl, weld::Button&, rButton, void)
173
0
{
174
0
    if( !m_pPool || !m_pNumberFormatter )
175
0
    {
176
0
        OSL_FAIL("Missing item pool or number formatter");
177
0
        return;
178
0
    }
179
180
0
    if (&rButton == m_xPB_NumberFormatForValue.get() && !m_xCBNumber->get_active())
181
0
    {
182
0
        m_xCBNumber->set_active(true);
183
0
        m_aNumberState.bTriStateEnabled = false;
184
0
    }
185
0
    else if (&rButton == m_xPB_NumberFormatForPercent.get() && !m_xCBPercent->get_active())
186
0
    {
187
0
        m_xCBPercent->set_active(true);
188
0
        m_aPercentState.bTriStateEnabled = false;
189
0
    }
190
191
0
    SfxItemSet aNumberSet = NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( *m_pPool );
192
0
    aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, SID_ATTR_NUMBERFORMAT_INFO));
193
194
0
    bool bPercent = (&rButton == m_xPB_NumberFormatForPercent.get());
195
196
0
    sal_uInt32& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue;
197
0
    bool& rUseSourceFormat = bPercent ? m_bSourceFormatForPercent : m_bSourceFormatForValue;
198
0
    bool& rbMixedState = bPercent ? m_bPercentFormatMixedState : m_bNumberFormatMixedState;
199
0
    bool& rbSourceMixedState = bPercent ? m_bPercentSourceMixedState : m_bSourceFormatMixedState;
200
201
0
    if(!rbMixedState)
202
0
        aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey ));
203
0
    aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));
204
205
0
    NumberFormatDialog aDlg(m_pWindow, aNumberSet);
206
0
    if( bPercent )
207
0
        aDlg.set_title(m_xFT_NumberFormatForPercent->get_label());
208
0
    if (aDlg.run() != RET_OK)
209
0
        return;
210
211
0
    const SfxItemSet* pResult = aDlg.GetOutputItemSet();
212
0
    if( pResult )
213
0
    {
214
0
        bool bOldSource = rUseSourceFormat;
215
0
        sal_uInt32 nOldFormat = rnFormatKey;
216
0
        bool bOldMixedState = rbMixedState || rbSourceMixedState;
217
218
0
        rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState );
219
220
        //todo this maybe can be removed when the numberformatter dialog does handle mixed state for source format correctly
221
0
        if( bOldMixedState && bOldSource == rUseSourceFormat && nOldFormat == rnFormatKey )
222
0
            rbMixedState = rbSourceMixedState = true;
223
0
    }
224
0
}
225
226
IMPL_LINK(DataLabelResources, CheckHdl, weld::Toggleable&, rToggle, void)
227
0
{
228
0
    if (&rToggle == m_xCBNumber.get())
229
0
        m_aNumberState.CheckButtonToggled(*m_xCBNumber);
230
0
    else if (&rToggle == m_xCBPercent.get())
231
0
        m_aPercentState.CheckButtonToggled(*m_xCBPercent);
232
0
    else if (&rToggle == m_xCBCategory.get())
233
0
        m_aCategoryState.CheckButtonToggled(*m_xCBCategory);
234
0
    else if (&rToggle == m_xCBSymbol.get())
235
0
        m_aSymbolState.CheckButtonToggled(*m_xCBSymbol);
236
0
    else if (&rToggle == m_xCBDataSeries.get())
237
0
        m_aDataSeriesState.CheckButtonToggled(*m_xCBDataSeries);
238
0
    else if (&rToggle == m_xCBWrapText.get())
239
0
        m_aWrapTextState.CheckButtonToggled(*m_xCBWrapText);
240
0
    else if (&rToggle == m_xCBCustomLeaderLines.get())
241
0
        m_aCustomLeaderLinesState.CheckButtonToggled(*m_xCBCustomLeaderLines);
242
0
    EnableControls();
243
0
}
244
245
void DataLabelResources::EnableControls()
246
0
{
247
0
    m_xCBSymbol->set_sensitive( m_xCBNumber->get_active() || (m_xCBPercent->get_active() && m_xCBPercent->get_sensitive())
248
0
    || m_xCBCategory->get_active() || m_xCBDataSeries->get_active());
249
250
0
    m_xCBWrapText->set_sensitive( m_xCBNumber->get_active() || (m_xCBPercent->get_active() && m_xCBPercent->get_sensitive())
251
0
    || m_xCBCategory->get_active() || m_xCBDataSeries->get_active() );
252
253
    // Enable or disable separator, placement and direction based on the check
254
    // box states. Note that the check boxes are tri-state.
255
0
    {
256
0
        tools::Long nNumberOfCheckedLabelParts = 0;
257
0
        if (m_xCBNumber->get_state() != TRISTATE_FALSE)
258
0
            ++nNumberOfCheckedLabelParts;
259
0
        if (m_xCBPercent->get_state() != TRISTATE_FALSE && m_xCBPercent->get_sensitive())
260
0
            ++nNumberOfCheckedLabelParts;
261
0
        if (m_xCBCategory->get_state() != TRISTATE_FALSE)
262
0
            ++nNumberOfCheckedLabelParts;
263
0
        if (m_xCBDataSeries->get_state() != TRISTATE_FALSE)
264
0
            ++nNumberOfCheckedLabelParts;
265
266
0
        m_xLB_Separator->set_sensitive( nNumberOfCheckedLabelParts > 1 );
267
268
0
        bool bEnableTextDir = nNumberOfCheckedLabelParts > 0;
269
0
        m_xBxTextDirection->set_sensitive( bEnableTextDir );
270
0
        bool bEnablePlacement = nNumberOfCheckedLabelParts > 0 && m_xLB_LabelPlacement->get_count()>1;
271
0
        m_xLB_LabelPlacement->set_sensitive( bEnablePlacement );
272
0
    }
273
274
0
    m_xPB_NumberFormatForValue->set_sensitive( m_pNumberFormatter && m_xCBNumber->get_active() );
275
0
    m_xPB_NumberFormatForPercent->set_sensitive( m_pNumberFormatter && m_xCBPercent->get_active() && m_xCBPercent->get_sensitive() );
276
277
0
    bool bEnableRotation = (m_xCBNumber->get_active() || m_xCBPercent->get_active()
278
0
                            || m_xCBCategory->get_active() || m_xCBDataSeries->get_active());
279
0
    m_xBxOrientation->set_sensitive(bEnableRotation);
280
0
}
281
282
void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
283
0
{
284
0
    if( m_xCBNumber->get_active() )
285
0
    {
286
0
        if( !m_bNumberFormatMixedState )
287
0
            rOutAttrs->Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, m_nNumberFormatForValue ));
288
0
        if( !m_bSourceFormatMixedState )
289
0
            rOutAttrs->Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, m_bSourceFormatForValue ));
290
0
    }
291
0
    if( m_xCBPercent->get_active() )
292
0
    {
293
0
        if( !m_bPercentFormatMixedState )
294
0
            rOutAttrs->Put( SfxUInt32Item( SCHATTR_PERCENT_NUMBERFORMAT_VALUE, m_nNumberFormatForPercent ));
295
0
        if( !m_bPercentSourceMixedState )
296
0
            rOutAttrs->Put( SfxBoolItem( SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_bSourceFormatForPercent ));
297
0
    }
298
299
0
    if( m_xCBNumber->get_state()!= TRISTATE_INDET )
300
0
        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_NUMBER, m_xCBNumber->get_active() ) );
301
0
    if( m_xCBPercent->get_state()!= TRISTATE_INDET )
302
0
        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_xCBPercent->get_active() ) );
303
0
    if( m_xCBCategory->get_state()!= TRISTATE_INDET )
304
0
        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_CATEGORY, m_xCBCategory->get_active() ) );
305
0
    if( m_xCBSymbol->get_state()!= TRISTATE_INDET )
306
0
        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, m_xCBSymbol->get_active()) );
307
0
    if( m_xCBDataSeries->get_state()!= TRISTATE_INDET )
308
0
        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, m_xCBDataSeries->get_active()) );
309
0
    if( m_xCBWrapText->get_state()!= TRISTATE_INDET )
310
0
        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_WRAP_TEXT, m_xCBWrapText->get_active()) );
311
0
    if( m_xCBCustomLeaderLines->get_state() != TRISTATE_INDET )
312
0
        rOutAttrs->Put(SfxBoolItem( SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, m_xCBCustomLeaderLines->get_active()) );
313
314
0
    auto const aSep = our_aLBEntryMap[m_xLB_Separator->get_active()];
315
0
    rOutAttrs->Put( SfxStringItem( SCHATTR_DATADESCR_SEPARATOR, OUString(aSep)) );
316
317
0
    std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_xLB_LabelPlacement->get_active()) );
318
0
    if(aIt!=m_aListBoxToPlacementMap.end())
319
0
    {
320
0
        sal_Int32 nValue = aIt->second;
321
0
        rOutAttrs->Put( SfxInt32Item( SCHATTR_DATADESCR_PLACEMENT, nValue ) );
322
0
    }
323
324
0
    if (m_aLB_TextDirection.get_active() != -1)
325
0
        rOutAttrs->Put( SvxFrameDirectionItem( m_aLB_TextDirection.get_active_id(), EE_PARA_WRITINGDIR ) );
326
327
0
    if( m_xDC_Dial->IsVisible() )
328
0
    {
329
0
        Degree100 nDegrees = m_xDC_Dial->GetRotation();
330
0
        rOutAttrs->Put(SdrAngleItem( SCHATTR_TEXT_DEGREES, nDegrees ) );
331
0
    }
332
0
}
333
334
void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
335
0
{
336
    // default state
337
0
    m_xCBSymbol->set_sensitive( false );
338
339
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, *m_xCBNumber, m_aNumberState );
340
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, *m_xCBPercent, m_aPercentState );
341
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, *m_xCBCategory, m_aCategoryState );
342
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, *m_xCBSymbol, m_aSymbolState );
343
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, *m_xCBDataSeries, m_aDataSeriesState );
344
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_WRAP_TEXT, *m_xCBWrapText, m_aWrapTextState );
345
0
    lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, *m_xCBCustomLeaderLines, m_aCustomLeaderLinesState );
346
347
0
    m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
348
0
    m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent ,  m_bPercentSourceMixedState);
349
350
0
    if( const SfxStringItem* pSeparatorItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_SEPARATOR) )
351
0
       for(size_t i=0; i < std::size(our_aLBEntryMap); ++i )
352
0
       {
353
0
          if( our_aLBEntryMap[i] == pSeparatorItem->GetValue())
354
0
              m_xLB_Separator->set_active( i );
355
0
       }
356
0
    else
357
0
        m_xLB_Separator->set_active( 0 );
358
359
0
    if( const SfxInt32Item* pPlacementItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_PLACEMENT) )
360
0
    {
361
0
        sal_Int32 nPlacement = pPlacementItem->GetValue();
362
0
        std::map< sal_Int32, sal_uInt16 >::const_iterator aIt( m_aPlacementToListBoxMap.find(nPlacement) );
363
0
        if(aIt!=m_aPlacementToListBoxMap.end())
364
0
        {
365
0
            sal_uInt16 nPos = aIt->second;
366
0
            m_xLB_LabelPlacement->set_active( nPos );
367
0
        }
368
0
        else
369
0
            m_xLB_LabelPlacement->set_active(-1);
370
0
    }
371
0
    else
372
0
        m_xLB_LabelPlacement->set_active(-1);
373
374
0
    if( const SvxFrameDirectionItem* pDirectionItem = rInAttrs.GetItemIfSet(EE_PARA_WRITINGDIR) )
375
0
        m_aLB_TextDirection.set_active_id( pDirectionItem->GetValue() );
376
377
0
    if( const SdrAngleItem* pAngleItem = rInAttrs.GetItemIfSet( SCHATTR_TEXT_DEGREES ) )
378
0
    {
379
0
        Degree100 nDegrees = pAngleItem->GetValue();
380
0
        m_xDC_Dial->SetRotation( nDegrees );
381
0
    }
382
0
    else
383
0
        m_xDC_Dial->SetRotation( 0_deg100 );
384
385
0
    EnableControls();
386
0
}
387
388
} //namespace chart
389
390
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */