Kaydet (Commit) 8d777f85 authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#103684 calculate status bar functions across sheets

Also trigger recalculation when additional sheets are selected or deselected.

Change-Id: I259396a3e30c5653ac252b7bb2eb6a0a9405d6cc
üst 84400eae
...@@ -108,10 +108,21 @@ public: ...@@ -108,10 +108,21 @@ public:
ScMarkArray GetMarkArray( SCCOL nCol ) const; ScMarkArray GetMarkArray( SCCOL nCol ) const;
bool IsCellMarked( SCCOL nCol, SCROW nRow, bool bNoSimple = false ) 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; void ExtendRangeListTables( ScRangeList* pList ) const;
ScRangeList GetMarkedRanges() 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 ); void MarkFromRangeList( const ScRangeList& rList, bool bReset );
......
...@@ -355,7 +355,7 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, bool bReset ) ...@@ -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) if (!pList)
return; return;
...@@ -367,7 +367,7 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const ...@@ -367,7 +367,7 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const
if ( bMultiMarked ) if ( bMultiMarked )
{ {
SCTAB nTab = aMultiRange.aStart.Tab(); SCTAB nTab = (nForTab < 0 ? aMultiRange.aStart.Tab() : nForTab);
SCCOL nStartCol = aMultiRange.aStart.Col(); SCCOL nStartCol = aMultiRange.aStart.Col();
SCCOL nEndCol = aMultiRange.aEnd.Col(); SCCOL nEndCol = aMultiRange.aEnd.Col();
...@@ -402,7 +402,17 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const ...@@ -402,7 +402,17 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, bool bClear ) const
} }
if ( bMarked ) 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 void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const
...@@ -427,7 +437,14 @@ void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const ...@@ -427,7 +437,14 @@ void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const
ScRangeList ScMarkData::GetMarkedRanges() const ScRangeList ScMarkData::GetMarkedRanges() const
{ {
ScRangeList aRet; 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; return aRet;
} }
......
...@@ -3403,7 +3403,7 @@ sal_Int32 ScTable::GetMaxNumberStringLen( ...@@ -3403,7 +3403,7 @@ sal_Int32 ScTable::GetMaxNumberStringLen(
void ScTable::UpdateSelectionFunction( ScFunctionData& rData, const ScMarkData& rMark ) 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) for (SCCOL nCol = 0; nCol <= MAXCOL && !rData.bError; ++nCol)
{ {
if (pColFlags && ColHidden(nCol)) if (pColFlags && ColHidden(nCol))
......
...@@ -297,6 +297,9 @@ void ScTabControl::Select() ...@@ -297,6 +297,9 @@ void ScTabControl::Select()
rBind.Invalidate( FID_TABLE_HIDE ); rBind.Invalidate( FID_TABLE_HIDE );
rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR ); 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 // SetReference onlw when the consolidate dialog is open
// (for referenzes over multiple sheets) // (for referenzes over multiple sheets)
// for others this is only needed fidgeting // for others this is only needed fidgeting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment