Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / chart2 / source / controller / itemsetwrapper / TextLabelItemConverter.cxx
blobd4eda866e03226100700a1d4bde5158a90d9c321
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <TextLabelItemConverter.hxx>
21 #include <CharacterPropertyItemConverter.hxx>
22 #include <ChartModelHelper.hxx>
23 #include <ChartTypeHelper.hxx>
24 #include <DataSeriesHelper.hxx>
25 #include <DiagramHelper.hxx>
26 #include <ItemPropertyMap.hxx>
27 #include "SchWhichPairs.hxx"
28 #include <unonames.hxx>
30 #include <editeng/brushitem.hxx>
31 #include <editeng/sizeitem.hxx>
32 #include <svl/ilstitem.hxx>
33 #include <svl/intitem.hxx>
34 #include <svl/stritem.hxx>
35 #include <svx/tabline.hxx>
37 #include <com/sun/star/chart2/DataPointLabel.hpp>
38 #include <com/sun/star/chart2/Symbol.hpp>
39 #include <memory>
41 using namespace com::sun::star;
42 using namespace com::sun::star::chart2;
43 using com::sun::star::uno::Reference;
45 namespace chart { namespace wrapper {
47 namespace {
49 const ItemPropertyMapType& getTextLabelPropertyMap()
51 static ItemPropertyMapType aMap{
52 {XATTR_LINESTYLE, {CHART_UNONAME_LABEL_BORDER_STYLE, 0}},
53 {XATTR_LINEWIDTH, {CHART_UNONAME_LABEL_BORDER_WIDTH, 0}},
54 {XATTR_LINEDASH, {CHART_UNONAME_LABEL_BORDER_DASH, 0}},
55 {XATTR_LINECOLOR, {CHART_UNONAME_LABEL_BORDER_COLOR, 0}},
56 {XATTR_LINETRANSPARENCE, {CHART_UNONAME_LABEL_BORDER_TRANS, 0}}};
57 return aMap;
60 sal_Int32 getSymbolStyleForSymbol( const chart2::Symbol& rSymbol )
62 sal_Int32 nStyle = SVX_SYMBOLTYPE_UNKNOWN;
63 switch (rSymbol.Style)
65 case chart2::SymbolStyle_NONE:
66 nStyle = SVX_SYMBOLTYPE_NONE;
67 break;
68 case chart2::SymbolStyle_AUTO:
69 nStyle = SVX_SYMBOLTYPE_AUTO;
70 break;
71 case chart2::SymbolStyle_GRAPHIC:
72 nStyle = SVX_SYMBOLTYPE_BRUSHITEM;
73 break;
74 case chart2::SymbolStyle_STANDARD:
75 nStyle = rSymbol.StandardSymbol;
76 break;
77 case chart2::SymbolStyle_POLYGON:
78 default:
81 return nStyle;
84 bool numberFormatFromItemToPropertySet(
85 sal_uInt16 nWhichId, const SfxItemSet& rItemSet, const uno::Reference<beans::XPropertySet>& xPropertySet,
86 bool bOverwriteDataPoints )
88 bool bChanged = false;
89 if (!xPropertySet.is())
90 return bChanged;
92 OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat");
93 sal_uInt16 nSourceWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
95 if (rItemSet.GetItemState(nSourceWhich) != SfxItemState::SET)
96 return bChanged;
98 uno::Any aValue;
99 bool bUseSourceFormat = static_cast<const SfxBoolItem&>(rItemSet.Get(nSourceWhich)).GetValue();
100 if (!bUseSourceFormat)
102 SfxItemState aState = rItemSet.GetItemState(nWhichId);
103 if (aState == SfxItemState::SET)
105 sal_Int32 nFmt = static_cast<sal_Int32>(
106 static_cast<const SfxUInt32Item&>(
107 rItemSet.Get(nWhichId)).GetValue());
108 aValue <<= nFmt;
110 else
111 return bChanged;
114 uno::Any aOldValue = xPropertySet->getPropertyValue(aPropertyName);
115 if (bOverwriteDataPoints)
117 Reference<chart2::XDataSeries> xSeries(xPropertySet, uno::UNO_QUERY);
118 if (aValue != aOldValue ||
119 ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, aPropertyName, aOldValue))
121 ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, aPropertyName, aValue);
122 bChanged = true;
125 else if (aOldValue != aValue)
127 xPropertySet->setPropertyValue(aPropertyName, aValue);
128 bChanged = true;
130 return bChanged;
133 bool useSourceFormatFromItemToPropertySet(
134 sal_uInt16 nWhichId, const SfxItemSet& rItemSet, const uno::Reference<beans::XPropertySet>& xPropertySet,
135 bool bOverwriteDataPoints )
137 bool bChanged = false;
138 if (!xPropertySet.is())
139 return bChanged;
140 OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat");
141 sal_uInt16 nFormatWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
143 if (rItemSet.GetItemState(nWhichId) != SfxItemState::SET)
144 return bChanged;
146 uno::Any aNewValue;
147 bool bUseSourceFormat = static_cast<const SfxBoolItem&>(
148 rItemSet.Get(nWhichId)).GetValue();
149 if (!bUseSourceFormat)
151 SfxItemState aState = rItemSet.GetItemState(nFormatWhich);
152 if (aState == SfxItemState::SET)
154 sal_Int32 nFormatKey = static_cast<sal_Int32>(
155 static_cast<const SfxUInt32Item&>(
156 rItemSet.Get(nFormatWhich)).GetValue());
157 aNewValue <<= nFormatKey;
159 else
160 return bChanged;
163 uno::Any aOldValue(xPropertySet->getPropertyValue(aPropertyName));
164 if (bOverwriteDataPoints)
166 Reference<chart2::XDataSeries> xSeries(xPropertySet, uno::UNO_QUERY);
167 if (aNewValue != aOldValue ||
168 ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, aPropertyName, aOldValue))
170 ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, aPropertyName, aNewValue);
171 bChanged = true;
174 else if (aOldValue != aNewValue)
176 xPropertySet->setPropertyValue(aPropertyName, aNewValue);
177 bChanged = true;
180 return bChanged;
183 } // anonymous namespace
185 TextLabelItemConverter::TextLabelItemConverter(
186 const uno::Reference<frame::XModel>& xChartModel,
187 const uno::Reference<beans::XPropertySet>& rPropertySet,
188 const uno::Reference<XDataSeries>& xSeries,
189 SfxItemPool& rItemPool, const awt::Size* pRefSize,
190 bool bDataSeries, sal_Int32 nNumberFormat, sal_Int32 nPercentNumberFormat ) :
191 ItemConverter(rPropertySet, rItemPool),
192 mnNumberFormat(nNumberFormat),
193 mnPercentNumberFormat(nPercentNumberFormat),
194 mbDataSeries(bDataSeries),
195 mbForbidPercentValue(true)
197 maConverters.push_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
199 uno::Reference<XDiagram> xDiagram(ChartModelHelper::findDiagram(xChartModel));
200 uno::Reference<XChartType> xChartType(DiagramHelper::getChartTypeOfSeries(xDiagram, xSeries));
201 bool bFound = false;
202 bool bAmbiguous = false;
203 bool bSwapXAndY = DiagramHelper::getVertical(xDiagram, bFound, bAmbiguous);
204 maAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements(xChartType, bSwapXAndY, xSeries);
206 mbForbidPercentValue = ChartTypeHelper::getAxisType(xChartType, 0) != AxisType::CATEGORY;
209 TextLabelItemConverter::~TextLabelItemConverter()
211 std::for_each(maConverters.begin(), maConverters.end(), std::default_delete<ItemConverter>());
214 void TextLabelItemConverter::FillItemSet( SfxItemSet& rOutItemSet ) const
216 for( const auto& pConv : maConverters )
217 pConv->FillItemSet( rOutItemSet );
219 // own items
220 ItemConverter::FillItemSet(rOutItemSet);
223 bool TextLabelItemConverter::ApplyItemSet( const SfxItemSet& rItemSet )
225 bool bResult = false;
227 for( const auto& pConv: maConverters )
228 bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
230 // own items
231 return ItemConverter::ApplyItemSet(rItemSet) || bResult;
234 const sal_uInt16* TextLabelItemConverter::GetWhichPairs() const
236 // must span all used items!
237 return nTextLabelWhichPairs;
240 bool TextLabelItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId& rOutProperty ) const
242 const ItemPropertyMapType& rMap = getTextLabelPropertyMap();
243 ItemPropertyMapType::const_iterator it = rMap.find(nWhichId);
245 if (it == rMap.end())
246 return false;
248 rOutProperty = it->second;
249 return true;
252 bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet& rItemSet )
254 bool bChanged = false;
256 switch (nWhichId)
258 case SCHATTR_DATADESCR_SHOW_NUMBER:
259 case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
260 case SCHATTR_DATADESCR_SHOW_CATEGORY:
261 case SCHATTR_DATADESCR_SHOW_SYMBOL:
263 const SfxBoolItem& rItem = static_cast<const SfxBoolItem&>(rItemSet.Get(nWhichId));
265 uno::Any aOldValue = GetPropertySet()->getPropertyValue(CHART_UNONAME_LABEL);
266 chart2::DataPointLabel aLabel;
267 if (aOldValue >>= aLabel)
269 sal_Bool& rValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : (
270 (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : (
271 (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol));
272 bool bOldValue = rValue;
273 rValue = rItem.GetValue();
274 if (mbDataSeries)
276 Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
277 if (bOldValue != bool(rValue) ||
278 DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, CHART_UNONAME_LABEL, aOldValue))
280 DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel));
281 bChanged = true;
284 else if (bOldValue != bool(rValue))
286 GetPropertySet()->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabel));
287 bChanged = true;
291 break;
292 case SID_ATTR_NUMBERFORMAT_VALUE:
293 case SCHATTR_PERCENT_NUMBERFORMAT_VALUE: //fall through intended
295 bChanged = numberFormatFromItemToPropertySet(nWhichId, rItemSet, GetPropertySet(), mbDataSeries);
297 break;
298 case SID_ATTR_NUMBERFORMAT_SOURCE:
299 case SCHATTR_PERCENT_NUMBERFORMAT_SOURCE: //fall through intended
301 bChanged = useSourceFormatFromItemToPropertySet(nWhichId, rItemSet, GetPropertySet(), mbDataSeries);
303 break;
304 case SCHATTR_DATADESCR_SEPARATOR:
306 OUString aNewValue = static_cast<const SfxStringItem&>(rItemSet.Get(nWhichId)).GetValue();
307 OUString aOldValue;
310 GetPropertySet()->getPropertyValue("LabelSeparator") >>= aOldValue;
311 if (mbDataSeries)
313 Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
314 if (aOldValue != aNewValue ||
315 DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, "LabelSeparator", uno::Any(aOldValue)))
317 DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, "LabelSeparator", uno::Any(aNewValue));
318 bChanged = true;
321 else if (aOldValue != aNewValue)
323 GetPropertySet()->setPropertyValue("LabelSeparator", uno::Any(aNewValue));
324 bChanged = true;
327 catch (const uno::Exception& e)
329 SAL_WARN("chart2", "Exception caught. " << e);
332 break;
333 case SCHATTR_DATADESCR_WRAP_TEXT:
338 bool bNew = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
339 bool bOld = false;
340 GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bOld;
341 if( mbDataSeries )
343 Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
344 if( bOld!=bNew ||
345 DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "TextWordWrap", uno::Any( bOld ) ) )
347 DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "TextWordWrap", uno::Any( bNew ) );
348 bChanged = true;
351 else if( bOld!=bNew )
353 GetPropertySet()->setPropertyValue( "TextWordWrap", uno::Any( bNew ));
354 bChanged = true;
357 catch( const uno::Exception& e )
359 SAL_WARN("chart2", "Exception caught. " << e );
362 break;
363 case SCHATTR_DATADESCR_PLACEMENT:
367 sal_Int32 nNew = static_cast<const SfxInt32Item&>(rItemSet.Get(nWhichId)).GetValue();
368 sal_Int32 nOld = 0;
369 if (!(GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld))
371 if (maAvailableLabelPlacements.getLength())
372 nOld = maAvailableLabelPlacements[0];
374 if (mbDataSeries)
376 Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
377 if (nOld != nNew ||
378 DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, "LabelPlacement", uno::Any(nOld)))
380 DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, "LabelPlacement", uno::Any(nNew));
381 bChanged = true;
384 else if (nOld != nNew)
386 GetPropertySet()->setPropertyValue("LabelPlacement", uno::Any(nNew));
387 bChanged = true;
390 catch (const uno::Exception& e)
392 SAL_WARN("chart2", "Exception caught. " << e);
395 break;
396 case SCHATTR_STYLE_SYMBOL:
398 sal_Int32 nStyle =
399 static_cast<const SfxInt32Item&>(
400 rItemSet.Get(nWhichId)).GetValue();
401 chart2::Symbol aSymbol;
403 GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol;
404 sal_Int32 nOldStyle = getSymbolStyleForSymbol(aSymbol);
406 if (nStyle != nOldStyle)
408 bool bDeleteSymbol = false;
409 switch (nStyle)
411 case SVX_SYMBOLTYPE_NONE:
412 aSymbol.Style = chart2::SymbolStyle_NONE;
413 break;
414 case SVX_SYMBOLTYPE_AUTO:
415 aSymbol.Style = chart2::SymbolStyle_AUTO;
416 break;
417 case SVX_SYMBOLTYPE_BRUSHITEM:
418 aSymbol.Style = chart2::SymbolStyle_GRAPHIC;
419 break;
420 case SVX_SYMBOLTYPE_UNKNOWN:
421 bDeleteSymbol = true;
422 break;
424 default:
425 aSymbol.Style = chart2::SymbolStyle_STANDARD;
426 aSymbol.StandardSymbol = nStyle;
429 if (bDeleteSymbol)
430 GetPropertySet()->setPropertyValue("Symbol", uno::Any());
431 else
432 GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol));
433 bChanged = true;
436 break;
437 case SCHATTR_SYMBOL_SIZE:
439 Size aSize = static_cast<const SvxSizeItem&>(
440 rItemSet.Get(nWhichId)).GetSize();
441 chart2::Symbol aSymbol;
443 GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol;
444 if (aSize.getWidth() != aSymbol.Size.Width ||
445 aSize.getHeight() != aSymbol.Size.Height)
447 aSymbol.Size.Width = aSize.getWidth();
448 aSymbol.Size.Height = aSize.getHeight();
450 GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol));
451 bChanged = true;
454 break;
455 case SCHATTR_SYMBOL_BRUSH:
457 const SvxBrushItem& rBrshItem(static_cast<const SvxBrushItem&>(
458 rItemSet.Get(nWhichId)));
459 uno::Any aXGraphicAny;
460 const Graphic* pGraphic(rBrshItem.GetGraphic());
461 if (pGraphic)
463 uno::Reference<graphic::XGraphic> xGraphic(pGraphic->GetXGraphic());
464 if (xGraphic.is())
466 aXGraphicAny <<= xGraphic;
467 chart2::Symbol aSymbol;
468 GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol;
469 if (aSymbol.Graphic != xGraphic)
471 aSymbol.Graphic = xGraphic;
472 GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol));
473 bChanged = true;
478 break;
479 case SCHATTR_TEXT_DEGREES:
481 double fValue = static_cast<double>(
482 static_cast<const SfxInt32Item&>(
483 rItemSet.Get(nWhichId)).GetValue()) / 100.0;
484 double fOldValue = 0.0;
485 bool bPropExisted =
486 (GetPropertySet()->getPropertyValue("TextRotation") >>= fOldValue);
488 if (!bPropExisted || fOldValue != fValue)
490 GetPropertySet()->setPropertyValue("TextRotation", uno::Any(fValue));
491 bChanged = true;
494 break;
497 return bChanged;
500 void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& rOutItemSet ) const
502 switch (nWhichId)
504 case SCHATTR_DATADESCR_SHOW_NUMBER:
505 case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
506 case SCHATTR_DATADESCR_SHOW_CATEGORY:
507 case SCHATTR_DATADESCR_SHOW_SYMBOL:
509 chart2::DataPointLabel aLabel;
510 if (GetPropertySet()->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel)
512 bool bValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : (
513 (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : (
514 (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol));
516 rOutItemSet.Put(SfxBoolItem(nWhichId, bValue));
518 if (mbDataSeries)
520 if (DataSeriesHelper::hasAttributedDataPointDifferentValue(
521 Reference<chart2::XDataSeries>(GetPropertySet(), uno::UNO_QUERY), CHART_UNONAME_LABEL, uno::Any(aLabel)))
523 rOutItemSet.InvalidateItem(nWhichId);
528 break;
529 case SID_ATTR_NUMBERFORMAT_VALUE:
531 sal_Int32 nKey = 0;
532 if (!(GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nKey))
533 nKey = mnNumberFormat;
534 rOutItemSet.Put(SfxUInt32Item(nWhichId, nKey));
536 break;
537 case SCHATTR_PERCENT_NUMBERFORMAT_VALUE:
539 sal_Int32 nKey = 0;
540 if (!(GetPropertySet()->getPropertyValue("PercentageNumberFormat") >>= nKey))
541 nKey = mnPercentNumberFormat;
542 rOutItemSet.Put(SfxUInt32Item(nWhichId, nKey));
544 break;
545 case SID_ATTR_NUMBERFORMAT_SOURCE:
547 bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
548 rOutItemSet.Put(SfxBoolItem(nWhichId, !bNumberFormatIsSet));
550 break;
551 case SCHATTR_PERCENT_NUMBERFORMAT_SOURCE:
553 bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue("PercentageNumberFormat").hasValue();
554 rOutItemSet.Put(SfxBoolItem(nWhichId, !bNumberFormatIsSet));
556 break;
557 case SCHATTR_DATADESCR_SEPARATOR:
559 OUString aValue;
562 GetPropertySet()->getPropertyValue("LabelSeparator") >>= aValue;
563 rOutItemSet.Put(SfxStringItem(nWhichId, aValue));
565 catch (const uno::Exception& e)
567 SAL_WARN("chart2", "Exception caught. " << e);
570 break;
571 case SCHATTR_DATADESCR_WRAP_TEXT:
575 bool bValue = false;
576 GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bValue;
577 rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
579 catch( const uno::Exception& e )
581 SAL_WARN("chart2", "Exception caught. " << e );
584 break;
585 case SCHATTR_DATADESCR_PLACEMENT:
589 sal_Int32 nPlacement = 0;
590 if (GetPropertySet()->getPropertyValue("LabelPlacement") >>= nPlacement)
591 rOutItemSet.Put(SfxInt32Item(nWhichId, nPlacement));
592 else if (maAvailableLabelPlacements.getLength())
593 rOutItemSet.Put(SfxInt32Item(nWhichId, maAvailableLabelPlacements[0]));
595 catch (const uno::Exception& e)
597 SAL_WARN("chart2", "Exception caught. " << e);
600 break;
601 case SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS:
603 rOutItemSet.Put(SfxIntegerListItem(nWhichId, maAvailableLabelPlacements));
605 break;
606 case SCHATTR_DATADESCR_NO_PERCENTVALUE:
608 rOutItemSet.Put(SfxBoolItem(nWhichId, mbForbidPercentValue));
610 break;
611 case SCHATTR_STYLE_SYMBOL:
613 chart2::Symbol aSymbol;
614 if (GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol)
615 rOutItemSet.Put(SfxInt32Item(nWhichId, getSymbolStyleForSymbol(aSymbol)));
617 break;
618 case SCHATTR_SYMBOL_SIZE:
620 chart2::Symbol aSymbol;
621 if (GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol)
622 rOutItemSet.Put(
623 SvxSizeItem(nWhichId, Size(aSymbol.Size.Width, aSymbol.Size.Height)));
625 break;
626 case SCHATTR_SYMBOL_BRUSH:
628 chart2::Symbol aSymbol;
629 if ((GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol)
630 && aSymbol.Graphic.is())
632 rOutItemSet.Put(
633 SvxBrushItem(Graphic(aSymbol.Graphic), GPOS_MM, SCHATTR_SYMBOL_BRUSH));
636 break;
637 case SCHATTR_TEXT_DEGREES:
639 double fValue = 0;
641 if (GetPropertySet()->getPropertyValue("TextRotation") >>= fValue)
643 rOutItemSet.Put(
644 SfxInt32Item(nWhichId, static_cast<sal_Int32>(rtl::math::round(fValue * 100.0))));
647 break;
653 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */