Clean oox::xls::SheetViewSettings

This commit is contained in:
Julien Nabet 2012-04-08 13:33:05 +02:00
parent 1ea28ebcf0
commit ade4aac3dc
3 changed files with 0 additions and 122 deletions

View file

@ -127,15 +127,6 @@ public:
/** Imports the CHARTSHEETVIEW record containing view settings of a chart sheet. */
void importChartSheetView( SequenceInputStream& rStrm );
/** Imports the WINDOW2 record containing sheet view settings. */
void importWindow2( BiffInputStream& rStrm );
/** Imports the PANE record containing sheet pane settings. */
void importPane( BiffInputStream& rStrm );
/** Imports the SCL record containing sheet zoom settings. */
void importScl( BiffInputStream& rStrm );
/** Imports the SELECTION record containing selection settings for a pane. */
void importSelection( BiffInputStream& rStrm );
/** Converts all imported sheet view settings. */
void finalizeImport();

View file

@ -364,115 +364,6 @@ void SheetViewSettings::importChartSheetView( SequenceInputStream& rStrm )
rModel.mbZoomToFit = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_ZOOMTOFIT );
}
void SheetViewSettings::importWindow2( BiffInputStream& rStrm )
{
OSL_ENSURE( maSheetViews.empty(), "SheetViewSettings::importWindow2 - multiple WINDOW2 records" );
SheetViewModel& rModel = *createSheetView();
if( getBiff() == BIFF2 )
{
rModel.mbShowFormulas = rStrm.readuInt8() != 0;
rModel.mbShowGrid = rStrm.readuInt8() != 0;
rModel.mbShowHeadings = rStrm.readuInt8() != 0;
rModel.mnPaneState = (rStrm.readuInt8() == 0) ? XML_split : XML_frozen;
rModel.mbShowZeros = rStrm.readuInt8() != 0;
BinAddress aFirstPos;
rStrm >> aFirstPos;
rModel.maFirstPos = getAddressConverter().createValidCellAddress( aFirstPos, getSheetIndex(), false );
rModel.mbDefGridColor = rStrm.readuInt8() != 0;
rModel.maGridColor.importColorRgb( rStrm );
}
else
{
sal_uInt16 nFlags;
BinAddress aFirstPos;
rStrm >> nFlags >> aFirstPos;
rModel.maFirstPos = getAddressConverter().createValidCellAddress( aFirstPos, getSheetIndex(), false );
rModel.mnPaneState = getFlagValue( nFlags, BIFF_WINDOW2_FROZEN, getFlagValue( nFlags, BIFF_WINDOW2_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
rModel.mbSelected = getFlag( nFlags, BIFF_WINDOW2_SELECTED );
rModel.mbRightToLeft = getFlag( nFlags, BIFF_WINDOW2_RIGHTTOLEFT );
rModel.mbDefGridColor = getFlag( nFlags, BIFF_WINDOW2_DEFGRIDCOLOR );
rModel.mbShowFormulas = getFlag( nFlags, BIFF_WINDOW2_SHOWFORMULAS );
rModel.mbShowGrid = getFlag( nFlags, BIFF_WINDOW2_SHOWGRID );
rModel.mbShowHeadings = getFlag( nFlags, BIFF_WINDOW2_SHOWHEADINGS );
rModel.mbShowZeros = getFlag( nFlags, BIFF_WINDOW2_SHOWZEROS );
rModel.mbShowOutline = getFlag( nFlags, BIFF_WINDOW2_SHOWOUTLINE );
if( getBiff() == BIFF8 )
{
rModel.mnViewType = getFlagValue( nFlags, BIFF_WINDOW2_PAGEBREAKMODE, XML_pageBreakPreview, XML_normal );
rModel.maGridColor.importColorId( rStrm );
// zoom data not included in chart sheets
if( (getSheetType() != SHEETTYPE_CHARTSHEET) && (rStrm.getRemaining() >= 6) )
{
rStrm.skip( 2 );
sal_uInt16 nPageZoom, nNormalZoom;
rStrm >> nPageZoom >> nNormalZoom;
rModel.mnSheetLayoutZoom = nPageZoom;
rModel.mnNormalZoom = nNormalZoom;
}
}
else
{
rModel.maGridColor.importColorRgb( rStrm );
}
}
}
void SheetViewSettings::importPane( BiffInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing leading WINDOW2 record" );
if( !maSheetViews.empty() )
{
sal_uInt8 nActivePaneId;
sal_uInt16 nSplitX, nSplitY;
BinAddress aSecondPos;
rStrm >> nSplitX >> nSplitY >> aSecondPos >> nActivePaneId;
SheetViewModel& rModel = *maSheetViews.back();
rModel.mfSplitX = nSplitX;
rModel.mfSplitY = nSplitY;
rModel.maSecondPos = getAddressConverter().createValidCellAddress( aSecondPos, getSheetIndex(), false );
rModel.mnActivePaneId = lclGetOoxPaneId( nActivePaneId, XML_topLeft );
}
}
void SheetViewSettings::importScl( BiffInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importScl - missing leading WINDOW2 record" );
if( !maSheetViews.empty() )
{
sal_uInt16 nNum, nDenom;
rStrm >> nNum >> nDenom;
OSL_ENSURE( nDenom > 0, "SheetViewSettings::importScl - invalid denominator" );
if( nDenom > 0 )
maSheetViews.back()->mnCurrentZoom = getLimitedValue< sal_Int32, sal_uInt16 >( (nNum * 100) / nDenom, 10, 400 );
}
}
void SheetViewSettings::importSelection( BiffInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing leading WINDOW2 record" );
if( !maSheetViews.empty() )
{
// pane this selection belongs to
sal_uInt8 nPaneId = rStrm.readuInt8();
PaneSelectionModel& rPaneSel = maSheetViews.back()->createPaneSelection( lclGetOoxPaneId( nPaneId, -1 ) );
// cursor position
BinAddress aActiveCell;
sal_uInt16 nActiveCellId;
rStrm >> aActiveCell >> nActiveCellId;
rPaneSel.maActiveCell = getAddressConverter().createValidCellAddress( aActiveCell, getSheetIndex(), false );
rPaneSel.mnActiveCellId = nActiveCellId;
// selection
rPaneSel.maSelection.clear();
BinRangeList aSelection;
aSelection.read( rStrm, false );
getAddressConverter().convertToCellRangeList( rPaneSel.maSelection, aSelection, getSheetIndex(), false );
}
}
void SheetViewSettings::finalizeImport()
{
// force creation of sheet view model to get the Excel defaults

View file

@ -815,10 +815,6 @@ oox::xls::Font::importFont(oox::xls::BiffInputStream&)
oox::xls::NumberFormatsBuffer::importFormat(oox::xls::BiffInputStream&)
oox::xls::PivotCache::importPCDSource(oox::xls::BiffInputStream&)
oox::xls::SheetScenarios::importScenarios(oox::xls::BiffInputStream&)
oox::xls::SheetViewSettings::importPane(oox::xls::BiffInputStream&)
oox::xls::SheetViewSettings::importScl(oox::xls::BiffInputStream&)
oox::xls::SheetViewSettings::importSelection(oox::xls::BiffInputStream&)
oox::xls::SheetViewSettings::importWindow2(oox::xls::BiffInputStream&)
oox::xls::WorkbookGlobals::createBuffersPerSheet(short)
oox::xls::WorkbookGlobals::setCodePage(unsigned short)
oox::xls::WorkbookGlobals::setIsWorkbookFile()