summaryrefslogtreecommitdiff
path: root/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-06-30 13:21:18 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-07-03 21:46:45 +0200
commit1c5c226698e94a17ea5216a1f78a48dd82f614e1 (patch)
tree2c6df273fd82ea8e5471de764ac0475a9f4a4ba5 /chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
parent1cd3e2038010cb37bda82d38dd058b793b7eec26 (diff)
Insert new trendline instead of changing the existing one.
Change-Id: Ic7cbfa55c7b2e42eb21400b2fca34724a72de701
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx')
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx30
1 files changed, 16 insertions, 14 deletions
diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
index 9c4f1bfc5416..6e9e8b1bf5cb 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
@@ -76,8 +76,8 @@ namespace wrapper
{
RegressionCurveItemConverter::RegressionCurveItemConverter(
- const uno::Reference< beans::XPropertySet > & rPropertySet,
- const uno::Reference< chart2::XRegressionCurveContainer > & xRegCurveCnt,
+ const uno::Reference< beans::XPropertySet >& rPropertySet,
+ const uno::Reference< chart2::XRegressionCurveContainer >& xContainer,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory ) :
@@ -86,7 +86,7 @@ RegressionCurveItemConverter::RegressionCurveItemConverter(
rPropertySet, rItemPool, rDrawModel,
xNamedPropertyContainerFactory,
GraphicPropertyItemConverter::LINE_PROPERTIES )),
- m_xCurveContainer( xRegCurveCnt )
+ m_xCurveContainer( xContainer )
{}
RegressionCurveItemConverter::~RegressionCurveItemConverter()
@@ -146,11 +146,13 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
// for which this converter was created. Not optimal, but
// currently the only way to handle the type in the
// regression curve properties dialog
- RegressionCurveHelper::changeRegressionCurveType(
- lcl_convertRegressionType( eNewRegress ),
- m_xCurveContainer,
- xCurve,
- uno::Reference< uno::XComponentContext >());
+ xCurve = RegressionCurveHelper::changeRegressionCurveType(
+ lcl_convertRegressionType( eNewRegress ),
+ m_xCurveContainer,
+ xCurve,
+ uno::Reference< uno::XComponentContext >());
+ uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
+ resetPropertySet( xProperties );
bChanged = true;
}
}
@@ -167,9 +169,9 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
OSL_ASSERT( xProperties.is());
- sal_Int32 aOldDegree = 1;
if( xProperties.is() )
{
+ sal_Int32 aOldDegree = 2;
xProperties->getPropertyValue( "PolynomialDegree" ) >>= aOldDegree;
if (aOldDegree != aDegree)
{
@@ -191,9 +193,9 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
OSL_ASSERT( xProperties.is());
- sal_Int32 aOldPeriod = 2;
if( xProperties.is() )
{
+ sal_Int32 aOldPeriod = 2;
xProperties->getPropertyValue( "MovingAveragePeriod" ) >>= aOldPeriod;
if (aOldPeriod != aPeriod)
{
@@ -215,9 +217,9 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
OSL_ASSERT( xProperties.is());
- double aOldValue = 0.0;
if( xProperties.is() )
{
+ double aOldValue = 0.0;
xProperties->getPropertyValue( "ExtrapolateForward" ) >>= aOldValue;
if (aOldValue != aValue)
{
@@ -239,9 +241,9 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
OSL_ASSERT( xProperties.is());
- double aOldValue = 0.0;
if( xProperties.is() )
{
+ double aOldValue = 0.0;
xProperties->getPropertyValue( "ExtrapolateBackward" ) >>= aOldValue;
if (aOldValue != aValue)
{
@@ -263,9 +265,9 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
OSL_ASSERT( xProperties.is());
- sal_Bool bOldValue = false;
if( xProperties.is() )
{
+ sal_Bool bOldValue = false;
xProperties->getPropertyValue( "ForceIntercept" ) >>= bOldValue;
if (bOldValue != bNewValue)
{
@@ -287,9 +289,9 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
OSL_ASSERT( xProperties.is());
- double aOldValue = 0.0;
if( xProperties.is() )
{
+ double aOldValue = 0.0;
xProperties->getPropertyValue( "InterceptValue" ) >>= aOldValue;
if (aOldValue != aValue)
{