diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-04 11:16:06 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-29 08:09:34 +0100 |
commit | 9c5593bebf4b573cfb7795ed857c6dceb4a26e73 (patch) | |
tree | bb50ec6bfb7bbda0c77fdb582bb73970782953df /chart2 | |
parent | d3959bba7165e6a8d53195eccfcaaa652edc24ea (diff) |
start time based onlz after dialog is closed
everything else seems to result in serious bugs!!
Change-Id: I1afbdb7623f877781c7ef362d87608a1e2aba72e
Diffstat (limited to 'chart2')
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); } } |