diff options
author | Daniel Rentz <dr@openoffice.org> | 2001-06-05 13:27:07 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2001-06-05 13:27:07 +0000 |
commit | 57b07bafa97459cd5c5a73101e259235c84843f6 (patch) | |
tree | 8101d4fd82409251089f594f93a1b5aff7423880 | |
parent | 5ab392b8c426a34cd0a679b0400b171592d77128 (diff) |
#87800# blank cells export
-rw-r--r-- | sc/source/filter/excel/excdoc.cxx | 22 | ||||
-rw-r--r-- | sc/source/filter/excel/excrecds.cxx | 93 | ||||
-rw-r--r-- | sc/source/filter/inc/excdoc.hxx | 8 | ||||
-rw-r--r-- | sc/source/filter/inc/excrecds.hxx | 9 |
4 files changed, 65 insertions, 67 deletions
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index d0404ce84c13..b8eaa4893394 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: excdoc.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: gt $ $Date: 2001-05-28 13:44:50 $ + * last change: $Author: dr $ $Date: 2001-06-05 14:23:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -176,7 +176,7 @@ DefRowXFs::~DefRowXFs() //void DefRowXFs::ChangeXF( ExcRow& rRow ) -void DefRowXFs::ChangeXF( UINT16 nRowNum, UINT16& rXF ) +BOOL DefRowXFs::ChangeXF( UINT16 nRowNum, UINT16& rXF ) { UINT32 nCnt; UINT16 nR, nXF; @@ -192,9 +192,10 @@ void DefRowXFs::ChangeXF( UINT16 nRowNum, UINT16& rXF ) nLastList = n; nLastRow = nR; - return; + return TRUE; } } + return FALSE; } @@ -358,8 +359,8 @@ void ExcTable::FillAsHeader( ExcRecordListRefs& rBSRecList ) ExcNameList* pNameL = rR.pNameList = new ExcNameList; ExcPalette2* pPalette2 = rR.pPalette2 = new ExcPalette2( *rR.pColor ); - UsedFontList* pFontRecs = rR.pFontRecs = new UsedFontList( rR ) ; - UsedFormList* pFormRecs = rR.pFormRecs = new UsedFormList; + UsedFontList* pFontRecs = rR.pFontRecs = new UsedFontList( rR ); + UsedFormList* pFormRecs = rR.pFormRecs = new UsedFormList( rR ); UsedAttrList* pXFRecs = rR.pXFRecs = new UsedAttrList( &rR, *pPalette2, *pFontRecs, *pFormRecs ); XclSstList* pSstRecs = NULL; @@ -718,8 +719,8 @@ void ExcTable::FillAsTable( void ) rR.pCellMerging = new XclExpCellMerging; - ScUsedAreaIterator aIterator( &rDoc, nScTab, 0, 0, nLastCol, nLastRow ); -// ScUsedAreaIterator aIterator( &rDoc, nScTab, 0, 0, MAXCOL, MAXROW ); +// ScUsedAreaIterator aIterator( &rDoc, nScTab, 0, 0, nLastCol, nLastRow ); + ScUsedAreaIterator aIterator( &rDoc, nScTab, 0, 0, MAXCOL, nLastRow ); const ScBaseCell* pAktScCell; const ScPatternAttr* pPatt; ExcBlankMulblank* pLastBlank = NULL; @@ -1290,10 +1291,11 @@ void ExcTable::NullTab( const String* pCodename ) } -void ExcTable::ModifyToDefaultRowXF( UINT16 nRowNum, UINT16& rXF ) +BOOL ExcTable::ModifyToDefaultRowXF( UINT16 nRowNum, UINT16& rXF ) { if( pDefRowXFs ) - pDefRowXFs->ChangeXF( nRowNum, rXF ); + return pDefRowXFs->ChangeXF( nRowNum, rXF ); + return FALSE; } diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 7bfe712cff46..83a630d36a68 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -2,9 +2,9 @@ * * $RCSfile: excrecds.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: gt $ $Date: 2001-05-30 10:19:38 $ + * last change: $Author: dr $ $Date: 2001-06-05 14:23:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1824,41 +1824,41 @@ void ExcBlankMulblank::AddEntries( ScAddress aCurrPos( rPos ); UINT16 nCellXF = rRootData.pXFRecs->Find( pAttr ); - BOOL bOrg = TRUE; - while( nCount ) + if( nCount > MAXCOL ) + { // set format at row + rExcTab.SetDefRowXF( nCellXF, rPos.Row() ); + + bDummy = TRUE; + } + else { - UINT16 nMergeXF, nMergeCount; - if( rRootData.pCellMerging->FindMergeBaseXF( aCurrPos, nMergeXF, nMergeCount ) ) - { - nMergeCount = Min( nMergeCount, nCount ); - Append( nMergeXF, nMergeCount ); - nCount -= nMergeCount; - aCurrPos.IncCol( nMergeCount ); - bOrg = FALSE; - } - else + while( nCount ) { - UINT16 nMergeCol; - UINT16 nColCount = nCount; - - if( rRootData.pCellMerging->FindNextMerge( aCurrPos, nMergeCol ) ) - nColCount = Min( (UINT16)(nMergeCol - aCurrPos.Col()), nCount ); - - if( nColCount ) + UINT16 nMergeXF, nMergeCount; + if( rRootData.pCellMerging->FindMergeBaseXF( aCurrPos, nMergeXF, nMergeCount ) ) { - Append( nCellXF, nColCount ); - nCount -= nColCount; - aCurrPos.IncCol( nColCount ); + nMergeCount = Min( nMergeCount, nCount ); + Append( nMergeXF, nMergeCount ); + nCount -= nMergeCount; + aCurrPos.IncCol( nMergeCount ); } - } - } + else + { + UINT16 nMergeCol; + UINT16 nColCount = nCount; - if( bOrg ) - { // set format at row - rExcTab.SetDefRowXF( nCellXF, rPos.Row() ); + if( rRootData.pCellMerging->FindNextMerge( aCurrPos, nMergeCol ) ) + nColCount = Min( (UINT16)(nMergeCol - aCurrPos.Col()), nCount ); - bDummy = TRUE; + if( nColCount ) + { + Append( nCellXF, nColCount ); + nCount -= nColCount; + aCurrPos.IncCol( nColCount ); + } + } + } } } @@ -2338,9 +2338,10 @@ void ExcRow::SetHeight( UINT16 nNewHeight, BOOL bUser ) void ExcRow::SaveCont( XclExpStream& rStrm ) { - rExcTab.ModifyToDefaultRowXF( nNum, nXF ); - nOptions |= EXC_ROW_FLAGCOMMON; + if( rExcTab.ModifyToDefaultRowXF( nNum, nXF ) ) + nOptions |= EXC_ROW_GHOSTDIRTY; + rStrm << nNum << nFirstCol << (UINT16)(nLastCol + 1) << nHeight << (UINT32)0 << nOptions << nXF; } @@ -3210,7 +3211,7 @@ void ExcPalette2::GetMixedColors( UINT32 nForeSer, UINT32 nBackSer, } rForeInd = (UINT16)(nIndex1 + ColorBuffer::GetIndCorrect()); rBackInd = (UINT16)(nIndex2 + ColorBuffer::GetIndCorrect()); - if( nMinDist < (nFirstDist >> 1) ) + if( nMinDist < nFirstDist ) switch( nMinIndex ) { case 1: rPatt = 3; break; @@ -3484,22 +3485,16 @@ UsedFormList::~UsedFormList() } -UINT16 UsedFormList::Add( ExcFormat* pFormat ) +//UINT16 UsedFormList::Add( ExcFormat* pFormat ) +UINT16 UsedFormList::Add( UINT32 nNewScIx ) { // Doubletten suchen - UINT32 nSearch = pFormat->nScIndex; - UINT16 nC = nBaseIndex; - for( ExcFormat* pCurr = _First(); pCurr; pCurr = _Next() ) - { - if( pCurr->nScIndex == nSearch ) - { - delete pFormat; + for( ExcFormat* pCurr = _First(); pCurr; pCurr = _Next(), nC++ ) + if( pCurr->nScIndex == nNewScIx ) return nC; - } - nC++; - } + ExcFormat* pFormat = new ExcFormat( pExcRoot, nNewScIx ); pFormat->nIndex = nC; Insert( pFormat, LIST_APPEND ); return nC; @@ -3565,9 +3560,7 @@ void UsedAttrList::AddNewXF( const ScPatternAttr* pAttr, const BOOL bStyle, cons nFontIndex = 0; } - ExcFormat* pFormat = new ExcFormat( pExcRoot, nScForm ); - - UINT16 nFormatIndex = rFrmLst.Add( pFormat ); + UINT16 nFormatIndex = rFrmLst.Add( nScForm ); if ( pExcRoot->eDateiTyp < Biff8 ) pData->pXfRec = new ExcXf( nFontIndex, nFormatIndex, pAttr, pData->bLineBreak, bStyle ); @@ -4554,8 +4547,10 @@ void ExcArray::SetColRow( UINT8 nCol, UINT16 nRow, UINT32 nId ) void ExcArray::SaveCont( XclExpStream& rStrm ) { - rStrm << nFirstRow << nLastRow << nFirstCol << nLastCol - << ( UINT8 ) 0 << nID << ( UINT8 ) 0xFE << nFormLen; +// rStrm << nFirstRow << nLastRow << nFirstCol << nLastCol +// << ( UINT8 ) 0 << nID << ( UINT8 ) 0xFE << nFormLen; + rStrm << nFirstRow << nLastRow << nFirstCol << nLastCol << ( UINT16 ) 0 << ( UINT32 ) 0 << nFormLen; + // grbit chn if( pData ) rStrm.Write( pData, nFormLen ); diff --git a/sc/source/filter/inc/excdoc.hxx b/sc/source/filter/inc/excdoc.hxx index db3300aa2424..0f336a72ae42 100644 --- a/sc/source/filter/inc/excdoc.hxx +++ b/sc/source/filter/inc/excdoc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: excdoc.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: dr $ $Date: 2001-04-19 09:57:15 $ + * last change: $Author: dr $ $Date: 2001-06-05 14:27:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -157,7 +157,7 @@ public: inline void Add( UINT16 nRowNum, UINT16 nXF ); - void ChangeXF( UINT16 nRowNum, UINT16& rXF ); + BOOL ChangeXF( UINT16 nRowNum, UINT16& rXF ); }; // structure: 2 byte row number, 2 byte XF -> 4 byte @@ -211,7 +211,7 @@ public: void FillAsTable( void ); void SetDefRowXF( UINT16 nXF, UINT16 nRowNum ); - void ModifyToDefaultRowXF( UINT16 nRowNum, UINT16& rXF ); + BOOL ModifyToDefaultRowXF( UINT16 nRowNum, UINT16& rXF ); void Write( XclExpStream& ); }; diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index 63c169e11eec..de42d0f58cb4 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -2,9 +2,9 @@ * * $RCSfile: excrecds.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: dr $ $Date: 2001-05-10 17:26:23 $ + * last change: $Author: dr $ $Date: 2001-06-05 14:27:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1447,15 +1447,16 @@ public: //-------------------------------------------------------- class UsedFormList - // a list of FORMAT records -class UsedFormList : public UsedList +class UsedFormList : public UsedList, public ExcRoot { private: inline ExcFormat* _First() { return (ExcFormat*) List::First(); } inline ExcFormat* _Next() { return (ExcFormat*) List::Next(); } public: + inline UsedFormList( RootData& rRootData ) : ExcRoot( &rRootData ) {} virtual ~UsedFormList(); - UINT16 Add( ExcFormat* pFormat ); // add and forget + UINT16 Add( UINT32 nNewScIx ); }; |