diff options
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx')
-rw-r--r-- | chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx | 193 |
1 files changed, 118 insertions, 75 deletions
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx index 496b25e2692f..de12adcc9739 100644 --- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx @@ -19,10 +19,13 @@ #include <TextLabelItemConverter.hxx> #include <CharacterPropertyItemConverter.hxx> -#include <ChartModelHelper.hxx> +#include <ChartModel.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> +#include <DataSeries.hxx> #include <DataSeriesHelper.hxx> -#include <DiagramHelper.hxx> +#include <DataSeriesProperties.hxx> +#include <Diagram.hxx> #include <ItemPropertyMap.hxx> #include "SchWhichPairs.hxx" #include <unonames.hxx> @@ -34,7 +37,8 @@ #include <svl/intitem.hxx> #include <svl/stritem.hxx> #include <svx/tabline.hxx> -#include <tools/diagnose_ex.h> +#include <svx/sdangitm.hxx> +#include <comphelper/diagnose_ex.hxx> #include <vcl/graph.hxx> #include <rtl/math.hxx> @@ -43,12 +47,12 @@ #include <com/sun/star/chart2/DataPointLabel.hpp> #include <com/sun/star/chart2/Symbol.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> -#include <com/sun/star/frame/XModel.hpp> #include <memory> using namespace com::sun::star; using namespace com::sun::star::chart2; using com::sun::star::uno::Reference; +using namespace ::chart::DataSeriesProperties; namespace chart::wrapper { @@ -97,7 +101,7 @@ bool numberFormatFromItemToPropertySet( if (!xPropertySet.is()) return bChanged; - OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); + OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? CHART_UNONAME_NUMFMT : u"PercentageNumberFormat"_ustr; sal_uInt16 nSourceWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; if (rItemSet.GetItemState(nSourceWhich) != SfxItemState::SET) @@ -122,11 +126,11 @@ bool numberFormatFromItemToPropertySet( uno::Any aOldValue = xPropertySet->getPropertyValue(aPropertyName); if (bOverwriteDataPoints) { - Reference<chart2::XDataSeries> xSeries(xPropertySet, uno::UNO_QUERY); + rtl::Reference<DataSeries> xSeries( dynamic_cast<DataSeries*>(xPropertySet.get()) ); if (aValue != aOldValue || - ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, aPropertyName, aOldValue)) + xSeries->hasAttributedDataPointDifferentValue(aPropertyName, aOldValue)) { - ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, aPropertyName, aValue); + xSeries->setPropertyAlsoToAllAttributedDataPoints(aPropertyName, aValue); bChanged = true; } } @@ -145,7 +149,7 @@ bool useSourceFormatFromItemToPropertySet( bool bChanged = false; if (!xPropertySet.is()) return bChanged; - OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); + OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? CHART_UNONAME_NUMFMT : u"PercentageNumberFormat"_ustr; sal_uInt16 nFormatWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; if (rItemSet.GetItemState(nWhichId) != SfxItemState::SET) @@ -172,11 +176,11 @@ bool useSourceFormatFromItemToPropertySet( uno::Any aOldValue(xPropertySet->getPropertyValue(aPropertyName)); if (bOverwriteDataPoints) { - Reference<chart2::XDataSeries> xSeries(xPropertySet, uno::UNO_QUERY); + rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(xPropertySet.get())); if (aNewValue != aOldValue || - ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, aPropertyName, aOldValue)) + xSeries->hasAttributedDataPointDifferentValue(aPropertyName, aOldValue)) { - ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, aPropertyName, aNewValue); + xSeries->setPropertyAlsoToAllAttributedDataPoints(aPropertyName, aNewValue); bChanged = true; } } @@ -192,27 +196,28 @@ bool useSourceFormatFromItemToPropertySet( } // anonymous namespace TextLabelItemConverter::TextLabelItemConverter( - const uno::Reference<frame::XModel>& xChartModel, + const rtl::Reference<::chart::ChartModel>& xChartModel, const uno::Reference<beans::XPropertySet>& rPropertySet, - const uno::Reference<XDataSeries>& xSeries, - SfxItemPool& rItemPool, const awt::Size* pRefSize, + const rtl::Reference<DataSeries>& xSeries, + SfxItemPool& rItemPool, const std::optional<awt::Size>& pRefSize, bool bDataSeries, sal_Int32 nNumberFormat, sal_Int32 nPercentNumberFormat ) : ItemConverter(rPropertySet, rItemPool), mnNumberFormat(nNumberFormat), mnPercentNumberFormat(nPercentNumberFormat), mbDataSeries(bDataSeries), - mbForbidPercentValue(true) + mbForbidPercentValue(true), + m_xSeries(xSeries) { - maConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); + maConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, u"ReferencePageSize"_ustr)); - uno::Reference<XDiagram> xDiagram(ChartModelHelper::findDiagram(xChartModel)); - uno::Reference<XChartType> xChartType(DiagramHelper::getChartTypeOfSeries(xDiagram, xSeries)); + rtl::Reference< Diagram > xDiagram(xChartModel->getFirstChartDiagram()); + rtl::Reference< ChartType > xChartType(xDiagram->getChartTypeOfSeries(xSeries)); bool bFound = false; bool bAmbiguous = false; - bool bSwapXAndY = DiagramHelper::getVertical(xDiagram, bFound, bAmbiguous); + bool bSwapXAndY = xDiagram->getVertical(bFound, bAmbiguous); maAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements(xChartType, bSwapXAndY, xSeries); - mbForbidPercentValue = ChartTypeHelper::getAxisType(xChartType, 0) != AxisType::CATEGORY; + mbForbidPercentValue = xChartType.is() ? xChartType->getAxisType(0) != AxisType::CATEGORY : false; } TextLabelItemConverter::~TextLabelItemConverter() @@ -239,7 +244,7 @@ bool TextLabelItemConverter::ApplyItemSet( const SfxItemSet& rItemSet ) return ItemConverter::ApplyItemSet(rItemSet) || bResult; } -const sal_uInt16* TextLabelItemConverter::GetWhichPairs() const +const WhichRangesContainer& TextLabelItemConverter::GetWhichPairs() const { // must span all used items! return nTextLabelWhichPairs; @@ -266,6 +271,7 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte case SCHATTR_DATADESCR_SHOW_NUMBER: case SCHATTR_DATADESCR_SHOW_PERCENTAGE: case SCHATTR_DATADESCR_SHOW_CATEGORY: + case SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME: case SCHATTR_DATADESCR_SHOW_SYMBOL: { const SfxBoolItem& rItem = static_cast<const SfxBoolItem&>(rItemSet.Get(nWhichId)); @@ -276,16 +282,18 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte { sal_Bool& rValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : ( (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : ( - (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol)); + (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : + (nWhichId == SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME) ? aLabel.ShowSeriesName : aLabel.ShowLegendSymbol)); bool bOldValue = rValue; rValue = rItem.GetValue(); if (mbDataSeries) { - Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY); + rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get())); if (bOldValue != bool(rValue) || - DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, CHART_UNONAME_LABEL, aOldValue)) + xSeries->hasAttributedDataPointDifferentValue(CHART_UNONAME_LABEL, aOldValue)) { - DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel)); + xSeries->setPropertyAlsoToAllAttributedDataPoints(CHART_UNONAME_LABEL, uno::Any(aLabel)); + xSeries->setPropertyAlsoToAllAttributedDataPoints(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any()); bChanged = true; } } @@ -312,23 +320,23 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte case SCHATTR_DATADESCR_SEPARATOR: { OUString aNewValue = static_cast<const SfxStringItem&>(rItemSet.Get(nWhichId)).GetValue(); - OUString aOldValue; try { - GetPropertySet()->getPropertyValue("LabelSeparator") >>= aOldValue; + OUString aOldValue; + GetPropertySet()->getPropertyValue(u"LabelSeparator"_ustr) >>= aOldValue; if (mbDataSeries) { - Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY); + rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get())); if (aOldValue != aNewValue || - DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, "LabelSeparator", uno::Any(aOldValue))) + xSeries->hasAttributedDataPointDifferentValue(u"LabelSeparator"_ustr, uno::Any(aOldValue))) { - DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, "LabelSeparator", uno::Any(aNewValue)); + xSeries->setPropertyAlsoToAllAttributedDataPoints(u"LabelSeparator"_ustr, uno::Any(aNewValue)); bChanged = true; } } else if (aOldValue != aNewValue) { - GetPropertySet()->setPropertyValue("LabelSeparator", uno::Any(aNewValue)); + GetPropertySet()->setPropertyValue(u"LabelSeparator"_ustr, uno::Any(aNewValue)); bChanged = true; } } @@ -345,20 +353,20 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte { bool bNew = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue(); bool bOld = false; - GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bOld; + GetPropertySet()->getPropertyValue( u"TextWordWrap"_ustr ) >>= bOld; if( mbDataSeries ) { - Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY); + rtl::Reference< DataSeries > xSeries( dynamic_cast<DataSeries*>(GetPropertySet().get()) ); if( bOld!=bNew || - DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "TextWordWrap", uno::Any( bOld ) ) ) + xSeries->hasAttributedDataPointDifferentValue( u"TextWordWrap"_ustr, uno::Any( bOld ) ) ) { - DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "TextWordWrap", uno::Any( bNew ) ); + xSeries->setPropertyAlsoToAllAttributedDataPoints( u"TextWordWrap"_ustr, uno::Any( bNew ) ); bChanged = true; } } else if( bOld!=bNew ) { - GetPropertySet()->setPropertyValue( "TextWordWrap", uno::Any( bNew )); + GetPropertySet()->setPropertyValue( u"TextWordWrap"_ustr, uno::Any( bNew )); bChanged = true; } } @@ -375,21 +383,22 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte sal_Int32 nNew = static_cast<const SfxInt32Item&>(rItemSet.Get(nWhichId)).GetValue(); sal_Int32 nOld = -1; RelativePosition aCustomLabelPosition; - GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld; + GetPropertySet()->getPropertyValue(u"LabelPlacement"_ustr) >>= nOld; if (mbDataSeries) { - Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY); + rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get())); if (nOld != nNew || - DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, "LabelPlacement", uno::Any(nOld))) + xSeries->hasAttributedDataPointDifferentValue(u"LabelPlacement"_ustr, uno::Any(nOld))) { - DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, "LabelPlacement", uno::Any(nNew)); + xSeries->setPropertyAlsoToAllAttributedDataPoints(u"LabelPlacement"_ustr, uno::Any(nNew)); bChanged = true; } } - else if (nOld != nNew || (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition)) + else if (nOld != nNew || (GetPropertySet()->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition)) { - GetPropertySet()->setPropertyValue("LabelPlacement", uno::Any(nNew)); - GetPropertySet()->setPropertyValue("CustomLabelPosition", uno::Any()); + GetPropertySet()->setPropertyValue(u"LabelPlacement"_ustr, uno::Any(nNew)); + GetPropertySet()->setPropertyValue(u"CustomLabelPosition"_ustr, uno::Any()); + GetPropertySet()->setPropertyValue(u"CustomLabelSize"_ustr, uno::Any()); bChanged = true; } } @@ -406,7 +415,7 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte rItemSet.Get(nWhichId)).GetValue(); chart2::Symbol aSymbol; - GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol; + GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol; sal_Int32 nOldStyle = getSymbolStyleForSymbol(aSymbol); if (nStyle != nOldStyle) @@ -433,9 +442,9 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte } if (bDeleteSymbol) - GetPropertySet()->setPropertyValue("Symbol", uno::Any()); + GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any()); else - GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol)); + GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol)); bChanged = true; } } @@ -446,14 +455,14 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte rItemSet.Get(nWhichId)).GetSize(); chart2::Symbol aSymbol; - GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol; + GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol; if (aSize.getWidth() != aSymbol.Size.Width || aSize.getHeight() != aSymbol.Size.Height) { aSymbol.Size.Width = aSize.getWidth(); aSymbol.Size.Height = aSize.getHeight(); - GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol)); + GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol)); bChanged = true; } } @@ -471,11 +480,11 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte { aXGraphicAny <<= xGraphic; chart2::Symbol aSymbol; - GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol; + GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol; if (aSymbol.Graphic != xGraphic) { - aSymbol.Graphic = xGraphic; - GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol)); + aSymbol.Graphic = std::move(xGraphic); + GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol)); bChanged = true; } } @@ -485,19 +494,37 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte case SCHATTR_TEXT_DEGREES: { double fValue = static_cast<double>( - static_cast<const SfxInt32Item&>( - rItemSet.Get(nWhichId)).GetValue()) / 100.0; + static_cast<const SdrAngleItem&>( + rItemSet.Get(nWhichId)).GetValue().get()) / 100.0; double fOldValue = 0.0; bool bPropExisted = - (GetPropertySet()->getPropertyValue("TextRotation") >>= fOldValue); + (GetPropertySet()->getPropertyValue(u"TextRotation"_ustr) >>= fOldValue); if (!bPropExisted || fOldValue != fValue) { - GetPropertySet()->setPropertyValue("TextRotation", uno::Any(fValue)); + GetPropertySet()->setPropertyValue(u"TextRotation"_ustr, uno::Any(fValue)); bChanged = true; } } break; + case SCHATTR_DATADESCR_CUSTOM_LEADER_LINES: + { + try + { + bool bNew = static_cast<const SfxBoolItem&>(rItemSet.Get(nWhichId)).GetValue(); + bool bOld = true; + if( (m_xSeries->getFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES) >>= bOld) && bOld != bNew ) + { + m_xSeries->setFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, uno::Any(bNew)); + bChanged = true; + } + } + catch (const uno::Exception&) + { + TOOLS_WARN_EXCEPTION("chart2", ""); + } + } + break; } return bChanged; @@ -510,6 +537,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r case SCHATTR_DATADESCR_SHOW_NUMBER: case SCHATTR_DATADESCR_SHOW_PERCENTAGE: case SCHATTR_DATADESCR_SHOW_CATEGORY: + case SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME: case SCHATTR_DATADESCR_SHOW_SYMBOL: { chart2::DataPointLabel aLabel; @@ -517,17 +545,18 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r { bool bValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : ( (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : ( - (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol)); + (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : ( + (nWhichId == SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME) ? aLabel.ShowSeriesName : aLabel.ShowLegendSymbol))); rOutItemSet.Put(SfxBoolItem(nWhichId, bValue)); - if (mbDataSeries) + DataSeries* pDataSeries = mbDataSeries + ? dynamic_cast<DataSeries*>(GetPropertySet().get()) + : nullptr; + if (pDataSeries && pDataSeries->hasAttributedDataPointDifferentValue( + CHART_UNONAME_LABEL, uno::Any(aLabel))) { - if (DataSeriesHelper::hasAttributedDataPointDifferentValue( - Reference<chart2::XDataSeries>(GetPropertySet(), uno::UNO_QUERY), CHART_UNONAME_LABEL, uno::Any(aLabel))) - { - rOutItemSet.InvalidateItem(nWhichId); - } + rOutItemSet.InvalidateItem(nWhichId); } } } @@ -543,7 +572,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r case SCHATTR_PERCENT_NUMBERFORMAT_VALUE: { sal_Int32 nKey = 0; - if (!(GetPropertySet()->getPropertyValue("PercentageNumberFormat") >>= nKey)) + if (!(GetPropertySet()->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nKey)) nKey = mnPercentNumberFormat; rOutItemSet.Put(SfxUInt32Item(nWhichId, nKey)); } @@ -574,16 +603,16 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r { TOOLS_WARN_EXCEPTION("chart2", ""); } - bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue("PercentageNumberFormat").hasValue() && !bUseSourceFormat; + bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(u"PercentageNumberFormat"_ustr).hasValue() && !bUseSourceFormat; rOutItemSet.Put(SfxBoolItem(nWhichId, !bNumberFormatIsSet)); } break; case SCHATTR_DATADESCR_SEPARATOR: { - OUString aValue; try { - GetPropertySet()->getPropertyValue("LabelSeparator") >>= aValue; + OUString aValue; + GetPropertySet()->getPropertyValue(u"LabelSeparator"_ustr) >>= aValue; rOutItemSet.Put(SfxStringItem(nWhichId, aValue)); } catch (const uno::Exception&) @@ -597,7 +626,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r try { bool bValue = false; - GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bValue; + GetPropertySet()->getPropertyValue( u"TextWordWrap"_ustr ) >>= bValue; rOutItemSet.Put( SfxBoolItem( nWhichId, bValue )); } catch( const uno::Exception& ) @@ -612,9 +641,9 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r { sal_Int32 nPlacement = 0; RelativePosition aCustomLabelPosition; - if (!mbDataSeries && (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition)) + if (!mbDataSeries && (GetPropertySet()->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition)) rOutItemSet.Put(SfxInt32Item(nWhichId, css::chart::DataLabelPlacement::CUSTOM)); - else if (GetPropertySet()->getPropertyValue("LabelPlacement") >>= nPlacement) + else if (GetPropertySet()->getPropertyValue(u"LabelPlacement"_ustr) >>= nPlacement) rOutItemSet.Put(SfxInt32Item(nWhichId, nPlacement)); else if (maAvailableLabelPlacements.hasElements()) rOutItemSet.Put(SfxInt32Item(nWhichId, maAvailableLabelPlacements[0])); @@ -635,17 +664,31 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r rOutItemSet.Put(SfxBoolItem(nWhichId, mbForbidPercentValue)); } break; + case SCHATTR_DATADESCR_CUSTOM_LEADER_LINES: + { + try + { + bool bValue = true; + if( m_xSeries->getFastPropertyValue( PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES ) >>= bValue ) + rOutItemSet.Put(SfxBoolItem(nWhichId, bValue)); + } + catch (const uno::Exception&) + { + TOOLS_WARN_EXCEPTION("chart2", ""); + } + } + break; case SCHATTR_STYLE_SYMBOL: { chart2::Symbol aSymbol; - if (GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol) + if (GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol) rOutItemSet.Put(SfxInt32Item(nWhichId, getSymbolStyleForSymbol(aSymbol))); } break; case SCHATTR_SYMBOL_SIZE: { chart2::Symbol aSymbol; - if (GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol) + if (GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol) rOutItemSet.Put( SvxSizeItem(nWhichId, Size(aSymbol.Size.Width, aSymbol.Size.Height))); } @@ -653,7 +696,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r case SCHATTR_SYMBOL_BRUSH: { chart2::Symbol aSymbol; - if ((GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol) + if ((GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol) && aSymbol.Graphic.is()) { rOutItemSet.Put( @@ -665,10 +708,10 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r { double fValue = 0; - if (GetPropertySet()->getPropertyValue("TextRotation") >>= fValue) + if (GetPropertySet()->getPropertyValue(u"TextRotation"_ustr) >>= fValue) { rOutItemSet.Put( - SfxInt32Item(nWhichId, static_cast<sal_Int32>(rtl::math::round(fValue * 100.0)))); + SdrAngleItem(SCHATTR_TEXT_DEGREES, Degree100(static_cast<sal_Int32>(rtl::math::round(fValue * 100.0))))); } } break; |