diff options
-rw-r--r-- | sc/inc/markdata.hxx | 13 | ||||
-rw-r--r-- | sc/source/core/data/markdata.cxx | 25 | ||||
-rw-r--r-- | sc/source/core/data/table3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabcont.cxx | 3 |
4 files changed, 37 insertions, 6 deletions
diff --git a/sc/inc/markdata.hxx b/sc/inc/markdata.hxx index 60c04d076bb8..d11173c301fd 100644 --- a/sc/inc/markdata.hxx +++ b/sc/inc/markdata.hxx @@ -108,10 +108,21 @@ public: ScMarkArray GetMarkArray( SCCOL nCol ) const; bool IsCellMarked( SCCOL nCol, SCROW nRow, bool bNoSimple = false ) const; - void FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const; + + /** Create a range list of marks. + @param nForTab + If -1, use start-sheet-tab of the multi-area in ranges. + If >= 0, use given sheet-tab in ranges. + */ + void FillRangeListWithMarks( ScRangeList* pList, bool bClear, SCTAB nForTab = -1 ) const; void ExtendRangeListTables( ScRangeList* pList ) const; ScRangeList GetMarkedRanges() const; + /** Get marked ranges with sheet-tab set to nTab. + Marks are stored for the currently active sheet respectively the + multi-area start-sheet-tab, update ranges with the sheet for which this + is called. */ + ScRangeList GetMarkedRangesForTab( SCTAB nTab ) const; void MarkFromRangeList( const ScRangeList& rList, bool bReset ); diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 70ec2c131def..40e6ff49a8ce 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -355,7 +355,7 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, bool bReset ) } } -void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const +void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear, SCTAB nForTab ) const { if (!pList) return; @@ -367,7 +367,7 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const if ( bMultiMarked ) { - SCTAB nTab = aMultiRange.aStart.Tab(); + SCTAB nTab = (nForTab < 0 ? aMultiRange.aStart.Tab() : nForTab); SCCOL nStartCol = aMultiRange.aStart.Col(); SCCOL nEndCol = aMultiRange.aEnd.Col(); @@ -402,7 +402,17 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const } if ( bMarked ) - pList->Append( aMarkRange ); + { + if (nForTab < 0) + pList->Append( aMarkRange ); + else + { + ScRange aRange( aMarkRange ); + aRange.aStart.SetTab( nForTab ); + aRange.aEnd.SetTab( nForTab ); + pList->Append( aRange ); + } + } } void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const @@ -427,7 +437,14 @@ void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const ScRangeList ScMarkData::GetMarkedRanges() const { ScRangeList aRet; - FillRangeListWithMarks(&aRet, false); + FillRangeListWithMarks(&aRet, false, -1); + return aRet; +} + +ScRangeList ScMarkData::GetMarkedRangesForTab( SCTAB nTab ) const +{ + ScRangeList aRet; + FillRangeListWithMarks(&aRet, false, nTab); return aRet; } diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 2674f3ffb0fe..311ac02182ad 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -3403,7 +3403,7 @@ sal_Int32 ScTable::GetMaxNumberStringLen( void ScTable::UpdateSelectionFunction( ScFunctionData& rData, const ScMarkData& rMark ) { - ScRangeList aRanges = rMark.GetMarkedRanges(); + ScRangeList aRanges = rMark.GetMarkedRangesForTab( nTab ); for (SCCOL nCol = 0; nCol <= MAXCOL && !rData.bError; ++nCol) { if (pColFlags && ColHidden(nCol)) diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 50cbec9d4ca0..6061efcba88c 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -297,6 +297,9 @@ void ScTabControl::Select() rBind.Invalidate( FID_TABLE_HIDE ); rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR ); + // Recalculate status bar functions. + rBind.Invalidate( SID_TABLE_CELL ); + // SetReference onlw when the consolidate dialog is open // (for referenzes over multiple sheets) // for others this is only needed fidgeting |