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,8 +71,8 @@ class ScPostIt;
27 struct ScFunctionData;
29 struct ScMergePatternState;
30 struct ScSetStringParam;
32 +class ScFlatBoolRowSegments;
34 #define COLUMN_DELTA 4
36 @@ -341,7 +341,7 @@ public:
37 const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const;
38 const ScStyleSheet* GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const;
40 - void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset );
41 + void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
42 BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const;
44 /// May return -1 if not found
45 diff --git sc/source/core/data/attarray.cxx sc/source/core/data/attarray.cxx
46 index c02d595..a5f3607 100644
47 --- sc/source/core/data/attarray.cxx
48 +++ sc/source/core/data/attarray.cxx
50 #include "rechead.hxx"
51 #include "globstr.hrc"
53 +#include "segmenttree.hxx"
56 #define DBGOUTPUT(s) \
57 @@ -1749,8 +1750,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const
62 -void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
63 +void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
67 @@ -1762,7 +1762,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pU
68 // for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
69 // pUsed[nRow] = TRUE;
71 - memset( &pUsed[nStart], TRUE, nEnd-nStart+1 );
72 + rUsedRows.setTrue(nStart, nEnd);
76 diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
77 index 39061a7..374606a 100644
78 --- sc/source/core/data/column.cxx
79 +++ sc/source/core/data/column.cxx
80 @@ -620,13 +620,11 @@ const ScStyleSheet* ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRo
81 return bEqual ? pStyle : NULL;
85 -void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
86 +void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
88 - pAttrArray->FindStyleSheet( pStyleSheet, pUsed, bReset );
89 + pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset );
93 BOOL ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const
95 return pAttrArray->IsStyleSheetUsed( rStyle, bGatherAllStyles );
96 diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
97 index 8cb6f7a..5a78469 100644
98 --- sc/source/core/data/table2.cxx
99 +++ sc/source/core/data/table2.cxx
101 #include "bcaslot.hxx"
102 #include "postit.hxx"
103 #include "globstr.hrc"
104 +#include "segmenttree.hxx"
108 @@ -1830,36 +1831,24 @@ void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRem
109 double nPPTX, double nPPTY,
110 const Fraction& rZoomX, const Fraction& rZoomY )
112 - BOOL* pUsed = new BOOL[MAXROWCOUNT];
113 - memset( pUsed, 0, sizeof(BOOL) * (MAXROWCOUNT) );
114 + ScFlatBoolRowSegments aUsedRows;
115 + for (SCCOL i = 0; i <= MAXCOL; ++i)
116 + aCol[i].FindStyleSheet(pStyleSheet, aUsedRows, bRemoved);
119 - for (nCol=0; nCol<=MAXCOL; nCol++)
120 - aCol[nCol].FindStyleSheet( pStyleSheet, pUsed, bRemoved );
122 + while (nRow <= MAXROW)
124 + ScFlatBoolRowSegments::RangeData aData;
125 + if (!aUsedRows.getRangeData(nRow, aData))
129 - BOOL bFound = FALSE;
130 - SCROW nStart = 0, nEnd = 0;
131 - for (SCROW i=0; i<=MAXROW; i++)
144 - SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
149 - SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
150 + SCROW nEndRow = aData.mnRow2;
152 + SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE);
155 + nRow = nEndRow + 1;