Index: source/filter/inc/imp_op.hxx =================================================================== RCS file: /cvs/sc/sc/source/filter/inc/imp_op.hxx,v retrieving revision 1.17.2.1 diff -u -r1.17.2.1 imp_op.hxx --- source/filter/inc/imp_op.hxx 6 Feb 2003 11:49:49 -0000 1.17.2.1 +++ source/filter/inc/imp_op.hxx 24 Mar 2003 15:23:14 -0000 @@ -96,6 +96,7 @@ #include "excdefs.hxx" #endif + class SfxItemSet; class SvStream; @@ -152,8 +153,22 @@ ~ExcelChartData(); }; +class OutlineDataBuffer +{ +private: + OutlineBuffer* pColOutlineBuff; + OutlineBuffer* pRowOutlineBuff; + ColRowSettings* pColRowBuff; + UINT16 nTab; - +public: + OutlineDataBuffer(RootData& rRootData, UINT16 nTab); + + inline ColRowSettings* GetColRowBuff() const { return pColRowBuff ; } + inline OutlineBuffer* GetColOutline() const { return pColOutlineBuff; } + inline OutlineBuffer* GetRowOutline() const { return pRowOutlineBuff; } + void Apply(ScDocument* pD); +}; class ImportExcel : private XclImpRootData, public ImportTyp, public XclImpRoot { @@ -178,10 +193,13 @@ SfxItemSet* pStyleSheetItemSet; // aktuelle Seitenvorlage - OutlineBuffer aColOutlineBuff; // temporaere Puffer fuer Outline- - OutlineBuffer aRowOutlineBuff; // Angabe + OutlineBuffer* pColOutlineBuff; + OutlineBuffer* pRowOutlineBuff; ColRowSettings* pColRowBuff; // Col/Row-Einstellungen 1 Tabelle + typedef ScfDelList< OutlineDataBuffer > OutlineListBuffer; + OutlineListBuffer* pOutlineListBuffer; + UINT16 nIxfeIndex; // merkt sich Angabe im IXFE-Record UINT16 nLastXF; // letzter XF in Formula-Record UINT16 nBdshtTab; // Counter fuer Boundsheet @@ -341,7 +359,6 @@ BYTE nFlag, BOOL bShrFmla ); // -> excform.cxx - void ResetBof( void ); void EndSheet( void ); void NeueTabelle( void ); const ScTokenArray* ErrorToFormula( BYTE bErrOrVal, BYTE nError, Index: source/filter/excel/read.cxx =================================================================== RCS file: /cvs/sc/sc/source/filter/excel/read.cxx,v retrieving revision 1.33.2.1.42.1 diff -u -r1.33.2.1.42.1 read.cxx --- source/filter/excel/read.cxx 19 Mar 2003 13:56:59 -0000 1.33.2.1.42.1 +++ source/filter/excel/read.cxx 24 Mar 2003 15:23:29 -0000 @@ -177,7 +177,6 @@ if( pExcRoot->eDateiTyp == Biff2 ) { eAkt = Z_Biff2; - ResetBof(); NeueTabelle(); } break; @@ -186,7 +185,6 @@ if( pExcRoot->eDateiTyp == Biff3 ) { eAkt = Z_Biff3; - ResetBof(); NeueTabelle(); } break; @@ -195,7 +193,6 @@ if( pExcRoot->eDateiTyp == Biff4 ) { eAkt = Z_Biff4; - ResetBof(); NeueTabelle(); } else if( pExcRoot->eDateiTyp == Biff4W ) @@ -549,7 +546,6 @@ if( pExcRoot->eDateiTyp == Biff4 ) { eAkt = Z_Biff4I; - ResetBof(); } else { @@ -822,7 +818,6 @@ { case Biff5: eAkt = Z_Biff5Pre; // Shrfmla Prefetch, Row-Prefetch - pColRowBuff->Reset(); nBofLevel = 0; aIn.StoreGlobalPosition(); // und Position merken @@ -862,7 +857,6 @@ case 0x0A: // EOF [ 2345] eAkt = Z_Biff5I; aIn.SeekGlobalPosition(); // und zurueck an alte Position - pColRowBuff->Apply( GetScTab() ); break; case 0x12: Protect(); break; // SHEET PROTECTION case 0x1A: Verticalpagebreaks(); break; @@ -1367,9 +1361,7 @@ case Biff8: case Biff8M4: eAkt = Z_Biff8Pre; // Shrfmla Prefetch, Row-Prefetch - pColRowBuff->Reset(); nBofLevel = 0; - aIn.StoreGlobalPosition(); break; case Biff8C: @@ -1409,7 +1401,6 @@ case 0x0A: // EOF [ 2345 ] eAkt = Z_Biff8I; aIn.SeekGlobalPosition(); // und zurueck an alte Position - pColRowBuff->Apply( GetScTab() ); break; case 0x12: Protect(); break; case 0x1A: Verticalpagebreaks(); break; Index: source/filter/excel/impop.cxx =================================================================== RCS file: /cvs/sc/sc/source/filter/excel/impop.cxx,v retrieving revision 1.44.2.3.26.1 diff -u -r1.44.2.3.26.1 impop.cxx --- source/filter/excel/impop.cxx 19 Mar 2003 13:56:58 -0000 1.44.2.3.26.1 +++ source/filter/excel/impop.cxx 24 Mar 2003 15:23:44 -0000 @@ -186,9 +186,7 @@ XclImpRoot( static_cast< XclImpRootData& >( *this ) ), maStrm( rSvStrm, *this ), aIn( maStrm ), - aColOutlineBuff( MAXCOL + 1 ), - aRowOutlineBuff( MAXROW + 1 ), - bFitToPage( sal_False ), + bFitToPage( sal_False ), bHasHeader( sal_False ), bHasFooter( sal_False ) { @@ -224,10 +222,8 @@ pExtNameBuff = new NameBuffer( pExcRoot ); //#94039# prevent empty rootdata pExtNameBuff->SetBase( 1 ); - pColRowBuff = new ColRowSettings( *pExcRoot ); //#94039# prevent empty rootdata - pColRowBuff->SetDefWidth( STD_COL_WIDTH ); - pColRowBuff->SetDefHeight( ( UINT16 ) STD_ROW_HEIGHT ); - + pOutlineListBuffer = new OutlineListBuffer( ); + // ab Biff8 pExcRoot->nCondRangeCnt = ( UINT32 ) -1; // GetCondFormStyleName() starts with increment! @@ -270,7 +266,8 @@ GetDoc().SetSrcCharSet( GetCharSet() ); delete pExtNameBuff; - delete pColRowBuff; + + delete pOutlineListBuffer; delete pFormConv; } @@ -485,7 +482,7 @@ aIn.Ignore( 2 ); // reserved aIn >> nGrbit; - aRowOutlineBuff.SetLevel( nRow, EXC_ROW_GETLEVEL( nGrbit ), + pRowOutlineBuff->SetLevel( nRow, EXC_ROW_GETLEVEL( nGrbit ), TRUEBOOL( nGrbit & EXC_ROW_COLLAPSED ), TRUEBOOL( nGrbit & EXC_ROW_ZEROHEIGHT ) ); pColRowBuff->SetRowSettings( nRow, nRowHeight, nGrbit ); @@ -1039,7 +1036,7 @@ if( nColLast > MAXCOL ) nColLast = MAXCOL; - aColOutlineBuff.SetLevelRange( nColFirst, nColLast, EXC_COL_GETLEVEL( nOpt ), + pColOutlineBuff->SetLevelRange( nColFirst, nColLast, EXC_COL_GETLEVEL( nOpt ), TRUEBOOL( nOpt & EXC_COL_COLLAPSED ), TRUEBOOL( nOpt & EXC_COL_HIDDEN ) ); if( nOpt & EXC_COL_HIDDEN ) // Cols hidden? @@ -1078,8 +1075,8 @@ UINT16 nFlags; aIn >> nFlags; - aRowOutlineBuff.SetButtonMode( HasFlag( nFlags, EXC_WSBOOL_ROWBELOW ) ); - aColOutlineBuff.SetButtonMode( HasFlag( nFlags, EXC_WSBOOL_COLBELOW ) ); + pRowOutlineBuff->SetButtonMode( HasFlag( nFlags, EXC_WSBOOL_ROWBELOW ) ); + pColOutlineBuff->SetButtonMode( HasFlag( nFlags, EXC_WSBOOL_COLBELOW ) ); bFitToPage = HasFlag( nFlags, EXC_WSBOOL_FITTOPAGE ); } @@ -1631,7 +1628,7 @@ aIn >> nGrbit >> nXF; - aRowOutlineBuff.SetLevel( nRow, EXC_ROW_GETLEVEL( nGrbit ), + pRowOutlineBuff->SetLevel( nRow, EXC_ROW_GETLEVEL( nGrbit ), TRUEBOOL( nGrbit & EXC_ROW_COLLAPSED ), TRUEBOOL( nGrbit & EXC_ROW_ZEROHEIGHT ) ); pColRowBuff->SetRowSettings( nRow, nRowHeight, nGrbit ); @@ -1959,25 +1956,8 @@ pExcRoot->eDateiTyp = eDatei; } - -void ImportExcel::ResetBof( void ) -{ // setzt alle Einstellungen fuer neuen Tabellenbeginn zurueck - pColRowBuff->Reset(); -} - - void ImportExcel::EndSheet( void ) -{ // mach 'Gemarmel' am Ende eines Sheets - aColOutlineBuff.SetOutlineArray( pD->GetOutlineTable( GetScTab(), TRUE )->GetColArray() ); - aColOutlineBuff.MakeScOutline(); - aColOutlineBuff.Reset(); - - aRowOutlineBuff.SetOutlineArray( pD->GetOutlineTable( GetScTab(), TRUE )->GetRowArray() ); - aRowOutlineBuff.MakeScOutline(); - aRowOutlineBuff.Reset(); - - pColRowBuff->Apply( GetScTab() ); - +{ GetXFIndexBuffer().Apply(); pExcRoot->pExtSheetBuff->Reset(); @@ -2006,6 +1986,12 @@ bFitToPage = sal_False; bHasHeader = sal_False; bHasFooter = sal_False; + + pOutlineListBuffer->Append(new OutlineDataBuffer(*pExcRoot, nTab )); //#94039# prevent empty rootdata + + pColRowBuff = pOutlineListBuffer->Last()->GetColRowBuff(); + pColOutlineBuff = pOutlineListBuffer->Last()->GetColOutline(); + pRowOutlineBuff = pOutlineListBuffer->Last()->GetRowOutline(); } @@ -2168,6 +2154,12 @@ void ImportExcel::PostDocLoad( void ) { + + // Apply any Outlines for each sheet + for(OutlineDataBuffer* pBuffer = pOutlineListBuffer->First(); pBuffer; pBuffer = pOutlineListBuffer->Next() ) + pBuffer->Apply(pD); + + // visible area if embedded OLE ScModelObj* pDocObj = GetDocModelObj(); if( pDocObj ) @@ -2341,3 +2333,24 @@ } } +OutlineDataBuffer::OutlineDataBuffer(RootData& rRootData, UINT16 nTabNo) : + nTab (nTabNo) +{ + pColOutlineBuff = new OutlineBuffer (MAXCOL + 1); + pRowOutlineBuff = new OutlineBuffer (MAXROW + 1); + pColRowBuff = new ColRowSettings( rRootData ); + + pColRowBuff->SetDefWidth( STD_COL_WIDTH ); + pColRowBuff->SetDefHeight( ( UINT16 ) STD_ROW_HEIGHT ); +} + +void OutlineDataBuffer::Apply(ScDocument* pD) +{ + pColOutlineBuff->SetOutlineArray( pD->GetOutlineTable( nTab, TRUE )->GetColArray() ); + pColOutlineBuff->MakeScOutline(); + + pRowOutlineBuff->SetOutlineArray( pD->GetOutlineTable( nTab, TRUE )->GetRowArray() ); + pRowOutlineBuff->MakeScOutline(); + + pColRowBuff->Apply(nTab); +}