update dev300-m58
[ooovba.git] / applied_patches / 0186-calc-perf-ods-import-properties.diff
blobc5332c1df353f07c906eb980a002b13e9c909367
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;
6 class ScMarkArray;
7 class ScPatternAttr;
8 class ScStyleSheet;
9 +class ScFlatBoolRowSegments;
11 class Rectangle;
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
24 --- sc/inc/column.hxx
25 +++ sc/inc/column.hxx
26 @@ -71,8 +71,8 @@ class ScPostIt;
27 struct ScFunctionData;
28 struct ScLineFlags;
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
49 @@ -57,6 +57,7 @@
50 #include "rechead.hxx"
51 #include "globstr.hrc"
52 #include "cell.hxx"
53 +#include "segmenttree.hxx"
55 #undef DBG_INVALIDATE
56 #define DBGOUTPUT(s) \
57 @@ -1749,8 +1750,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const
58 return nRet;
62 -void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
63 +void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
65 SCROW nStart = 0;
66 SCSIZE nPos = 0;
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);
74 if (bReset)
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
100 @@ -60,6 +60,7 @@
101 #include "bcaslot.hxx"
102 #include "postit.hxx"
103 #include "globstr.hrc"
104 +#include "segmenttree.hxx"
106 #include <math.h>
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);
118 - SCCOL nCol;
119 - for (nCol=0; nCol<=MAXCOL; nCol++)
120 - aCol[nCol].FindStyleSheet( pStyleSheet, pUsed, bRemoved );
121 + SCROW nRow = 0;
122 + while (nRow <= MAXROW)
124 + ScFlatBoolRowSegments::RangeData aData;
125 + if (!aUsedRows.getRangeData(nRow, aData))
126 + // search failed!
127 + return;
129 - BOOL bFound = FALSE;
130 - SCROW nStart = 0, nEnd = 0;
131 - for (SCROW i=0; i<=MAXROW; i++)
133 - if (pUsed[i])
135 - if (!bFound)
137 - nStart = i;
138 - bFound = TRUE;
140 - nEnd = i;
142 - else if (bFound)
144 - SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
145 - bFound = FALSE;
148 - if (bFound)
149 - SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
150 + SCROW nEndRow = aData.mnRow2;
151 + if (aData.mbValue)
152 + SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE);
154 - delete[] pUsed;
155 + nRow = nEndRow + 1;