xref: /aoo41x/main/sc/source/filter/excel/colrowst.cxx (revision 3ce8cab8)
1b3f79822SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3b3f79822SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4b3f79822SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5b3f79822SAndrew Rist  * distributed with this work for additional information
6b3f79822SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7b3f79822SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8b3f79822SAndrew Rist  * "License"); you may not use this file except in compliance
9b3f79822SAndrew Rist  * with the License.  You may obtain a copy of the License at
10b3f79822SAndrew Rist  *
11b3f79822SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12b3f79822SAndrew Rist  *
13b3f79822SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14b3f79822SAndrew Rist  * software distributed under the License is distributed on an
15b3f79822SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16b3f79822SAndrew Rist  * KIND, either express or implied.  See the License for the
17b3f79822SAndrew Rist  * specific language governing permissions and limitations
18b3f79822SAndrew Rist  * under the License.
19b3f79822SAndrew Rist  *
20b3f79822SAndrew Rist  *************************************************************/
21b3f79822SAndrew Rist 
22b3f79822SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sc.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "colrowst.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <string.h>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include "document.hxx"
34cdf0e10cSrcweir #include "root.hxx"
35cdf0e10cSrcweir #include "ftools.hxx"
36cdf0e10cSrcweir #include "xltable.hxx"
37cdf0e10cSrcweir #include "xistream.hxx"
38cdf0e10cSrcweir #include "xistyle.hxx"
39cdf0e10cSrcweir #include "queryparam.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // for filter manager
42cdf0e10cSrcweir #include "excimp8.hxx"
43cdf0e10cSrcweir 
44cdf0e10cSrcweir // ============================================================================
45cdf0e10cSrcweir 
46cdf0e10cSrcweir const sal_uInt8 EXC_COLROW_USED         = 0x01;
47cdf0e10cSrcweir const sal_uInt8 EXC_COLROW_DEFAULT      = 0x02;
48cdf0e10cSrcweir const sal_uInt8 EXC_COLROW_HIDDEN       = 0x04;
49cdf0e10cSrcweir const sal_uInt8 EXC_COLROW_MAN          = 0x08;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir // ============================================================================
52cdf0e10cSrcweir 
XclImpColRowSettings(const XclImpRoot & rRoot)53cdf0e10cSrcweir XclImpColRowSettings::XclImpColRowSettings( const XclImpRoot& rRoot ) :
54cdf0e10cSrcweir     XclImpRoot( rRoot ),
55a786e0ddSEike Rathke     mnMaxCol( rRoot.GetXclMaxPos().Col() ),
56a786e0ddSEike Rathke     mnMaxRow( rRoot.GetXclMaxPos().Row() ),
57cdf0e10cSrcweir     mnLastScRow( -1 ),
58cdf0e10cSrcweir     mnDefWidth( STD_COL_WIDTH ),
59cdf0e10cSrcweir     mnDefHeight( static_cast< sal_uInt16 >( STD_ROW_HEIGHT ) ),
60cdf0e10cSrcweir     mnDefRowFlags( EXC_DEFROW_DEFAULTFLAGS ),
61cdf0e10cSrcweir     mbHasStdWidthRec( false ),
62cdf0e10cSrcweir     mbHasDefHeight( false ),
63cdf0e10cSrcweir     mbDirty( true )
64cdf0e10cSrcweir {
65a786e0ddSEike Rathke     maWidths.resize( static_cast< size_t >( mnMaxCol + 1 ), 0 );
66a786e0ddSEike Rathke     maColFlags.resize( static_cast< size_t >( mnMaxCol + 1 ), 0 );
67a786e0ddSEike Rathke     maHeights.resize( static_cast< size_t >( mnMaxRow + 1 ), 0 );
68a786e0ddSEike Rathke     maRowFlags.resize( static_cast< size_t >( mnMaxRow + 1 ), 0 );
69cdf0e10cSrcweir }
70cdf0e10cSrcweir 
~XclImpColRowSettings()71cdf0e10cSrcweir XclImpColRowSettings::~XclImpColRowSettings()
72cdf0e10cSrcweir {
73cdf0e10cSrcweir }
74cdf0e10cSrcweir 
SetDefWidth(sal_uInt16 nDefWidth,bool bStdWidthRec)75cdf0e10cSrcweir void XclImpColRowSettings::SetDefWidth( sal_uInt16 nDefWidth, bool bStdWidthRec )
76cdf0e10cSrcweir {
77cdf0e10cSrcweir     if( bStdWidthRec )
78cdf0e10cSrcweir     {
79cdf0e10cSrcweir         // STANDARDWIDTH record overrides DEFCOLWIDTH record
80cdf0e10cSrcweir         mnDefWidth = nDefWidth;
81cdf0e10cSrcweir         mbHasStdWidthRec = true;
82cdf0e10cSrcweir     }
83cdf0e10cSrcweir     else if( !mbHasStdWidthRec )
84cdf0e10cSrcweir     {
85cdf0e10cSrcweir         // use DEFCOLWIDTH record only, if no STANDARDWIDTH record exists
86cdf0e10cSrcweir         mnDefWidth = nDefWidth;
87cdf0e10cSrcweir     }
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
SetWidthRange(SCCOL nScCol1,SCCOL nScCol2,sal_uInt16 nWidth)90cdf0e10cSrcweir void XclImpColRowSettings::SetWidthRange( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nWidth )
91cdf0e10cSrcweir {
92a786e0ddSEike Rathke     DBG_ASSERT( (0 <= nScCol1) && (nScCol1 <= nScCol2) && (nScCol2 <= mnMaxCol),
93a786e0ddSEike Rathke         "XclImpColRowSettings::SetColWidthRange - invalid column range" );
94a786e0ddSEike Rathke 
95a786e0ddSEike Rathke     nScCol2 = ::std::min( nScCol2, mnMaxCol );
96a786e0ddSEike Rathke     if( (0 <= nScCol1) && (nScCol1 <= nScCol2) )
97a786e0ddSEike Rathke     {
98a786e0ddSEike Rathke         ::std::fill( maWidths.begin() + nScCol1, maWidths.begin() + nScCol2 + 1, nWidth );
99a786e0ddSEike Rathke         for( ScfUInt8Vec::iterator aIt = maColFlags.begin() + nScCol1, aEnd = maColFlags.begin() + nScCol2 + 1; aIt != aEnd; ++aIt )
100a786e0ddSEike Rathke             ::set_flag( *aIt, EXC_COLROW_USED );
101a786e0ddSEike Rathke     }
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
HideCol(SCCOL nScCol)104cdf0e10cSrcweir void XclImpColRowSettings::HideCol( SCCOL nScCol )
105cdf0e10cSrcweir {
106a786e0ddSEike Rathke     if( (0 <= nScCol) && (nScCol <= mnMaxCol) )
107cdf0e10cSrcweir         ::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN );
108cdf0e10cSrcweir }
109cdf0e10cSrcweir 
HideColRange(SCCOL nScCol1,SCCOL nScCol2)110cdf0e10cSrcweir void XclImpColRowSettings::HideColRange( SCCOL nScCol1, SCCOL nScCol2 )
111cdf0e10cSrcweir {
112a786e0ddSEike Rathke     DBG_ASSERT( (0 <= nScCol1) && (nScCol1 <= nScCol2) && (nScCol2 <= mnMaxCol), "XclImpColRowSettings::HideColRange - invalid column range" );
113a786e0ddSEike Rathke     nScCol2 = ::std::min( nScCol2, mnMaxCol );
114a786e0ddSEike Rathke     if( (0 <= nScCol1) && (nScCol1 <= nScCol2) )
115a786e0ddSEike Rathke         for( ScfUInt8Vec::iterator aIt = maColFlags.begin() + nScCol1, aEnd = maColFlags.begin() + nScCol2 + 1; aIt != aEnd; ++aIt )
116a786e0ddSEike Rathke             ::set_flag( *aIt, EXC_COLROW_HIDDEN );
117cdf0e10cSrcweir }
118cdf0e10cSrcweir 
SetDefHeight(sal_uInt16 nDefHeight,sal_uInt16 nFlags)119cdf0e10cSrcweir void XclImpColRowSettings::SetDefHeight( sal_uInt16 nDefHeight, sal_uInt16 nFlags )
120cdf0e10cSrcweir {
121cdf0e10cSrcweir     mnDefHeight = nDefHeight;
122cdf0e10cSrcweir     mnDefRowFlags = nFlags;
123cdf0e10cSrcweir     if( mnDefHeight == 0 )
124cdf0e10cSrcweir     {
125cdf0e10cSrcweir         mnDefHeight = static_cast< sal_uInt16 >( STD_ROW_HEIGHT );
126cdf0e10cSrcweir         ::set_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN );
127cdf0e10cSrcweir     }
128cdf0e10cSrcweir     mbHasDefHeight = true;
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
SetHeight(SCROW nScRow,sal_uInt16 nHeight)131cdf0e10cSrcweir void XclImpColRowSettings::SetHeight( SCROW nScRow, sal_uInt16 nHeight )
132cdf0e10cSrcweir {
133a786e0ddSEike Rathke     if( (0 <= nScRow) && (nScRow <= mnMaxRow) )
134cdf0e10cSrcweir     {
135cdf0e10cSrcweir         sal_uInt16 nRawHeight = nHeight & EXC_ROW_HEIGHTMASK;
136cdf0e10cSrcweir         bool bDefHeight = ::get_flag( nHeight, EXC_ROW_FLAGDEFHEIGHT ) || (nRawHeight == 0);
137cdf0e10cSrcweir         maHeights[ nScRow ] = nRawHeight;
138cdf0e10cSrcweir         sal_uInt8& rnFlags = maRowFlags[ nScRow ];
139cdf0e10cSrcweir         ::set_flag( rnFlags, EXC_COLROW_USED );
140cdf0e10cSrcweir         if( !bDefHeight && (nRawHeight == 0) )
141cdf0e10cSrcweir             ::set_flag( rnFlags, EXC_COLROW_HIDDEN );
142cdf0e10cSrcweir         ::set_flag( rnFlags, EXC_COLROW_DEFAULT, bDefHeight );
143cdf0e10cSrcweir         if( nScRow > mnLastScRow )
144cdf0e10cSrcweir             mnLastScRow = nScRow;
145cdf0e10cSrcweir     }
146cdf0e10cSrcweir }
147cdf0e10cSrcweir 
SetRowSettings(SCROW nScRow,sal_uInt16 nHeight,sal_uInt16 nFlags)148cdf0e10cSrcweir void XclImpColRowSettings::SetRowSettings( SCROW nScRow, sal_uInt16 nHeight, sal_uInt16 nFlags )
149cdf0e10cSrcweir {
150a786e0ddSEike Rathke     if( (0 <= nScRow) && (nScRow <= mnMaxRow) )
151cdf0e10cSrcweir     {
152cdf0e10cSrcweir         SetHeight( nScRow, nHeight );
153cdf0e10cSrcweir         sal_uInt8& rnFlags = maRowFlags[ nScRow ];
154cdf0e10cSrcweir         if( ::get_flag( nFlags, EXC_ROW_UNSYNCED ) )
155cdf0e10cSrcweir             ::set_flag( rnFlags, EXC_COLROW_MAN );
156cdf0e10cSrcweir         if( ::get_flag( nFlags, EXC_ROW_HIDDEN ) )
157cdf0e10cSrcweir             ::set_flag( rnFlags, EXC_COLROW_HIDDEN );
158cdf0e10cSrcweir     }
159cdf0e10cSrcweir }
160cdf0e10cSrcweir 
SetManualRowHeight(SCROW nScRow)161cdf0e10cSrcweir void XclImpColRowSettings::SetManualRowHeight( SCROW nScRow )
162cdf0e10cSrcweir {
163a786e0ddSEike Rathke     if( (0 <= nScRow) && (nScRow <= mnMaxRow) )
164cdf0e10cSrcweir         ::set_flag( maRowFlags[ nScRow ], EXC_COLROW_MAN );
165cdf0e10cSrcweir }
166cdf0e10cSrcweir 
SetDefaultXF(SCCOL nScCol1,SCCOL nScCol2,sal_uInt16 nXFIndex)167cdf0e10cSrcweir void XclImpColRowSettings::SetDefaultXF( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex )
168cdf0e10cSrcweir {
169cdf0e10cSrcweir     /*  #109555# assign the default column formatting here to ensure that
170cdf0e10cSrcweir         explicit cell formatting is not overwritten. */
171a786e0ddSEike Rathke     DBG_ASSERT( (0 <= nScCol1) && (nScCol1 <= nScCol2) && (nScCol2 <= mnMaxCol), "XclImpColRowSettings::SetDefaultXF - invalid column index" );
172a786e0ddSEike Rathke     nScCol2 = ::std::min( nScCol2, mnMaxCol );
173a786e0ddSEike Rathke     if( (0 <= nScCol1) && (nScCol1 <= nScCol2) )
174a786e0ddSEike Rathke     {
175a786e0ddSEike Rathke         XclImpXFRangeBuffer& rXFRangeBuffer = GetXFRangeBuffer();
176a786e0ddSEike Rathke         for( SCCOL nScCol = nScCol1; nScCol <= nScCol2; ++nScCol )
177a786e0ddSEike Rathke             rXFRangeBuffer.SetColumnDefXF( nScCol, nXFIndex );
178a786e0ddSEike Rathke     }
179cdf0e10cSrcweir }
180cdf0e10cSrcweir 
Convert(SCTAB nScTab)181cdf0e10cSrcweir void XclImpColRowSettings::Convert( SCTAB nScTab )
182cdf0e10cSrcweir {
183cdf0e10cSrcweir     if( !mbDirty )
184cdf0e10cSrcweir         return;
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     ScDocument& rDoc = GetDoc();
187cdf0e10cSrcweir     rDoc.IncSizeRecalcLevel( nScTab );
188cdf0e10cSrcweir 
189cdf0e10cSrcweir     // column widths ----------------------------------------------------------
190cdf0e10cSrcweir 
191a786e0ddSEike Rathke     for( SCCOL nScCol = 0; nScCol <= mnMaxCol; ++nScCol )
192cdf0e10cSrcweir 	{
193cdf0e10cSrcweir         sal_uInt16 nWidth = ::get_flag( maColFlags[ nScCol ], EXC_COLROW_USED ) ? maWidths[ nScCol ] : mnDefWidth;
194cdf0e10cSrcweir         /*  Hidden columns: remember hidden state, but do not set hidden state
195cdf0e10cSrcweir             in document here. Needed for #i11776#, no HIDDEN flags in the
196cdf0e10cSrcweir             document, until filters and outlines are inserted. */
197cdf0e10cSrcweir         if( nWidth == 0 )
198cdf0e10cSrcweir         {
199cdf0e10cSrcweir             ::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN );
200cdf0e10cSrcweir             nWidth = mnDefWidth;
201cdf0e10cSrcweir         }
202*3ce8cab8SWang Lei         rDoc.SetColWidthOnly( nScCol, nScTab, nWidth );
203cdf0e10cSrcweir 	}
204cdf0e10cSrcweir 
205cdf0e10cSrcweir     // row heights ------------------------------------------------------------
206cdf0e10cSrcweir 
207cdf0e10cSrcweir     // #i54252# set default row height
208cdf0e10cSrcweir     rDoc.SetRowHeightOnly( 0, MAXROW, nScTab, mnDefHeight );
209cdf0e10cSrcweir     if( ::get_flag( mnDefRowFlags, EXC_DEFROW_UNSYNCED ) )
210cdf0e10cSrcweir         // first access to row flags, do not ask for old flags
211cdf0e10cSrcweir         rDoc.SetRowFlags( 0, MAXROW, nScTab, CR_MANUALSIZE );
212cdf0e10cSrcweir     bool bDefHideRow = ::get_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN );
213cdf0e10cSrcweir 
214cdf0e10cSrcweir     SCROW nFirstScRow = -1;
215cdf0e10cSrcweir     sal_uInt16 nLastHeight = 0;
216cdf0e10cSrcweir     for( SCROW nScRow = 0; nScRow <= mnLastScRow ; ++nScRow )
217cdf0e10cSrcweir 	{
218cdf0e10cSrcweir         // get height and hidden state from cached data
219cdf0e10cSrcweir         sal_uInt8 nFlags = maRowFlags[ nScRow ];
220cdf0e10cSrcweir         sal_uInt16 nHeight = 0;
221cdf0e10cSrcweir         bool bHideRow = false;
222cdf0e10cSrcweir         if( ::get_flag( nFlags, EXC_COLROW_USED ) )
223cdf0e10cSrcweir 		{
224cdf0e10cSrcweir             if( ::get_flag( nFlags, EXC_COLROW_DEFAULT ) )
225cdf0e10cSrcweir             {
226cdf0e10cSrcweir                 nHeight = mnDefHeight;
227cdf0e10cSrcweir                 bHideRow = bDefHideRow;
228cdf0e10cSrcweir             }
229cdf0e10cSrcweir 			else
230cdf0e10cSrcweir 			{
231cdf0e10cSrcweir                 nHeight = maHeights[ nScRow ];
232cdf0e10cSrcweir                 if( nHeight == 0 )
233cdf0e10cSrcweir                 {
234cdf0e10cSrcweir                     nHeight = mnDefHeight;
235cdf0e10cSrcweir                     bHideRow = true;
236cdf0e10cSrcweir                 }
237cdf0e10cSrcweir 			}
238cdf0e10cSrcweir 
239cdf0e10cSrcweir             if( ::get_flag( nFlags, EXC_COLROW_MAN ) )
240cdf0e10cSrcweir                 rDoc.SetRowFlags( nScRow, nScTab, rDoc.GetRowFlags( nScRow, nScTab ) | CR_MANUALSIZE );
241cdf0e10cSrcweir 		}
242cdf0e10cSrcweir 		else
243cdf0e10cSrcweir         {
244cdf0e10cSrcweir             nHeight = mnDefHeight;
245cdf0e10cSrcweir             bHideRow = bDefHideRow;
246cdf0e10cSrcweir         }
247cdf0e10cSrcweir 
248cdf0e10cSrcweir         /*  Hidden rows: remember hidden state, but do not set hidden state in
249cdf0e10cSrcweir             document here. Needed for #i11776#, no HIDDEN flags in the document,
250cdf0e10cSrcweir             until filters and outlines are inserted. */
251cdf0e10cSrcweir         if( bHideRow )
252cdf0e10cSrcweir             ::set_flag( maRowFlags[ nScRow ], EXC_COLROW_HIDDEN );
253cdf0e10cSrcweir 
254cdf0e10cSrcweir         // set height range
255cdf0e10cSrcweir         if( (nLastHeight != nHeight) || (nScRow == 0) )
256cdf0e10cSrcweir         {
257cdf0e10cSrcweir             DBG_ASSERT( (nScRow == 0) || (nFirstScRow >= 0), "XclImpColRowSettings::Convert - algorithm error" );
258cdf0e10cSrcweir             if( nScRow > 0 )
259cdf0e10cSrcweir                 rDoc.SetRowHeightOnly( nFirstScRow, nScRow - 1, nScTab, nLastHeight );
260cdf0e10cSrcweir 
261cdf0e10cSrcweir             nFirstScRow = nScRow;
262cdf0e10cSrcweir             nLastHeight = nHeight;
263cdf0e10cSrcweir 		}
264cdf0e10cSrcweir 	}
265cdf0e10cSrcweir 
266cdf0e10cSrcweir     // set row height of last portion
267cdf0e10cSrcweir     if( mnLastScRow >= 0 )
268cdf0e10cSrcweir         rDoc.SetRowHeightOnly( nFirstScRow, mnLastScRow, nScTab, nLastHeight );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir     // ------------------------------------------------------------------------
271cdf0e10cSrcweir 
272cdf0e10cSrcweir     mbDirty = false;
273cdf0e10cSrcweir     rDoc.DecSizeRecalcLevel( nScTab );
274cdf0e10cSrcweir }
275cdf0e10cSrcweir 
ConvertHiddenFlags(SCTAB nScTab)276cdf0e10cSrcweir void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab )
277cdf0e10cSrcweir {
278cdf0e10cSrcweir     ScDocument& rDoc = GetDoc();
279cdf0e10cSrcweir     rDoc.IncSizeRecalcLevel( nScTab );      // #i116460# performance with many hidden rows
280cdf0e10cSrcweir 
281cdf0e10cSrcweir     // hide the columns
282a786e0ddSEike Rathke     for( SCCOL nScCol = 0; nScCol <= mnMaxCol; ++nScCol )
283cdf0e10cSrcweir         if( ::get_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN ) )
284a786e0ddSEike Rathke             rDoc.SetColHidden( nScCol, nScCol, nScTab, sal_True );
285a786e0ddSEike Rathke 
286a786e0ddSEike Rathke     // hide remaining columns outside Excel's sheet limits
287a786e0ddSEike Rathke     if( ::get_flag( maColFlags[ mnMaxCol ], EXC_COLROW_HIDDEN ) && (mnMaxCol < MAXCOL) )
288a786e0ddSEike Rathke         rDoc.SetColHidden( mnMaxCol + 1, MAXCOL, nScTab, sal_True );
289cdf0e10cSrcweir 
290cdf0e10cSrcweir     // #i38093# rows hidden by filter need extra flag
291cdf0e10cSrcweir     SCROW nFirstFilterScRow = SCROW_MAX;
292cdf0e10cSrcweir     SCROW nLastFilterScRow = SCROW_MAX;
293cdf0e10cSrcweir     if( GetBiff() == EXC_BIFF8 )
294cdf0e10cSrcweir     {
295cdf0e10cSrcweir         const XclImpAutoFilterData* pFilter = GetFilterManager().GetByTab( nScTab );
296cdf0e10cSrcweir         // #i70026# use IsFiltered() to set the CR_FILTERED flag for active filters only
297cdf0e10cSrcweir         if( pFilter && pFilter->IsActive() && pFilter->IsFiltered() )
298cdf0e10cSrcweir         {
299cdf0e10cSrcweir             nFirstFilterScRow = pFilter->StartRow();
300cdf0e10cSrcweir             nLastFilterScRow = pFilter->EndRow();
301cdf0e10cSrcweir         }
302cdf0e10cSrcweir     }
303cdf0e10cSrcweir 
304cdf0e10cSrcweir     // hide the rows
305cdf0e10cSrcweir     for( SCROW nScRow = 0; nScRow <= mnLastScRow; ++nScRow )
306cdf0e10cSrcweir     {
307cdf0e10cSrcweir         if( ::get_flag( maRowFlags[ nScRow ], EXC_COLROW_HIDDEN ) )
308cdf0e10cSrcweir         {
309cdf0e10cSrcweir             // hide the row
310cdf0e10cSrcweir             rDoc.SetRowHidden(nScRow, nScRow, nScTab, true);        // #i116460# SetRowHidden instead of ShowRow
311cdf0e10cSrcweir             // #i38093# rows hidden by filter need extra flag
312cdf0e10cSrcweir             if( (nFirstFilterScRow <= nScRow) && (nScRow <= nLastFilterScRow) )
313cdf0e10cSrcweir                 rDoc.SetRowFiltered(nScRow, nScRow, nScTab, true);
314cdf0e10cSrcweir         }
315cdf0e10cSrcweir     }
316cdf0e10cSrcweir 
317cdf0e10cSrcweir     // #i47438# if default row format is hidden, hide remaining rows
318cdf0e10cSrcweir     if( ::get_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN ) && (mnLastScRow < MAXROW) )
319cdf0e10cSrcweir         rDoc.ShowRows( mnLastScRow + 1, MAXROW, nScTab, sal_False );
320cdf0e10cSrcweir 
321cdf0e10cSrcweir     rDoc.DecSizeRecalcLevel( nScTab );      // #i116460# performance with many hidden rows
322cdf0e10cSrcweir }
323cdf0e10cSrcweir 
324