summaryrefslogtreecommitdiff
path: root/chart2/source/controller
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2003-12-10 15:51:53 +0000
committerBjörn Milcke <bm@openoffice.org>2003-12-10 15:51:53 +0000
commitd7c8b60bb0de91f69381f549979017753471b001 (patch)
treee2dede0ef62d651970c063bf0a0d76bfbb8fac4c /chart2/source/controller
parent9745b60069b47d3a5e78c38a5ae221af13b984f3 (diff)
statistics dialog implemented
Diffstat (limited to 'chart2/source/controller')
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx25
-rw-r--r--chart2/source/controller/inc/MultipleChartConverters.hxx17
-rw-r--r--chart2/source/controller/inc/dlg_ObjectProperties.hxx6
-rw-r--r--chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx31
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx34
5 files changed, 90 insertions, 23 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 331a2cb6605b..3bc870196920 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlg_ObjectProperties.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: iha $ $Date: 2003-11-13 15:17:51 $
+ * last change: $Author: bm $ $Date: 2003-12-10 16:51:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -145,6 +145,7 @@ ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const rtl::OUS
, m_bAffectsMultipleObjects(false)
, m_bHasGeometryProperties(false)
, m_bHasStatisticProperties(false)
+ , m_bHasRegressionProperties(false)
, m_bProvidesSecondaryYAxis(false)
, m_bHasAreaProperties(false)
, m_bHasLineProperties(false)
@@ -176,8 +177,9 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
if( OBJECTTYPE_DATA_SERIES==m_eObjectType
|| OBJECTTYPE_DATA_LABELS==m_eObjectType )
{
- m_bHasStatisticProperties = ChartTypeHelper::isSupportingStatisticProperties( xChartType );
- m_bProvidesSecondaryYAxis = ChartTypeHelper::isSupportingSecondaryYAxis( xChartType );
+ m_bHasStatisticProperties = ChartTypeHelper::isSupportingStatisticProperties( xChartType );
+ m_bHasRegressionProperties = ChartTypeHelper::isSupportingRegressionProperties( xChartType );
+ m_bProvidesSecondaryYAxis = ChartTypeHelper::isSupportingSecondaryYAxis( xChartType );
}
if( OBJECTTYPE_AXIS == m_eObjectType )
@@ -199,6 +201,10 @@ bool ObjectPropertiesDialogParameter::HasStatisticProperties() const
{
return m_bHasStatisticProperties;
}
+bool ObjectPropertiesDialogParameter::HasRegressionProperties() const
+{
+ return m_bHasRegressionProperties;
+}
bool ObjectPropertiesDialogParameter::ProvidesSecondaryYAxis() const
{
return m_bProvidesSecondaryYAxis;
@@ -480,6 +486,12 @@ SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
AddTabPage(RID_SVXPAGE_AREA, SvxAreaTabPage::Create, NULL);
AddTabPage(RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, NULL);
break;
+
+ case OBJECTTYPE_LEGEND_ENTRY:
+ case OBJECTTYPE_AXIS_UNITLABEL:
+ case OBJECTTYPE_UNKNOWN:
+ // nothing
+ break;
}
}
@@ -566,6 +578,11 @@ void SchAttribTabDlg::PageCreated(USHORT nId, SfxTabPage &rPage)
case RID_SVXPAGE_NUMBERFORMAT:
((SvxNumberFormatTabPage&)rPage).SetNumberFormatList(SvxNumberInfoItem(m_pViewElementListProvider->GetNumFormatter()));
break;
+
+ case TP_STAT:
+ static_cast< SchStatisticTabPage & >( rPage ).EnableRegression(
+ m_pParameter->HasRegressionProperties() );
+ break;
}
}
diff --git a/chart2/source/controller/inc/MultipleChartConverters.hxx b/chart2/source/controller/inc/MultipleChartConverters.hxx
index 81abae2cd0a0..a2ccf8dc3ef3 100644
--- a/chart2/source/controller/inc/MultipleChartConverters.hxx
+++ b/chart2/source/controller/inc/MultipleChartConverters.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MultipleChartConverters.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: bm $ $Date: 2003-11-25 13:07:25 $
+ * last change: $Author: bm $ $Date: 2003-12-10 16:51:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -122,6 +122,19 @@ protected:
virtual const USHORT * GetWhichPairs() const;
};
+class AllSeriesStatisticsConverter : public ::comphelper::MultipleItemConverter
+{
+public:
+ AllSeriesStatisticsConverter(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel > & xChartModel,
+ SfxItemPool& rItemPool );
+ virtual ~AllSeriesStatisticsConverter();
+
+protected:
+ virtual const USHORT * GetWhichPairs() const;
+};
+
} // namespace wrapper
} // namespace chart
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 9bcc574833e1..179aa3b208a3 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlg_ObjectProperties.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: iha $ $Date: 2003-11-13 15:17:07 $
+ * last change: $Author: bm $ $Date: 2003-12-10 16:51:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,6 +87,7 @@ public:
bool HasGeometryProperties() const;
bool HasStatisticProperties() const;
+ bool HasRegressionProperties() const;
bool ProvidesSecondaryYAxis() const;
bool HasAreaProperties() const;
bool HasLineProperties() const;
@@ -101,6 +102,7 @@ private:
bool m_bHasGeometryProperties;
bool m_bHasStatisticProperties;
+ bool m_bHasRegressionProperties;
bool m_bProvidesSecondaryYAxis;
bool m_bHasAreaProperties;
bool m_bHasLineProperties;
diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
index 68b919d67fd2..1198657314da 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MultipleChartConverters.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: bm $ $Date: 2003-11-25 13:07:42 $
+ * last change: $Author: bm $ $Date: 2003-12-10 16:51:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,6 +63,7 @@
#include "SchSfxItemIds.hxx"
#include "SchWhichPairs.hxx"
#include "AxisItemConverter.hxx"
+#include "StatisticsItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
#include "DataPointItemConverter.hxx"
#include "ChartModelHelper.hxx"
@@ -199,5 +200,31 @@ const USHORT * AllDataLabelItemConverter::GetWhichPairs() const
//-----------------------------------------------------------------------------
+AllSeriesStatisticsConverter::AllSeriesStatisticsConverter(
+ const uno::Reference< frame::XModel > & xChartModel,
+ SfxItemPool& rItemPool )
+ : MultipleItemConverter( rItemPool )
+{
+ ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
+ ::chart::ChartModelHelper::getDataSeries( xChartModel ));
+
+ ::std::vector< uno::Reference< chart2::XDataSeries > >::const_iterator aIt;
+ for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt )
+ {
+ uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
+ m_aConverters.push_back( new ::chart::wrapper::StatisticsItemConverter(
+ xObjectProperties, rItemPool ));
+ }
+}
+
+AllSeriesStatisticsConverter::~AllSeriesStatisticsConverter()
+{}
+
+const USHORT * AllSeriesStatisticsConverter::GetWhichPairs() const
+{
+ // must span all used items!
+ return nStatWhichPairs;
+}
+
} // namespace wrapper
} // namespace chart
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index e1a9b1df5f12..bd3af72c2642 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ChartController_Insert.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: bm $ $Date: 2003-11-04 12:37:19 $
+ * last change: $Author: bm $ $Date: 2003-12-10 16:51:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -513,33 +513,41 @@ void SAL_CALL ChartController::executeDispatch_InsertDataLabel()
void SAL_CALL ChartController::executeDispatch_InsertStatistic()
{
+ bool bChanged = false;
try
{
- bool bChanged = false;
-
- uno::Reference< beans::XPropertySet > xProp=NULL;
- //@todo use correct ItemConverter if available
-// wrapper::ChartTypeItemConverter aItemConverter( NULL, xProp, m_pDrawModelWrapper->GetItemPool() );
-// SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
- SfxItemSet aItemSet( m_pDrawModelWrapper->GetItemPool(), 1, 2 );
- //aItemConverter.FillItemSet( aItemSet );
+ wrapper::AllSeriesStatisticsConverter aItemConverter(
+ m_aModel->getModel(), m_pDrawModelWrapper->GetItemPool() );
+ SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
+ aItemConverter.FillItemSet( aItemSet );
//prepare and open dialog
Window* pParent( NULL );
SchDataStatisticsDlg aDlg( pParent, aItemSet);
+// aDlg.EnableRegression( ChartTypeHelper::isSupportingRegressionProperties( xChartType ));
+ aDlg.EnableRegression( true );
+
if( aDlg.Execute() == RET_OK )
{
-// SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
- SfxItemSet aOutItemSet( m_pDrawModelWrapper->GetItemPool(), 1, 2 );
+ SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
aDlg.GetAttr( aOutItemSet );
-// bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
+ bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
}
}
catch( uno::RuntimeException& e)
{
ASSERT_EXCEPTION( e );
}
+ //make sure that all objects using m_pDrawModelWrapper or m_pChartView are already deleted
+ if(bChanged) try
+ {
+ impl_rebuildView();
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
}
//.............................................................................