rtl::Static-> thread-safe-static in chart2
Change-Id: I5bd595d5251cd92904750d6e6830f1d95f41b177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
4e8f36fcd4
commit
1131b090ed
@@ -55,58 +55,19 @@ void lcl_AddPropertiesToVector(
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT );
|
||||
}
|
||||
|
||||
struct StaticAreaChartTypeTemplateDefaults_Initializer
|
||||
::cppu::OPropertyArrayHelper& StaticAreaChartTypeTemplateInfoHelper()
|
||||
{
|
||||
::chart::tPropertyValueMap* operator()()
|
||||
{
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aStaticDefaults, PROP_AREA_TEMPLATE_DIMENSION, 2 );
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
};
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper = []()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
struct StaticAreaChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAreaChartTypeTemplateDefaults_Initializer >
|
||||
{
|
||||
};
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
struct StaticAreaChartTypeTemplateInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
|
||||
return &aPropHelper;
|
||||
}
|
||||
|
||||
private:
|
||||
static uno::Sequence< Property > lcl_GetPropertySequence()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct StaticAreaChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAreaChartTypeTemplateInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticAreaChartTypeTemplateInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAreaChartTypeTemplateInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticAreaChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAreaChartTypeTemplateInfo_Initializer >
|
||||
{
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}();
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -132,9 +93,14 @@ AreaChartTypeTemplate::~AreaChartTypeTemplate()
|
||||
// ____ OPropertySet ____
|
||||
void AreaChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
{
|
||||
const tPropertyValueMap& rStaticDefaults = *StaticAreaChartTypeTemplateDefaults::get();
|
||||
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
|
||||
if( aFound == rStaticDefaults.end() )
|
||||
static ::chart::tPropertyValueMap aStaticDefaults = []()
|
||||
{
|
||||
::chart::tPropertyValueMap aTmp;
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_AREA_TEMPLATE_DIMENSION, 2 );
|
||||
return aTmp;
|
||||
}();
|
||||
tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
|
||||
if( aFound == aStaticDefaults.end() )
|
||||
rAny.clear();
|
||||
else
|
||||
rAny = (*aFound).second;
|
||||
@@ -142,13 +108,15 @@ void AreaChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
|
||||
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL AreaChartTypeTemplate::getInfoHelper()
|
||||
{
|
||||
return *StaticAreaChartTypeTemplateInfoHelper::get();
|
||||
return StaticAreaChartTypeTemplateInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartTypeTemplate::getPropertySetInfo()
|
||||
{
|
||||
return *StaticAreaChartTypeTemplateInfo::get();
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(StaticAreaChartTypeTemplateInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
sal_Int32 AreaChartTypeTemplate::getDimension() const
|
||||
|
||||
@@ -62,64 +62,19 @@ void lcl_AddPropertiesToVector(
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT );
|
||||
}
|
||||
|
||||
struct StaticBarChartTypeTemplateDefaults_Initializer
|
||||
::cppu::OPropertyArrayHelper& StaticBarChartTypeTemplateInfoHelper()
|
||||
{
|
||||
::chart::tPropertyValueMap* operator()()
|
||||
{
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
lcl_AddDefaultsToMap( aStaticDefaults );
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
private:
|
||||
static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
|
||||
{
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_BAR_TEMPLATE_DIMENSION, 2 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
|
||||
}
|
||||
};
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper = []()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
struct StaticBarChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBarChartTypeTemplateDefaults_Initializer >
|
||||
{
|
||||
};
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
struct StaticBarChartTypeTemplateInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
|
||||
return &aPropHelper;
|
||||
}
|
||||
|
||||
private:
|
||||
static Sequence< Property > lcl_GetPropertySequence()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct StaticBarChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBarChartTypeTemplateInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticBarChartTypeTemplateInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBarChartTypeTemplateInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticBarChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBarChartTypeTemplateInfo_Initializer >
|
||||
{
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}();
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -212,9 +167,15 @@ rtl::Reference< ChartType > BarChartTypeTemplate::getChartTypeForNewSeries2(
|
||||
// ____ OPropertySet ____
|
||||
void BarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
{
|
||||
const tPropertyValueMap& rStaticDefaults = *StaticBarChartTypeTemplateDefaults::get();
|
||||
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
|
||||
if( aFound == rStaticDefaults.end() )
|
||||
static ::chart::tPropertyValueMap aStaticDefaults = []()
|
||||
{
|
||||
::chart::tPropertyValueMap aTmp;
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_BAR_TEMPLATE_DIMENSION, 2 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
|
||||
return aTmp;
|
||||
}();
|
||||
tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
|
||||
if( aFound == aStaticDefaults.end() )
|
||||
rAny.clear();
|
||||
else
|
||||
rAny = (*aFound).second;
|
||||
@@ -222,13 +183,15 @@ void BarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
|
||||
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL BarChartTypeTemplate::getInfoHelper()
|
||||
{
|
||||
return *StaticBarChartTypeTemplateInfoHelper::get();
|
||||
return StaticBarChartTypeTemplateInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
Reference< beans::XPropertySetInfo > SAL_CALL BarChartTypeTemplate::getPropertySetInfo()
|
||||
{
|
||||
return *StaticBarChartTypeTemplateInfo::get();
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(StaticBarChartTypeTemplateInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
void BarChartTypeTemplate::applyStyle2(
|
||||
|
||||
@@ -36,55 +36,16 @@ using ::com::sun::star::uno::Reference;
|
||||
namespace
|
||||
{
|
||||
|
||||
struct StaticBubbleChartTypeDefaults_Initializer
|
||||
{
|
||||
::chart::tPropertyValueMap* operator()()
|
||||
{
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeDefaults_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
|
||||
return &aPropHelper;
|
||||
}
|
||||
|
||||
private:
|
||||
static Sequence< Property > lcl_GetPropertySequence()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBubbleChartTypeInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBubbleChartTypeInfo_Initializer >
|
||||
::cppu::OPropertyArrayHelper& StaticBubbleChartTypeInfoHelper()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper = []()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}();
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -169,9 +130,9 @@ OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
|
||||
// ____ OPropertySet ____
|
||||
void BubbleChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
{
|
||||
const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeDefaults::get();
|
||||
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
|
||||
if( aFound == rStaticDefaults.end() )
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
|
||||
if( aFound == aStaticDefaults.end() )
|
||||
rAny.clear();
|
||||
else
|
||||
rAny = (*aFound).second;
|
||||
@@ -180,13 +141,15 @@ void BubbleChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
// ____ OPropertySet ____
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper()
|
||||
{
|
||||
return *StaticBubbleChartTypeInfoHelper::get();
|
||||
return StaticBubbleChartTypeInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartType::getPropertySetInfo()
|
||||
{
|
||||
return *StaticBubbleChartTypeInfo::get();
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(StaticBubbleChartTypeInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
OUString SAL_CALL BubbleChartType::getImplementationName()
|
||||
|
||||
@@ -38,56 +38,16 @@ using ::com::sun::star::beans::Property;
|
||||
namespace
|
||||
{
|
||||
|
||||
struct StaticBubbleChartTypeTemplateDefaults_Initializer
|
||||
{
|
||||
::chart::tPropertyValueMap* operator()()
|
||||
{
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeTemplateDefaults_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeTemplateInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
|
||||
return &aPropHelper;
|
||||
}
|
||||
|
||||
private:
|
||||
static Sequence< Property > lcl_GetPropertySequence()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeTemplateInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeTemplateInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBubbleChartTypeTemplateInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticBubbleChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBubbleChartTypeTemplateInfo_Initializer >
|
||||
::cppu::OPropertyArrayHelper & StaticBubbleChartTypeTemplateInfoHelper()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper = []()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}();
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -109,9 +69,9 @@ BubbleChartTypeTemplate::~BubbleChartTypeTemplate()
|
||||
// ____ OPropertySet ____
|
||||
void BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
{
|
||||
const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeTemplateDefaults::get();
|
||||
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
|
||||
if( aFound == rStaticDefaults.end() )
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
|
||||
if( aFound == aStaticDefaults.end() )
|
||||
rAny.clear();
|
||||
else
|
||||
rAny = (*aFound).second;
|
||||
@@ -119,13 +79,15 @@ void BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny
|
||||
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper()
|
||||
{
|
||||
return *StaticBubbleChartTypeTemplateInfoHelper::get();
|
||||
return StaticBubbleChartTypeTemplateInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartTypeTemplate::getPropertySetInfo()
|
||||
{
|
||||
return *StaticBubbleChartTypeTemplateInfo::get();
|
||||
static const uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(StaticBubbleChartTypeTemplateInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
sal_Int32 BubbleChartTypeTemplate::getDimension() const
|
||||
|
||||
@@ -79,66 +79,17 @@ void lcl_AddPropertiesToVector(
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT );
|
||||
}
|
||||
|
||||
struct StaticCandleStickChartTypeDefaults_Initializer
|
||||
{
|
||||
::chart::tPropertyValueMap* operator()()
|
||||
{
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
lcl_AddDefaultsToMap( aStaticDefaults );
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
private:
|
||||
static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
|
||||
{
|
||||
// must match default in CTOR!
|
||||
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_JAPANESE, false );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_FIRST, false );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_HIGH_LOW, true );
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticCandleStickChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticCandleStickChartTypeDefaults_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticCandleStickChartTypeInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
|
||||
return &aPropHelper;
|
||||
}
|
||||
|
||||
private:
|
||||
static Sequence< Property > lcl_GetPropertySequence()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct StaticCandleStickChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticCandleStickChartTypeInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticCandleStickChartTypeInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticCandleStickChartTypeInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticCandleStickChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticCandleStickChartTypeInfo_Initializer >
|
||||
::cppu::OPropertyArrayHelper& StaticCandleStickChartTypeInfoHelper()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper = []()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}();
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -270,9 +221,17 @@ OUString SAL_CALL CandleStickChartType::getRoleOfSequenceForSeriesLabel()
|
||||
// ____ OPropertySet ____
|
||||
void CandleStickChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
{
|
||||
const tPropertyValueMap& rStaticDefaults = *StaticCandleStickChartTypeDefaults::get();
|
||||
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
|
||||
if( aFound == rStaticDefaults.end() )
|
||||
static const ::chart::tPropertyValueMap aStaticDefaults = []()
|
||||
{
|
||||
// must match default in CTOR!
|
||||
::chart::tPropertyValueMap aTmp;
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_CANDLESTICKCHARTTYPE_JAPANESE, false );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_CANDLESTICKCHARTTYPE_SHOW_FIRST, false );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_CANDLESTICKCHARTTYPE_SHOW_HIGH_LOW, true );
|
||||
return aTmp;
|
||||
}();
|
||||
tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
|
||||
if( aFound == aStaticDefaults.end() )
|
||||
rAny.clear();
|
||||
else
|
||||
rAny = (*aFound).second;
|
||||
@@ -281,13 +240,15 @@ void CandleStickChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
|
||||
// ____ OPropertySet ____
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL CandleStickChartType::getInfoHelper()
|
||||
{
|
||||
return *StaticCandleStickChartTypeInfoHelper::get();
|
||||
return StaticCandleStickChartTypeInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
Reference< beans::XPropertySetInfo > SAL_CALL CandleStickChartType::getPropertySetInfo()
|
||||
{
|
||||
return *StaticCandleStickChartTypeInfo::get();
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(StaticCandleStickChartTypeInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
void SAL_CALL CandleStickChartType::setFastPropertyValue_NoBroadcast(
|
||||
|
||||
@@ -227,31 +227,10 @@ void ChartType::GetDefaultValue( sal_Int32 /* nHandle */, uno::Any& rAny ) const
|
||||
namespace
|
||||
{
|
||||
|
||||
struct StaticChartTypeInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( Sequence< beans::Property >{} );
|
||||
return &aPropHelper;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticChartTypeInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticChartTypeInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticChartTypeInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticChartTypeInfo_Initializer >
|
||||
::cppu::OPropertyArrayHelper& StaticChartTypeInfoHelper()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( Sequence< beans::Property >{} );
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -259,13 +238,15 @@ struct StaticChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans:
|
||||
// ____ OPropertySet ____
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper()
|
||||
{
|
||||
return *StaticChartTypeInfoHelper::get();
|
||||
return StaticChartTypeInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
uno::Reference< beans::XPropertySetInfo > SAL_CALL ChartType::getPropertySetInfo()
|
||||
{
|
||||
return *StaticChartTypeInfo::get();
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo( StaticChartTypeInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
// ____ XModifyBroadcaster ____
|
||||
|
||||
@@ -54,67 +54,19 @@ void lcl_AddPropertiesToVector(
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT );
|
||||
}
|
||||
|
||||
struct StaticColumnChartTypeDefaults_Initializer
|
||||
::cppu::OPropertyArrayHelper & StaticColumnChartTypeInfoHelper()
|
||||
{
|
||||
::chart::tPropertyValueMap* operator()()
|
||||
{
|
||||
static ::chart::tPropertyValueMap aStaticDefaults;
|
||||
lcl_AddDefaultsToMap( aStaticDefaults );
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
private:
|
||||
static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
|
||||
{
|
||||
Sequence< sal_Int32 > aSeq{ 0, 0 };
|
||||
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper = []()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
aSeq = { 100, 100 };
|
||||
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
|
||||
}
|
||||
};
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
struct StaticColumnChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnChartTypeDefaults_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticColumnChartTypeInfoHelper_Initializer
|
||||
{
|
||||
::cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
|
||||
return &aPropHelper;
|
||||
}
|
||||
|
||||
private:
|
||||
static Sequence< Property > lcl_GetPropertySequence()
|
||||
{
|
||||
std::vector< css::beans::Property > aProperties;
|
||||
lcl_AddPropertiesToVector( aProperties );
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct StaticColumnChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticColumnChartTypeInfoHelper_Initializer >
|
||||
{
|
||||
};
|
||||
|
||||
struct StaticColumnChartTypeInfo_Initializer
|
||||
{
|
||||
uno::Reference< beans::XPropertySetInfo >* operator()()
|
||||
{
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(*StaticColumnChartTypeInfoHelper::get() ) );
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct StaticColumnChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticColumnChartTypeInfo_Initializer >
|
||||
{
|
||||
return comphelper::containerToSequence( aProperties );
|
||||
}();
|
||||
return aPropHelper;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -158,9 +110,17 @@ uno::Sequence< OUString > ColumnChartType::getSupportedPropertyRoles()
|
||||
// ____ OPropertySet ____
|
||||
void ColumnChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
{
|
||||
const tPropertyValueMap& rStaticDefaults = *StaticColumnChartTypeDefaults::get();
|
||||
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
|
||||
if( aFound == rStaticDefaults.end() )
|
||||
static const ::chart::tPropertyValueMap aStaticDefaults = []()
|
||||
{
|
||||
::chart::tPropertyValueMap aTmp;
|
||||
Sequence< sal_Int32 > aSeq{ 0, 0 };
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
|
||||
aSeq = { 100, 100 };
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
|
||||
return aTmp;
|
||||
}();
|
||||
tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
|
||||
if( aFound == aStaticDefaults.end() )
|
||||
rAny.clear();
|
||||
else
|
||||
rAny = (*aFound).second;
|
||||
@@ -168,13 +128,15 @@ void ColumnChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
|
||||
|
||||
::cppu::IPropertyArrayHelper & SAL_CALL ColumnChartType::getInfoHelper()
|
||||
{
|
||||
return *StaticColumnChartTypeInfoHelper::get();
|
||||
return StaticColumnChartTypeInfoHelper();
|
||||
}
|
||||
|
||||
// ____ XPropertySet ____
|
||||
uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnChartType::getPropertySetInfo()
|
||||
{
|
||||
return *StaticColumnChartTypeInfo::get();
|
||||
static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
|
||||
::cppu::OPropertySetHelper::createPropertySetInfo(StaticColumnChartTypeInfoHelper() ) );
|
||||
return xPropertySetInfo;
|
||||
}
|
||||
|
||||
OUString SAL_CALL ColumnChartType::getImplementationName()
|
||||
|
||||
Reference in New Issue
Block a user