summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx20
-rw-r--r--chart2/source/controller/dialogs/DialogModel.hxx14
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx5
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx2
4 files changed, 36 insertions, 5 deletions
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 0285548da4f3..c7903f06e4b2 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -367,6 +367,13 @@ struct lcl_addSeriesNumber : public ::std::binary_function<
namespace chart
{
+TimeBasedInfo::TimeBasedInfo():
+ bTimeBased(false),
+ nStart(0),
+ nEnd(0)
+{
+}
+
DialogModel::DialogModel(
const Reference< XChartDocument > & xChartDocument,
const Reference< uno::XComponentContext > & xContext ) :
@@ -377,7 +384,12 @@ DialogModel::DialogModel(
}
DialogModel::~DialogModel()
-{}
+{
+ if(maTimeBasedInfo.bTimeBased)
+ {
+ getModel().setTimeBasedRange(maTimeBasedInfo.nStart, maTimeBasedInfo.nEnd);
+ }
+}
void DialogModel::setTemplate(
const Reference< XChartTypeTemplate > & xTemplate )
@@ -716,9 +728,11 @@ bool DialogModel::setData(
return true;
}
-void DialogModel::setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd) const
+void DialogModel::setTimeBasedRange( bool bTimeBased, sal_Int32 nStart, sal_Int32 nEnd) const
{
- getModel().setTimeBasedRange(nStart, nEnd);
+ maTimeBasedInfo.nStart = nStart;
+ maTimeBasedInfo.nEnd = nEnd;
+ maTimeBasedInfo.bTimeBased = bTimeBased;
}
OUString DialogModel::ConvertRoleFromInternalToUI( const OUString & rRoleString )
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx
index f6735f5758a9..244dd82c1d05 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -47,6 +47,15 @@ namespace chart
class RangeSelectionHelper;
+struct TimeBasedInfo
+{
+ TimeBasedInfo();
+
+ bool bTimeBased;
+ sal_Int32 nStart;
+ sal_Int32 nEnd;
+};
+
class DialogModel
{
public:
@@ -142,7 +151,9 @@ public:
bool setData( const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue > & rArguments );
- void setTimeBasedRange( sal_Int32 nStart, sal_Int32 nEnd) const;
+ void setTimeBasedRange( bool bTimeBased, sal_Int32 nStart, sal_Int32 nEnd) const;
+
+ const TimeBasedInfo& getTimeBasedInfo() const { return maTimeBasedInfo; }
void startControllerLockTimer();
@@ -183,6 +194,7 @@ private:
sal_Int32 countSeries() const;
ChartModel& getModel() const;
+ mutable TimeBasedInfo maTimeBasedInfo;
};
} // namespace chart
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 330bfb790f5f..de931a5200c6 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -986,6 +986,11 @@ bool DataSourceTabPage::updateModelFromControl( Edit * pField )
Reference< util::XModifiable > xModifiable( m_rDialogModel.getChartModel(), uno::UNO_QUERY );
if( xModifiable.is() )
xModifiable->setModified( sal_True );
+ const TimeBasedInfo& rInfo = m_rDialogModel.getTimeBasedInfo();
+ if(rInfo.bTimeBased)
+ {
+ m_rDialogModel.setTimeBasedRange(rInfo.bTimeBased, rInfo.nStart, rInfo.nEnd);
+ }
}
catch( const uno::Exception & ex )
{
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index 7217fedf785a..a244504f544f 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -243,7 +243,7 @@ void RangeChooserTabPage::changeDialogModelAccordingToControls()
{
sal_Int32 nStart = m_pEd_TimeStart->GetText().toInt32();
sal_Int32 nEnd = m_pEd_TimeEnd->GetText().toInt32();
- m_rDialogModel.setTimeBasedRange(nStart, nEnd);
+ m_rDialogModel.setTimeBasedRange(true, nStart, nEnd);
}
}