1 diff --git sc/inc/attarray.hxx sc/inc/attarray.hxx
2 index 2a8c515..82ea003 100644
3 --- sc/inc/attarray.hxx
4 +++ sc/inc/attarray.hxx
5 @@ -39,6 +39,7 @@ class ScEditDataArray;
9 +class ScFlatBoolRowSegments;
12 class SfxItemPoolCache;
13 @@ -162,7 +163,7 @@ public:
14 BOOL bRefresh, BOOL bAttrs );
15 BOOL RemoveAreaMerge( SCROW nStartRow, SCROW nEndRow );
17 - void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset );
18 + void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
19 BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const;
21 void DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow);
22 diff --git sc/inc/column.hxx sc/inc/column.hxx
23 index babda9e..0f9586e 100644
26 @@ -71,7 +71,7 @@ class ScPostIt;
27 struct ScFunctionData;
29 struct ScMergePatternState;
31 +class ScFlatBoolRowSegments;
33 #define COLUMN_DELTA 4
35 @@ -341,7 +341,7 @@ public:
36 const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const;
37 const ScStyleSheet* GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const;
39 - void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset );
40 + void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
41 BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const;
43 /// May return -1 if not found
44 diff --git sc/source/core/data/attarray.cxx sc/source/core/data/attarray.cxx
45 index c02d595..a5f3607 100644
46 --- sc/source/core/data/attarray.cxx
47 +++ sc/source/core/data/attarray.cxx
49 #include "rechead.hxx"
50 #include "globstr.hrc"
52 +#include "segmenttree.hxx"
55 #define DBGOUTPUT(s) \
56 @@ -1749,8 +1750,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const
61 -void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
62 +void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
66 @@ -1762,7 +1762,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pU
67 // for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
68 // pUsed[nRow] = TRUE;
70 - memset( &pUsed[nStart], TRUE, nEnd-nStart+1 );
71 + rUsedRows.setTrue(nStart, nEnd);
75 diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
76 index 39061a7..374606a 100644
77 --- sc/source/core/data/column.cxx
78 +++ sc/source/core/data/column.cxx
79 @@ -620,13 +620,11 @@ const ScStyleSheet* ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRo
80 return bEqual ? pStyle : NULL;
84 -void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
85 +void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
87 - pAttrArray->FindStyleSheet( pStyleSheet, pUsed, bReset );
88 + pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset );
92 BOOL ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const
94 return pAttrArray->IsStyleSheetUsed( rStyle, bGatherAllStyles );
95 diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
96 index 8cb6f7a..5a78469 100644
97 --- sc/source/core/data/table2.cxx
98 +++ sc/source/core/data/table2.cxx
100 #include "bcaslot.hxx"
101 #include "postit.hxx"
102 #include "globstr.hrc"
103 +#include "segmenttree.hxx"
107 @@ -1830,36 +1831,24 @@ void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRem
108 double nPPTX, double nPPTY,
109 const Fraction& rZoomX, const Fraction& rZoomY )
111 - BOOL* pUsed = new BOOL[MAXROWCOUNT];
112 - memset( pUsed, 0, sizeof(BOOL) * (MAXROWCOUNT) );
113 + ScFlatBoolRowSegments aUsedRows;
114 + for (SCCOL i = 0; i <= MAXCOL; ++i)
115 + aCol[i].FindStyleSheet(pStyleSheet, aUsedRows, bRemoved);
118 - for (nCol=0; nCol<=MAXCOL; nCol++)
119 - aCol[nCol].FindStyleSheet( pStyleSheet, pUsed, bRemoved );
121 + while (nRow <= MAXROW)
123 + ScFlatBoolRowSegments::RangeData aData;
124 + if (!aUsedRows.getRangeData(nRow, aData))
128 - BOOL bFound = FALSE;
129 - SCROW nStart = 0, nEnd = 0;
130 - for (SCROW i=0; i<=MAXROW; i++)
143 - SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
148 - SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
149 + SCROW nEndRow = aData.mnRow2;
151 + SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE);
154 + nRow = nEndRow + 1;