summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/model')
-rw-r--r--chart2/source/model/filter/XMLFilter.cxx5
-rw-r--r--chart2/source/model/inc/XMLFilter.hxx3
-rw-r--r--chart2/source/model/main/Axis.cxx15
-rw-r--r--chart2/source/model/main/DataPointProperties.cxx11
-rw-r--r--chart2/source/model/main/DataPointProperties.hxx1
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx10
6 files changed, 32 insertions, 13 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index bc5f4940a33c..a5984edea742 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -541,6 +541,7 @@ sal_Int32 XMLFilter::impl_Export(
const Reference< lang::XComponent > & xDocumentComp,
const Sequence< beans::PropertyValue > & rMediaDescriptor )
{
+ m_aMediaDescriptor = rMediaDescriptor;
//save
sal_Int32 nWarning = 0;
@@ -744,9 +745,7 @@ sal_Int32 XMLFilter::impl_ExportStream(
if ( !xFilter.is() )
return ERRCODE_SFX_GENERAL;
- uno::Sequence < beans::PropertyValue > aMediaDesc(0);
- //@todo? filter properties? ... url? ...
- xFilter->filter( aMediaDesc );
+ xFilter->filter(m_aMediaDescriptor);
}
catch (const uno::Exception& rEx)
{
diff --git a/chart2/source/model/inc/XMLFilter.hxx b/chart2/source/model/inc/XMLFilter.hxx
index ad316d0c92b6..4c2c8a1fcefd 100644
--- a/chart2/source/model/inc/XMLFilter.hxx
+++ b/chart2/source/model/inc/XMLFilter.hxx
@@ -151,6 +151,9 @@ private:
::com::sun::star::lang::XComponent > m_xTargetDoc;
::com::sun::star::uno::Reference<
::com::sun::star::lang::XComponent > m_xSourceDoc;
+
+ css::uno::Sequence<css::beans::PropertyValue> m_aMediaDescriptor;
+
OUString m_sDocumentHandler; // when set it will be set as doc handler
volatile bool m_bCancelOperation;
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 90e7660b858f..a345bd93f63b 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -67,7 +67,8 @@ enum
PROP_AXIS_CROSSOVER_POSITION,
PROP_AXIS_CROSSOVER_VALUE,
PROP_AXIS_DISPLAY_LABELS,
- PROP_AXIS_NUMBER_FORMAT,
+ PROP_AXIS_NUMBERFORMAT,
+ PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
PROP_AXIS_LABEL_POSITION,
PROP_AXIS_TEXT_ROTATION,
PROP_AXIS_TEXT_BREAK,
@@ -115,10 +116,17 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( CHART_UNONAME_NUMFMT,
- PROP_AXIS_NUMBER_FORMAT,
+ PROP_AXIS_NUMBERFORMAT,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEVOID ));
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
+ PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
Property( "LabelPosition",
@@ -220,6 +228,7 @@ private:
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false );
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 2ebfa95fadbe..e145d4242cdf 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -282,7 +282,14 @@ void DataPointProperties::AddPropertiesToVector(
PROP_DATAPOINT_NUMBER_FORMAT,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEVOID ));
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
+ PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
//additional 'PercentageNumberFormat'
rOutProperties.push_back(
@@ -410,6 +417,8 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, 0 );
PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 );
+
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE, true);
}
} // namespace chart
diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx
index 596adf88451b..2d7258aca510 100644
--- a/chart2/source/model/main/DataPointProperties.hxx
+++ b/chart2/source/model/main/DataPointProperties.hxx
@@ -62,6 +62,7 @@ public:
PROP_DATAPOINT_LABEL,
PROP_DATAPOINT_LABEL_SEPARATOR,
PROP_DATAPOINT_NUMBER_FORMAT,
+ PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
PROP_DATAPOINT_PERCENTAGE_NUMBER_FORMAT,
PROP_DATAPOINT_LABEL_PLACEMENT,
PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE,
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index b17952600940..7c72e48860c7 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -458,9 +458,8 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram
if( xAxisProp.is())
{
// set number format to source format
- uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
- if( aValue.hasValue())
- xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
+ xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(true));
+ xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
}
}
}
@@ -758,9 +757,8 @@ void ChartTypeTemplate::adaptAxes(
if( xAxisProp.is())
{
// set number format to source format
- uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
- if( aValue.hasValue())
- xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
+ xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(true));
+ xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
}
}
}