diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-02 08:04:03 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-29 08:09:30 +0100 |
commit | 750b46025ca276c81ac535ad6741f36bfc88327b (patch) | |
tree | 8a196c33bd9b9e0a382d3d711c0c8b8f505a3902 /sc | |
parent | 55656ee2e88b7a79a265f43fc3746a7e2186301e (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 'sc')
-rw-r--r-- | sc/inc/chart2uno.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 24 |
2 files changed, 25 insertions, 3 deletions
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx index ce36c268dea1..0eb58e1b4a5d 100644 --- a/sc/inc/chart2uno.hxx +++ b/sc/inc/chart2uno.hxx @@ -279,9 +279,11 @@ public: std::exception); // XTimeBased - virtual sal_Bool switchToNext() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool switchToNext(sal_Bool bWrap) throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool setToPointInTime(sal_Int32 nPoint) throw (::com::sun::star::uno::RuntimeException); + virtual void setRange(sal_Int32 nStart, sal_Int32 nEnd) throw (::com::sun::star::uno::RuntimeException); + // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 0dfd65f1f00e..05121150e8ee 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2491,6 +2491,10 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc, , m_pValueListener( NULL ) , m_bGotDataChangedHint(false) , m_bExtDataRebuildQueued(false) + , mbTimeBased(false) + , mnTimeBasedStart(0) + , mnTimeBasedEnd(0) + , mnCurrentTab(0) { OSL_ENSURE(pTokens, "reference token list is null"); @@ -3588,14 +3592,18 @@ void ScChart2DataSequence::setDataChangedHint(bool b) m_bGotDataChangedHint = b; } -sal_Bool ScChart2DataSequence::switchToNext() +sal_Bool ScChart2DataSequence::switchToNext(sal_Bool bWrap) throw (uno::RuntimeException) { - if(!m_pTokens) + if(!m_pTokens || !mbTimeBased) return sal_True; if(mnCurrentTab >= mnTimeBasedEnd) + { + if(bWrap) + setToPointInTime(0); return false; + } for(vector<ScTokenRef>::iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end(); itr != itrEnd; ++itr) @@ -3611,11 +3619,21 @@ sal_Bool ScChart2DataSequence::switchToNext() e.IncTab(1); } + ++mnCurrentTab; + RebuildDataCache(); return sal_True; } +void ScChart2DataSequence::setRange(sal_Int32 nStart, sal_Int32 nEnd) + throw (uno::RuntimeException) +{ + mnTimeBasedStart = nStart; + mnTimeBasedEnd = nEnd; + mnCurrentTab = mnTimeBasedStart; +} + sal_Bool ScChart2DataSequence::setToPointInTime(sal_Int32 nPoint) throw (uno::RuntimeException) { @@ -3640,6 +3658,8 @@ sal_Bool ScChart2DataSequence::setToPointInTime(sal_Int32 nPoint) e.SetAbsTab(nTab); } + mnCurrentTab = nTab; + RebuildDataCache(); return sal_True; |