summaryrefslogtreecommitdiff
path: root/chart2/source/controller
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-02 08:04:03 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-29 08:09:30 +0100
commit750b46025ca276c81ac535ad6741f36bfc88327b (patch)
tree8a196c33bd9b9e0a382d3d711c0c8b8f505a3902 /chart2/source/controller
parent55656ee2e88b7a79a265f43fc3746a7e2186301e (diff)
give up with the nice solutions and enjoy the ugly hack
I was always hitting a corner case so it seems that this need some drastic measures. Change-Id: I3fdd278b9c3fed178513d653ef24ad8adf20cbd2
Diffstat (limited to 'chart2/source/controller')
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx12
-rw-r--r--chart2/source/controller/dialogs/DialogModel.hxx6
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx10
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.hxx3
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hrc3
5 files changed, 34 insertions, 0 deletions
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index c6d4f84ff146..0285548da4f3 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -716,6 +716,11 @@ bool DialogModel::setData(
return true;
}
+void DialogModel::setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd) const
+{
+ getModel().setTimeBasedRange(nStart, nEnd);
+}
+
OUString DialogModel::ConvertRoleFromInternalToUI( const OUString & rRoleString )
{
return lcl_ConvertRole( rRoleString, true );
@@ -820,6 +825,13 @@ sal_Int32 DialogModel::countSeries() const
return ::std::accumulate( aCnt.begin(), aCnt.end(), 0, lcl_addSeriesNumber());
}
+ChartModel& DialogModel::getModel() const
+{
+ uno::Reference< frame::XModel > xModel = getChartModel();
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xModel.get());
+ return *pModel;
+}
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx
index ee236cf5cb69..f6735f5758a9 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -24,6 +24,8 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include "ChartModel.hxx"
+
#include <vector>
#include <map>
#include <boost/shared_ptr.hpp>
@@ -140,6 +142,8 @@ 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 startControllerLockTimer();
static OUString ConvertRoleFromInternalToUI( const OUString & rRoleString );
@@ -177,6 +181,8 @@ private:
bool bSetStyles );
sal_Int32 countSeries() const;
+
+ ChartModel& getModel() const;
};
} // namespace chart
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index 52f8509d48e9..0687aaa2458f 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -89,6 +89,9 @@ RangeChooserTabPage::RangeChooserTabPage( Window* pParent
get(m_pCB_FirstColumnAsLabel, "CB_FIRST_COLUMN_ASLABELS");
get(m_pFTTitle, "STR_PAGE_DATA_RANGE");// OH:remove later with dialog title
m_pCB_TimeBased = NULL;
+ m_pFt_TimeBased = NULL;
+ m_pEd_TimeStart = NULL;
+ m_pEd_TimeEnd = NULL;
m_pFT_Caption->Show(!bHideDescription);
@@ -230,6 +233,13 @@ void RangeChooserTabPage::changeDialogModelAccordingToControls()
beans::PropertyState_DIRECT_VALUE );
m_rDialogModel.setData( aArguments );
m_bIsDirty = false;
+
+ if(bTimeBased)
+ {
+ sal_Int32 nStart = m_pEd_TimeStart->GetText().toInt32();
+ sal_Int32 nEnd = m_pEd_TimeEnd->GetText().toInt32();
+ m_rDialogModel.setTimeBasedRange(nStart, nEnd);
+ }
}
//@todo warn user that the selected range is not valid
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
index 57ab2ee1f613..9f3e5386dd75 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
@@ -90,6 +90,9 @@ protected: //member
FixedText* m_pFTTitle;
CheckBox* m_pCB_TimeBased;
+ FixedText* m_pFt_TimeBased;
+ Edit* m_pEd_TimeStart;
+ Edit* m_pEd_TimeEnd;
sal_Int32 m_nChangingControlCalls;
bool m_bIsDirty;
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hrc b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hrc
index 6bfc0d259764..685c4fe8e6c0 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hrc
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hrc
@@ -29,5 +29,8 @@
#define CB_Z_SECONDARY 6
#define CB_TIME_BASED 3
+#define FT_TIME_BASED 4
+#define ED_TIME_START 5
+#define ED_TIME_END 6
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */