Kaydet (Commit) 10851dff authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Split FillAsTable into Binary and Xml variants in the same manner.

And remove BIFF-only records from the Xml variant.

Change-Id: Ia18cc079d9a9249fbbe0c328b14b719fba8d6bbf
üst 44e68c89
......@@ -453,7 +453,7 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
aRecList.AppendRecord( CreateRecord( EXC_ID_SST ) );
}
void ExcTable::FillAsTable( SCTAB nCodeNameIdx )
void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
{
InitializeTable( mnScTab );
......@@ -482,12 +482,6 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx )
mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), it->maPos, it->mpNote, OUString()));
}
if( GetOutput() != EXC_OUTPUT_BINARY )
{
FillAsXmlTable( nCodeNameIdx );
return;
}
// WSBOOL needs data from page settings, create it here, add it later
boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
......@@ -603,17 +597,37 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx )
Add( new ExcEof );
}
void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
void ExcTable::FillAsTableXml()
{
RootData& rR = GetOldRoot();
InitializeTable( mnScTab );
ScDocument& rDoc = GetDoc();
OSL_ENSURE( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" );
OSL_ENSURE( nExcTab <= static_cast<sal_uInt16>(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" );
// create a new OBJ list for this sheet (may be used by notes, autofilter, data validation)
GetObjectManager().StartSheet();
// cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
mxCellTable.reset( new XclExpCellTable( GetRoot() ) );
//export cell notes
std::vector<sc::NoteEntry> aNotes;
rDoc.GetAllNoteEntries(aNotes);
for (std::vector<sc::NoteEntry>::const_iterator it = aNotes.begin(), itEnd = aNotes.end(); it != itEnd; ++it)
{
if (it->maPos.Tab() != mnScTab)
continue;
mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), it->maPos, it->mpNote, OUString()));
}
// WSBOOL needs data from page settings, create it here, add it later
boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
Add( new ExcBof8 );
Color aTabColor = GetRoot().GetDoc().GetTabBgColor(mnScTab);
Add(new XclExpXmlSheetPr(bFitToPages, mnScTab, aTabColor, &GetFilterManager()));
......@@ -630,18 +644,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
// cell table: DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
aRecList.AppendRecord( mxCellTable );
// label ranges
// missing SaveXML
Add( new XclExpLabelranges( GetRoot() ) );
// DFF not needed in MSOOXML export
// GetObjectManager().AddSdrPage();
// //! close Escher group shape and ESCHER_DgContainer
// //! opened by XclExpObjList ctor MSODRAWING
// rR.pObjRecs->EndSheet();
// // all MSODRAWING and OBJ stuff of this sheet goes here
// Add( rR.pObjRecs );
// pivot tables
// not in the worksheet file
aRecList.AppendRecord( GetPivotTableManager().CreatePivotTablesRecord( mnScTab ) );
......@@ -651,11 +653,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
if( mxNoteList != 0 && !mxNoteList->IsEmpty() )
aRecList.AppendNewRecord( new XclExpComments( mnScTab, *mxNoteList ) );
// web queries
// missing SaveXML implementation
Add( new XclExpWebQueryBuffer( GetRoot() ) );
ScDocument& rDoc = GetDoc();
const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab);
if (pTabProtect && pTabProtect->isProtected())
Add( new XclExpSheetProtection(true, mnScTab) );
......@@ -668,10 +665,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
// conditional formats
Add( new XclExpCondFormatBuffer( GetRoot(), xExtLst ) );
if( HasVbaStorage() )
if( nCodeNameIdx < GetExtDocOptions().GetCodeNameCount() )
Add( new XclCodename( GetExtDocOptions().GetCodeName( nCodeNameIdx ) ) );
// data validation (DVAL and list of DV records), generated by the cell table
aRecList.AppendRecord( mxCellTable->CreateRecord( EXC_ID_DVAL ) );
......@@ -687,24 +680,10 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
aRecList.AppendRecord( xPageSett );
// change tracking
if( rR.pUserBViewList )
{
XclExpUserBViewList::const_iterator iter;
for ( iter = rR.pUserBViewList->begin(); iter != rR.pUserBViewList->end(); ++iter )
{
Add( new XclExpUsersViewBegin( (*iter)->GetGUID(), nExcTab ) );
Add( new XclExpUsersViewEnd );
}
}
// all MSODRAWING and OBJ stuff of this sheet goes here
aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) );
aRecList.AppendRecord( xExtLst );
// EOF
Add( new ExcEof );
}
void ExcTable::FillAsEmptyTable( SCTAB nCodeNameIdx )
......@@ -801,7 +780,11 @@ void ExcDocument::ReadDoc( void )
{
ExcTableList::RecordRefType xTab( new ExcTable( GetRoot(), nScTab ) );
maTableList.AppendRecord( xTab );
xTab->FillAsTable( nCodeNameIdx );
if (GetOutput() == EXC_OUTPUT_BINARY)
xTab->FillAsTableBinary(nCodeNameIdx);
else
xTab->FillAsTableXml();
++nCodeNameIdx;
}
}
......
......@@ -59,8 +59,6 @@ private:
// pRec mit new anlegen und vergessen, delete macht ExcTable selber!
void Add( XclExpRecordBase* pRec );
void FillAsXmlTable( SCTAB nCodeNameIdx );
public:
ExcTable( const XclExpRoot& rRoot );
ExcTable( const XclExpRoot& rRoot, SCTAB nScTab );
......@@ -69,7 +67,9 @@ public:
void FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList );
void FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList );
void FillAsTable( SCTAB nCodeNameIdx );
void FillAsTableBinary( SCTAB nCodeNameIdx );
void FillAsTableXml();
void FillAsEmptyTable( SCTAB nCodeNameIdx );
void Write( XclExpStream& );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment