[Libreoffice-commits] core.git: Branch 'feature/chart-opengl2' - chart2/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Jan 4 00:18:16 PST 2014
chart2/source/controller/dialogs/DialogModel.cxx | 20 ++++++++++++++++---
chart2/source/controller/dialogs/DialogModel.hxx | 14 ++++++++++++-
chart2/source/controller/dialogs/tp_DataSource.cxx | 5 ++++
chart2/source/controller/dialogs/tp_RangeChooser.cxx | 2 -
4 files changed, 36 insertions(+), 5 deletions(-)
New commits:
commit cd818c33026e13d77b85fb8a0e6859cfacc60605
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Jan 4 11:16:06 2014 +0100
start time based onlz after dialog is closed
everything else seems to result in serious bugs!!
Change-Id: I1afbdb7623f877781c7ef362d87608a1e2aba72e
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 0285548..c7903f0 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 f6735f5..244dd82 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 87cd872..e21a662 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -1050,6 +1050,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 0105f5d..60e74ab 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -278,7 +278,7 @@ void RangeChooserTabPage::changeDialogModelAccordingToControls()
{
sal_Int32 nStart = m_aEd_TimeStart.GetText().toInt32();
sal_Int32 nEnd = m_aEd_TimeEnd.GetText().toInt32();
- m_rDialogModel.setTimeBasedRange(nStart, nEnd);
+ m_rDialogModel.setTimeBasedRange(true, nStart, nEnd);
}
}
More information about the Libreoffice-commits
mailing list