summaryrefslogtreecommitdiff
path: root/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-07-30 10:53:59 +0000
committerRüdiger Timm <rt@openoffice.org>2008-07-30 10:53:59 +0000
commitfefca351e47279f542bb1fb04b0e40b6793caad5 (patch)
tree390948c2c2952c202a27e3d44ae998f42d119a52 /chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
parent0dbab53b646bff5ce8678c0eb4fc8e0f6df7e16d (diff)
INTEGRATION: CWS chart22 (1.5.2); FILE MERGED
2008/04/17 11:30:10 iha 1.5.2.2: RESYNC: (1.5-1.6); FILE MERGED 2008/02/21 17:06:56 iha 1.5.2.1: #i65549# Plotting of missing values
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx')
-rw-r--r--chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx55
1 files changed, 54 insertions, 1 deletions
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index 4d89769118d6..63e961855cbe 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SeriesOptionsItemConverter.cxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
* This file is part of OpenOffice.org.
*
@@ -43,11 +43,19 @@
#include "DiagramHelper.hxx"
#include "ChartTypeHelper.hxx"
#include "DataSeriesHelper.hxx"
+
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
// for SfxBoolItem
#include <svtools/eitem.hxx>
#include <svtools/intitem.hxx>
+
+//SfxIntegerListItem
+#include <svtools/ilstitem.hxx>
+#define _SVSTDARR_ULONGS
+#include <svtools/svstdarr.hxx>
+
#include <rtl/math.hxx>
#include <functional>
#include <algorithm>
@@ -83,6 +91,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
, m_bSupportingStartingAngle(false)
, m_nStartingAngle(90)
, m_bClockwise(false)
+ , m_aSupportedMissingValueTreatments()
+ , m_nMissingValueTreatment(0)
{
try
{
@@ -145,6 +155,10 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
{
xDiagramProperties->getPropertyValue( C2U( "StartingAngle" ) ) >>= m_nStartingAngle;
}
+
+ m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType );
+ m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment(
+ ChartModelHelper::findDiagram(m_xChartModel), xChartType );
}
catch( uno::Exception ex )
{
@@ -302,6 +316,31 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte
}
}
break;
+
+ case SCHATTR_MISSING_VALUE_TREATMENT:
+ {
+ if( m_aSupportedMissingValueTreatments.getLength() )
+ {
+ sal_Int32 nNew = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
+ if( m_nMissingValueTreatment != nNew )
+ {
+ try
+ {
+ uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
+ if( xDiagramProperties.is() )
+ {
+ xDiagramProperties->setPropertyValue( C2U( "MissingValueTreatment" ), uno::makeAny( nNew ));
+ bChanged = true;
+ }
+ }
+ catch( uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+ }
+ }
+ break;
}
return bChanged;
}
@@ -359,6 +398,20 @@ void SeriesOptionsItemConverter::FillSpecialItem(
rOutItemSet.Put( SfxBoolItem(nWhichId,m_bClockwise) );
break;
}
+ case SCHATTR_MISSING_VALUE_TREATMENT:
+ {
+ if( m_aSupportedMissingValueTreatments.getLength() )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_nMissingValueTreatment ));
+ break;
+ }
+ case SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS:
+ {
+ SvULongs aList;
+ for ( sal_Int32 nN=0; nN<m_aSupportedMissingValueTreatments.getLength(); nN++ )
+ aList.Insert( m_aSupportedMissingValueTreatments[nN], sal::static_int_cast< USHORT >(nN) );
+ rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
+ break;
+ }
default:
break;
}