summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-02 05:08:32 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-29 08:09:30 +0100
commit55656ee2e88b7a79a265f43fc3746a7e2186301e (patch)
treeeebc114793896d075fb5f361f01220c5fbfbc1d1 /chart2/source/model
parent893a7fc4e494f58d105f567c652bd2b6c6c825f8 (diff)
some improvements for the time based charting
The updating seems to work. It just does not update the references yet. Change-Id: I0a971dbe2beb113c1c3e9ef103d77d5d8c7174a0
Diffstat (limited to 'chart2/source/model')
-rw-r--r--chart2/source/model/main/ChartModel.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index d65ab67ddf3c..a0d93d171e7b 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1357,14 +1357,34 @@ bool ChartModel::isTimeBased() const
void ChartModel::setTimeBased(bool bTimeBased)
{
mbTimeBased = bTimeBased;
+ uno::Sequence<Reference< chart2::data::XLabeledDataSequence > >
+ xDataSequences = getDataSequences();
+ sal_Int32 n = xDataSequences.getLength();
+ for(sal_Int32 i = 0; i < n; ++i)
+ {
+ uno::Reference< chart2::XTimeBased > xTimeBased(xDataSequences[i]->getValues(), uno::UNO_QUERY);
+ SAL_WARN_IF(!xTimeBased.is(), "chart2", "does not support time based charting");
+ if(xTimeBased.is())
+ {
+ uno::Reference< beans::XPropertySet > xPropSet(xTimeBased, uno::UNO_QUERY_THROW);
+ xPropSet->setPropertyValue("TimeBased", uno::makeAny(bTimeBased));
+ }
+ }
}
void ChartModel::getNextTimePoint()
{
- uno::Reference< chart2::XTimeBased > xTimeBased(getUsedData(), uno::UNO_QUERY);
- SAL_WARN_IF(!xTimeBased.is(), "chart2", "does not support time based charting");
- if(xTimeBased.is())
- xTimeBased->switchToNext();
+ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > xDataSequences = getDataSequences();
+ sal_Int32 n = xDataSequences.getLength();
+ for(sal_Int32 i = 0; i < n; ++i)
+ {
+ uno::Reference< chart2::XTimeBased > xTimeBased(xDataSequences[i]->getValues(), uno::UNO_QUERY);
+ SAL_WARN_IF(!xTimeBased.is(), "chart2", "does not support time based charting");
+ if(xTimeBased.is())
+ {
+ xTimeBased->switchToNext();
+ }
+ }
}
} // namespace chart