summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-30 09:24:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-03-30 14:07:20 +0100
commit45e4f9e99b75ef8a125228bc42df7fb98af9d7bc (patch)
tree6a5b19bbe4316d56b14682c227c891f05db13b4c /sc/source/filter/oox
parent1889728897e16800d58773a302eb5232a6fada76 (diff)
callcatcher: regenerate unused code list
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r--sc/source/filter/oox/biffcodec.cxx11
-rw-r--r--sc/source/filter/oox/biffdetector.cxx110
-rw-r--r--sc/source/filter/oox/chartsheetfragment.cxx109
-rw-r--r--sc/source/filter/oox/excelfilter.cxx3
-rw-r--r--sc/source/filter/oox/excelhandlers.cxx78
-rw-r--r--sc/source/filter/oox/externallinkfragment.cxx27
-rw-r--r--sc/source/filter/oox/pivotcachebuffer.cxx22
-rw-r--r--sc/source/filter/oox/sharedstringsbuffer.cxx17
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx90
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx96
-rw-r--r--sc/source/filter/oox/viewsettings.cxx44
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx15
-rw-r--r--sc/source/filter/oox/workbooksettings.cxx48
-rw-r--r--sc/source/filter/oox/worksheetbuffer.cxx32
-rw-r--r--sc/source/filter/oox/worksheetfragment.cxx462
15 files changed, 3 insertions, 1161 deletions
diff --git a/sc/source/filter/oox/biffcodec.cxx b/sc/source/filter/oox/biffcodec.cxx
index 5d791cdc911f..a5808e5056c0 100644
--- a/sc/source/filter/oox/biffcodec.cxx
+++ b/sc/source/filter/oox/biffcodec.cxx
@@ -357,17 +357,6 @@ BiffCodecHelper::BiffCodecHelper( const WorkbookHelper& rHelper ) :
return xDecoder;
}
-bool BiffCodecHelper::importFilePass( BiffInputStream& rStrm )
-{
- OSL_ENSURE( !mxDecoder, "BiffCodecHelper::importFilePass - multiple FILEPASS records" );
- mxDecoder = implReadFilePass( rStrm, getBiff() );
- // request and verify a password (decoder implements IDocPasswordVerifier)
- if( mxDecoder.get() )
- getBaseFilter().requestEncryptionData( *mxDecoder );
- // correct password is indicated by isValid() function of decoder
- return mxDecoder.get() && mxDecoder->isValid();
-}
-
void BiffCodecHelper::cloneDecoder( BiffInputStream& rStrm )
{
if( mxDecoder.get() )
diff --git a/sc/source/filter/oox/biffdetector.cxx b/sc/source/filter/oox/biffdetector.cxx
deleted file mode 100644
index 14ebbcfc586b..000000000000
--- a/sc/source/filter/oox/biffdetector.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "biffdetector.hxx"
-
-#include <algorithm>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <comphelper/mediadescriptor.hxx>
-#include <rtl/strbuf.hxx>
-#include "oox/helper/binaryinputstream.hxx"
-#include "oox/ole/olestorage.hxx"
-
-namespace oox {
-namespace xls {
-namespace BiffDetector {
-
-// ============================================================================
-
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-
-using ::comphelper::MediaDescriptor;
-using ::rtl::OStringBuffer;
-using ::rtl::OUString;
-
-BiffType detectStreamBiffVersion( BinaryInputStream& rInStream )
-{
- BiffType eBiff = BIFF_UNKNOWN;
- if( !rInStream.isEof() && rInStream.isSeekable() && (rInStream.size() > 4) )
- {
- sal_Int64 nOldPos = rInStream.tell();
- rInStream.seekToStart();
- sal_uInt16 nBofId, nBofSize;
- rInStream >> nBofId >> nBofSize;
-
- if( (4 <= nBofSize) && (nBofSize <= 16) && (rInStream.tell() + nBofSize <= rInStream.size()) )
- {
- switch( nBofId )
- {
- case BIFF2_ID_BOF:
- eBiff = BIFF2;
- break;
- case BIFF3_ID_BOF:
- eBiff = BIFF3;
- break;
- case BIFF4_ID_BOF:
- eBiff = BIFF4;
- break;
- case BIFF5_ID_BOF:
- {
- if( 6 <= nBofSize )
- {
- sal_uInt16 nVersion;
- rInStream >> nVersion;
- // #i23425# #i44031# #i62752# there are some *really* broken documents out there...
- switch( nVersion & 0xFF00 )
- {
- case 0: eBiff = BIFF5; break; // #i44031# #i62752#
- case BIFF_BOF_BIFF2: eBiff = BIFF2; break;
- case BIFF_BOF_BIFF3: eBiff = BIFF3; break;
- case BIFF_BOF_BIFF4: eBiff = BIFF4; break;
- case BIFF_BOF_BIFF5: eBiff = BIFF5; break;
- case BIFF_BOF_BIFF8: eBiff = BIFF8; break;
- default: OSL_FAIL( OStringBuffer( "lclDetectStreamBiffVersion - unknown BIFF version: 0x" ).
- append( static_cast< sal_Int32 >( nVersion ), 16 ).getStr() );
- }
- }
- }
- break;
- // else do nothing, no BIFF stream
- }
- }
- rInStream.seek( nOldPos );
- }
- return eBiff;
-}
-
-} // BiffDetector
-} // namespace xls
-} // namespace oox
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/oox/chartsheetfragment.cxx b/sc/source/filter/oox/chartsheetfragment.cxx
index e6e0f0b427ac..9fae58a34afb 100644
--- a/sc/source/filter/oox/chartsheetfragment.cxx
+++ b/sc/source/filter/oox/chartsheetfragment.cxx
@@ -177,115 +177,6 @@ void ChartsheetFragment::importDrawing( SequenceInputStream& rStrm )
setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
-// ============================================================================
-
-BiffChartsheetFragment::BiffChartsheetFragment( const WorksheetHelper& rHelper, const BiffWorkbookFragmentBase& rParent ) :
- BiffWorksheetFragmentBase( rHelper, rParent )
-{
-}
-
-bool BiffChartsheetFragment::importFragment()
-{
- // initial processing in base class WorksheetHelper
- initializeWorksheetImport();
-
- WorksheetSettings& rWorksheetSett = getWorksheetSettings();
- SheetViewSettings& rSheetViewSett = getSheetViewSettings();
- PageSettings& rPageSett = getPageSettings();
-
- // process all record in this sheet fragment
- BiffInputStream& rStrm = getInputStream();
- while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
- {
- if( BiffHelper::isBofRecord( rStrm ) )
- {
- // skip unknown embedded fragments (BOF/EOF blocks)
- skipFragment();
- }
- else
- {
- sal_uInt16 nRecId = rStrm.getRecId();
- switch( nRecId )
- {
- // records in all BIFF versions
- case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( rStrm ); break;
- case BIFF_ID_CHBEGIN: BiffHelper::skipRecordBlock( rStrm, BIFF_ID_CHEND ); break;
- case BIFF_ID_FOOTER: rPageSett.importFooter( rStrm ); break;
- case BIFF_ID_HEADER: rPageSett.importHeader( rStrm ); break;
- case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( rStrm ); break;
- case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( rStrm ); break;
- case BIFF_ID_PROTECT: rWorksheetSett.importProtect( rStrm ); break;
- case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( rStrm ); break;
- case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( rStrm ); break;
-
- // BIFF specific records
- default: switch( getBiff() )
- {
- case BIFF2: switch( nRecId )
- {
- case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF3: switch( nRecId )
- {
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
-
- }
- break;
-
- case BIFF4: switch( nRecId )
- {
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF5: switch( nRecId )
- {
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF8: switch( nRecId )
- {
- case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_PICTURE: rPageSett.importPicture( rStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
- case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF_UNKNOWN: break;
- }
- }
- }
- }
-
- // final processing in base class WorksheetHelper
- finalizeWorksheetImport();
- return rStrm.getRecId() == BIFF_ID_EOF;
-}
-
-// ============================================================================
-
} // namespace xls
} // namespace oox
diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx
index db15a8dbf603..84f933135b99 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -29,10 +29,7 @@
#include "excelfilter.hxx"
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-//#include "oox/dump/biffdumper.hxx"
-//#include "oox/dump/xlsbdumper.hxx"
#include "oox/helper/binaryinputstream.hxx"
-#include "biffdetector.hxx"
#include "biffinputstream.hxx"
#include "excelchartconverter.hxx"
#include "excelvbaproject.hxx"
diff --git a/sc/source/filter/oox/excelhandlers.cxx b/sc/source/filter/oox/excelhandlers.cxx
index a3d0b518d6e8..5d05dacf7197 100644
--- a/sc/source/filter/oox/excelhandlers.cxx
+++ b/sc/source/filter/oox/excelhandlers.cxx
@@ -107,69 +107,6 @@ BiffFragmentHandler::~BiffFragmentHandler()
{
}
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
-{
- BiffFragmentType eFragment = BIFF_FRAGMENT_UNKNOWN;
- /* #i23425# Don't rely on BOF record ID to read BOF contents, but on
- the detected BIFF version. */
- if( mxBiffStrm->startNextRecord() && BiffHelper::isBofRecord( *mxBiffStrm ) )
- {
- // BOF is always written unencrypted
- mxBiffStrm->enableDecoder( false );
- mxBiffStrm->skip( 2 );
- sal_uInt16 nType = mxBiffStrm->readuInt16();
-
- // decide which fragment types are valid for current BIFF version
- switch( eBiff )
- {
- case BIFF2: switch( nType )
- {
- case BIFF_BOF_CHART: eFragment = BIFF_FRAGMENT_EMPTYSHEET; break;
- case BIFF_BOF_MACRO: eFragment = BIFF_FRAGMENT_MACROSHEET; break;
- // #i51490# Excel interprets invalid types as worksheet
- default: eFragment = BIFF_FRAGMENT_WORKSHEET;
- }
- break;
-
- case BIFF3: switch( nType )
- {
- case BIFF_BOF_CHART: eFragment = BIFF_FRAGMENT_EMPTYSHEET; break;
- case BIFF_BOF_MACRO: eFragment = BIFF_FRAGMENT_MACROSHEET; break;
- case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_UNKNOWN; break;
- // #i51490# Excel interprets invalid types as worksheet
- default: eFragment = BIFF_FRAGMENT_WORKSHEET;
- };
- break;
-
- case BIFF4: switch( nType )
- {
- case BIFF_BOF_CHART: eFragment = BIFF_FRAGMENT_EMPTYSHEET; break;
- case BIFF_BOF_MACRO: eFragment = BIFF_FRAGMENT_MACROSHEET; break;
- case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_WORKSPACE; break;
- // #i51490# Excel interprets invalid types as worksheet
- default: eFragment = BIFF_FRAGMENT_WORKSHEET;
- };
- break;
-
- case BIFF5:
- case BIFF8: switch( nType )
- {
- case BIFF_BOF_GLOBALS: eFragment = BIFF_FRAGMENT_GLOBALS; break;
- case BIFF_BOF_CHART: eFragment = BIFF_FRAGMENT_CHARTSHEET; break;
- case BIFF_BOF_MACRO: eFragment = BIFF_FRAGMENT_MACROSHEET; break;
- case BIFF_BOF_MODULE: eFragment = BIFF_FRAGMENT_MODULESHEET; break;
- case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_UNKNOWN; break;
- // #i51490# Excel interprets invalid types as worksheet
- default: eFragment = BIFF_FRAGMENT_WORKSHEET;
- };
- break;
-
- case BIFF_UNKNOWN: break;
- }
- }
- return eFragment;
-}
-
bool BiffFragmentHandler::skipFragment()
{
while( mxBiffStrm->startNextRecord() && (mxBiffStrm->getRecId() != BIFF_ID_EOF) )
@@ -196,21 +133,6 @@ BiffWorksheetFragmentBase::BiffWorksheetFragmentBase( const WorksheetHelper& rHe
{
}
-// ----------------------------------------------------------------------------
-
-BiffSkipWorksheetFragment::BiffSkipWorksheetFragment( const WorksheetHelper& rHelper, const BiffWorkbookFragmentBase& rParent ) :
- BiffWorksheetFragmentBase( rHelper, rParent )
-{
-}
-
-bool BiffSkipWorksheetFragment::importFragment()
-{
- return skipFragment();
-}
-
-// ============================================================================
-// ============================================================================
-
} // namespace xls
} // namespace oox
diff --git a/sc/source/filter/oox/externallinkfragment.cxx b/sc/source/filter/oox/externallinkfragment.cxx
index 0b7c3794e57a..a981cf357bdd 100644
--- a/sc/source/filter/oox/externallinkfragment.cxx
+++ b/sc/source/filter/oox/externallinkfragment.cxx
@@ -496,7 +496,7 @@ void BiffExternalSheetDataContext::importCrn( BiffInputStream& rStrm )
rStrm.skip( 7 );
break;
default:
- OSL_FAIL( "BiffExternalLinkFragment::importCrn - unknown data type" );
+ OSL_FAIL( "BiffExternalSheetDataContext::importCrn - unknown data type" );
bLoop = false;
}
}
@@ -520,31 +520,6 @@ void BiffExternalSheetDataContext::setCellValue( const BinAddress& rBinAddr, con
}
}
-// ============================================================================
-
-BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent ) :
- BiffWorkbookFragmentBase( rParent )
-{
-}
-
-bool BiffExternalLinkFragment::importFragment()
-{
- // process all record in this sheet fragment
- BiffExternalSheetDataContext aSheetContext( *this, false );
- BiffInputStream& rStrm = getInputStream();
- while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
- {
- if( BiffHelper::isBofRecord( rStrm ) )
- skipFragment(); // skip unknown embedded fragments
- else
- aSheetContext.importRecord( rStrm );
- }
- return !rStrm.isEof() && (rStrm.getRecId() == BIFF_ID_EOF);
-}
-
-// ============================================================================
-// ============================================================================
-
} // namespace xls
} // namespace oox
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index 4a5c32170a3c..e51cd9d40b4b 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -1506,25 +1506,6 @@ void PivotCacheBuffer::registerPivotCacheFragment( sal_Int32 nCacheId, const OUS
maFragmentPaths[ nCacheId ] = rFragmentPath;
}
-void PivotCacheBuffer::importPivotCacheRef( BiffInputStream& rStrm )
-{
- // read the PIVOTCACHE record that contains the stream ID
- sal_Int32 nCacheId = rStrm.readuInt16();
- OSL_ENSURE( maFragmentPaths.count( nCacheId ) == 0, "PivotCacheBuffer::importPivotCacheRef - cache stream exists already" );
- OUStringBuffer aStrmName;
- static const sal_Unicode spcHexChars[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' };
- for( sal_uInt8 nBit = 0; nBit < 16; nBit += 4 )
- aStrmName.insert( 0, spcHexChars[ extractValue< size_t >( nCacheId, nBit, 4 ) ] );
- aStrmName.insert( 0, (getBiff() == BIFF8) ? CREATE_OUSTRING( "_SX_DB_CUR/" ) : CREATE_OUSTRING( "_SX_DB/" ) );
- maFragmentPaths[ nCacheId ] = aStrmName.makeStringAndClear();
-
- // try to read PCDSOURCE record (will read following data location records too)
- sal_uInt16 nNextRecId = rStrm.getNextRecId();
- OSL_ENSURE( nNextRecId == BIFF_ID_PCDSOURCE, "PivotCacheBuffer::importPivotCacheRef - PCDSOURCE record expected" );
- if( (nNextRecId == BIFF_ID_PCDSOURCE) && rStrm.startNextRecord() )
- createPivotCache( nCacheId ).importPCDSource( rStrm );
-}
-
PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
{
switch( getFilterType() )
@@ -1557,8 +1538,7 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
workbook stream). First, this index has to be resolved to the cache
identifier that is used to manage the cache stream names (the
maFragmentPaths member). The cache object itself exists already
- before the first call for the cache source index (see
- PivotCacheBuffer::importPivotCacheRef() above), because source data
+ before the first call for the cache source index, because source data
link is part of workbook data, not of the cache stream. To detect
subsequent calls with an already initialized cache, the entry in
maFragmentPaths will be removed after reading the cache stream. */
diff --git a/sc/source/filter/oox/sharedstringsbuffer.cxx b/sc/source/filter/oox/sharedstringsbuffer.cxx
index c71172f4a9a9..5d3879409707 100644
--- a/sc/source/filter/oox/sharedstringsbuffer.cxx
+++ b/sc/source/filter/oox/sharedstringsbuffer.cxx
@@ -52,23 +52,6 @@ RichStringRef SharedStringsBuffer::createRichString()
return xString;
}
-void SharedStringsBuffer::importSst( BiffInputStream& rStrm )
-{
- rStrm.skip( 4 );
- sal_Int32 nStringCount = rStrm.readInt32();
- if( nStringCount > 0 )
- {
- maStrings.clear();
- maStrings.reserve( static_cast< size_t >( nStringCount ) );
- for( ; !rStrm.isEof() && (nStringCount > 0); --nStringCount )
- {
- RichStringRef xString( new RichString( *this ) );
- maStrings.push_back( xString );
- xString->importUniString( rStrm );
- }
- }
-}
-
void SharedStringsBuffer::finalizeImport()
{
maStrings.forEachMem( &RichString::finalizeImport );
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 05ff3bb4782e..4abf946ed500 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -487,7 +487,6 @@ void SheetDataBuffer::finalizeImport()
CellRangeAddress aRange( getSheetIndex(), 0, rangeIter->mnFirst, rAddrConv.getMaxApiAddress().Column, rangeIter->mnLast );
rangeList.push_back( aRange );
}
-#if AVOID_UNO
ScRangeList aList;
for ( ApiCellRangeList::const_iterator itRange = rangeList.begin(), itRange_end = rangeList.end(); itRange!=itRange_end; ++itRange )
{
@@ -499,10 +498,6 @@ void SheetDataBuffer::finalizeImport()
aMark.MarkFromRangeList( aList, false );
getStyles().writeCellXfToMarkData( aMark, it->first, -1 );
-#else
- PropertySet aPropSet( getCellRangeList( rangeList ) );
- getStyles().writeCellXfToPropertySet( aPropSet, it->first );
-#endif
}
std::map< std::pair< sal_Int32, sal_Int32 >, ApiCellRangeList > rangeStyleListMap;
// gather all ranges that have the same style and apply them in bulk
@@ -512,17 +507,9 @@ void SheetDataBuffer::finalizeImport()
writeXfIdRangeListProperties( it->first.first, it->first.second, it->second );
// merge all cached merged ranges and update right/bottom cell borders
for( MergedRangeList::iterator aIt = maMergedRanges.begin(), aEnd = maMergedRanges.end(); aIt != aEnd; ++aIt )
-#if AVOID_UNO
applyCellMerging( aIt->maRange );
-#else
- finalizeMergedRange( aIt->maRange );
-#endif
for( MergedRangeList::iterator aIt = maCenterFillRanges.begin(), aEnd = maCenterFillRanges.end(); aIt != aEnd; ++aIt )
-#if AVOID_UNO
applyCellMerging( aIt->maRange );
-#else
- finalizeMergedRange( aIt->maRange );
-#endif
}
// private --------------------------------------------------------------------
@@ -770,24 +757,9 @@ void SheetDataBuffer::setCellFormat( const CellModel& rModel, sal_Int32 nNumFmtI
}
}
-void SheetDataBuffer::writeXfIdRowRangeProperties( const XfIdRowRange& rXfIdRowRange ) const
-{
- if( (rXfIdRowRange.maRowRange.mnLast >= 0) && (rXfIdRowRange.mnXfId >= 0) )
- {
- AddressConverter& rAddrConv = getAddressConverter();
- CellRangeAddress aRange( getSheetIndex(), 0, rXfIdRowRange.maRowRange.mnFirst, rAddrConv.getMaxApiAddress().Column, rXfIdRowRange.maRowRange.mnLast );
- if( rAddrConv.validateCellRange( aRange, true, false ) )
- {
- PropertySet aPropSet( getCellRange( aRange ) );
- getStyles().writeCellXfToPropertySet( aPropSet, rXfIdRowRange.mnXfId );
- }
- }
-}
-
void SheetDataBuffer::writeXfIdRangeListProperties( sal_Int32 nXfId, sal_Int32 nNumFmtId, const ApiCellRangeList& rRanges ) const
{
StylesBuffer& rStyles = getStyles();
-#if AVOID_UNO
ScRangeList aList;
for ( ApiCellRangeList::const_iterator it = rRanges.begin(), it_end = rRanges.end(); it!=it_end; ++it )
{
@@ -798,15 +770,6 @@ void SheetDataBuffer::writeXfIdRangeListProperties( sal_Int32 nXfId, sal_Int32 n
ScMarkData aMark;
aMark.MarkFromRangeList( aList, false );
rStyles.writeCellXfToMarkData( aMark, nXfId, nNumFmtId );
-#else
- PropertyMap aPropMap;
- if( nXfId >= 0 )
- rStyles.writeCellXfToPropertyMap( aPropMap, nXfId );
- if( nNumFmtId >= 0 )
- rStyles.writeNumFmtToPropertyMap( aPropMap, nNumFmtId );
- PropertySet aPropSet( getCellRangeList( rRanges ) );
- aPropSet.setProperties( aPropMap );
-#endif
}
void lcl_SetBorderLine( ScDocument& rDoc, ScRange& rRange, SCTAB nScTab, sal_uInt16 nLine )
@@ -857,59 +820,6 @@ void SheetDataBuffer::applyCellMerging( const CellRangeAddress& rRange )
}
}
-void SheetDataBuffer::finalizeMergedRange( const CellRangeAddress& rRange )
-{
- bool bMultiCol = rRange.StartColumn < rRange.EndColumn;
- bool bMultiRow = rRange.StartRow < rRange.EndRow;
-
- if( bMultiCol || bMultiRow ) try
- {
- // merge the cell range
- Reference< XMergeable > xMerge( getCellRange( rRange ), UNO_QUERY_THROW );
-
- xMerge->merge( sal_True );
- // if merging this range worked (no overlapping merged ranges), update cell borders
- Reference< XCell > xTopLeft( getCell( CellAddress( getSheetIndex(), rRange.StartColumn, rRange.StartRow ) ), UNO_SET_THROW );
- PropertySet aTopLeftProp( xTopLeft );
-
- // copy right border of top-right cell to right border of top-left cell
- if( bMultiCol )
- {
- PropertySet aTopRightProp( getCell( CellAddress( getSheetIndex(), rRange.EndColumn, rRange.StartRow ) ) );
- BorderLine aLine;
- if( aTopRightProp.getProperty( aLine, PROP_RightBorder ) )
- aTopLeftProp.setProperty( PROP_RightBorder, aLine );
- }
-
- // copy bottom border of bottom-left cell to bottom border of top-left cell
- if( bMultiRow )
- {
- PropertySet aBottomLeftProp( getCell( CellAddress( getSheetIndex(), rRange.StartColumn, rRange.EndRow ) ) );
- BorderLine aLine;
- if( aBottomLeftProp.getProperty( aLine, PROP_BottomBorder ) )
- aTopLeftProp.setProperty( PROP_BottomBorder, aLine );
- }
-
- // #i93609# merged range in a single row: test if manual row height is needed
- if( !bMultiRow )
- {
- bool bTextWrap = aTopLeftProp.getBoolProperty( PROP_IsTextWrapped );
- if( !bTextWrap && (xTopLeft->getType() == CellContentType_TEXT) )
- {
- Reference< XText > xText( xTopLeft, UNO_QUERY );
- bTextWrap = xText.is() && (xText->getString().indexOf( '\x0A' ) >= 0);
- }
- if( bTextWrap )
- setManualRowHeight( rRange.StartRow );
- }
- }
- catch( Exception& )
- {
- }
-}
-
-// ============================================================================
-
} // namespace xls
} // namespace oox
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 4f2935b6a5ea..11a560812be3 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -3260,7 +3260,7 @@ void CellStyle::createCellStyle()
// #i1624# #i1768# ignore unnamed user styles
if( !mbCreated )
mbCreated = maFinalName.isEmpty();
-#if AVOID_UNO
+
::ScDocument& rDoc = getScDocument();
if( !mbCreated && !mpStyleSheet )
{
@@ -3290,42 +3290,6 @@ void CellStyle::createCellStyle()
if( bCreatePattern && mpStyleSheet && pXF )
mpStyleSheet->GetItemSet().Put( pXF->createPattern( bDefStyle ).GetItemSet() );
}
-#else
- /* #i103281# do not create another style of the same name, if it exists
- already. This is needed to prevent that styles pasted from clipboard
- get duplicated over and over. */
- if( !mbCreated ) try
- {
- Reference< XNameAccess > xCellStylesNA( getStyleFamily( false ), UNO_QUERY_THROW );
- mbCreated = xCellStylesNA->hasByName( maFinalName );
- }
- catch( Exception& )
- {
- }
-
- // create the style object in the document
- if( !mbCreated ) try
- {
- mbCreated = true;
- Reference< XStyle > xStyle( createStyleObject( maFinalName, false ), UNO_SET_THROW );
- // write style formatting properties
- PropertySet aPropSet( xStyle );
- getStyles().writeStyleXfToPropertySet( aPropSet, maModel.mnXfId );
- if( !maModel.isDefaultStyle() )
- xStyle->setParentStyle( getStyles().getDefaultStyleName() );
- }
- catch( Exception& )
- {
- }
-#endif
-}
-
-ScStyleSheet*
-CellStyle::createStyleSheet()
-{
- if ( !mpStyleSheet )
- createCellStyle();
- return mpStyleSheet;
}
void CellStyle::finalizeImport( const OUString& rFinalName )
@@ -3615,58 +3579,6 @@ void StylesBuffer::importCellStyle( SequenceInputStream& rStrm )
maCellStyles.importCellStyle( rStrm );
}
-void StylesBuffer::importPalette( BiffInputStream& rStrm )
-{
- maPalette.importPalette( rStrm );
-}
-
-void StylesBuffer::importFont( BiffInputStream& rStrm )
-{
- /* Font with index 4 is not stored in BIFF. This means effectively, first
- font in the BIFF file has index 0, fourth font has index 3, and fifth
- font has index 5. Insert a dummy font to correctly map passed font
- identifiers. */
- if( maFonts.size() == 4 )
- maFonts.push_back( maFonts.front() );
-
- FontRef xFont = createFont();
- xFont->importFont( rStrm );
-
- /* #i71033# Set stream text encoding from application font, if CODEPAGE
- record is missing. Must be done now (not while finalizeImport() runs),
- to be able to read all following byte strings correctly (e.g. cell
- style names). */
- if( maFonts.size() == 1 )
- setAppFontEncoding( xFont->getFontEncoding() );
-}
-
-void StylesBuffer::importFontColor( BiffInputStream& rStrm )
-{
- if( !maFonts.empty() )
- maFonts.back()->importFontColor( rStrm );
-}
-
-void StylesBuffer::importFormat( BiffInputStream& rStrm )
-{
- maNumFmts.importFormat( rStrm );
-}
-
-void StylesBuffer::importXf( BiffInputStream& rStrm )
-{
- XfRef xXf( new Xf( *this ) );
- xXf->importXf( rStrm );
-
- XfRef xCellXf, xStyleXf;
- (xXf->isCellXf() ? xCellXf : xStyleXf) = xXf;
- maCellXfs.push_back( xCellXf );
- maStyleXfs.push_back( xStyleXf );
-}
-
-void StylesBuffer::importStyle( BiffInputStream& rStrm )
-{
- maCellStyles.importStyle( rStrm );
-}
-
void StylesBuffer::finalizeImport()
{
// fonts first, are needed to finalize unit converter and XFs below
@@ -3906,12 +3818,6 @@ bool operator==( const Xf& rXf1, const Xf& rXf2 )
return false;
}
-void StylesBuffer::writeCellXfToPropertyMap( PropertyMap& rPropMap, sal_Int32 nXfId ) const
-{
- if( Xf* pXf = maCellXfs.get( nXfId ).get() )
- pXf->writeToPropertyMap( rPropMap );
-}
-
void StylesBuffer::writeCellXfToPropertySet( PropertySet& rPropSet, sal_Int32 nXfId ) const
{
if( Xf* pXf = maCellXfs.get( nXfId ).get() )
diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx
index ec954fce0f78..10e9f9f6e8bd 100644
--- a/sc/source/filter/oox/viewsettings.cxx
+++ b/sc/source/filter/oox/viewsettings.cxx
@@ -674,50 +674,6 @@ void ViewSettings::importOleSize( SequenceInputStream& rStrm )
mbValidOleSize = getAddressConverter().convertToCellRange( maOleSize, aBinRange, 0, true, false );
}
-void ViewSettings::importWindow1( BiffInputStream& rStrm )
-{
- sal_uInt16 nWinX, nWinY, nWinWidth, nWinHeight;
- rStrm >> nWinX >> nWinY >> nWinWidth >> nWinHeight;
-
- // WINDOW1 record occures in every sheet in BIFF4W
- OSL_ENSURE( maBookViews.empty() || ((getBiff() == BIFF4) && isWorkbookFile()),
- "ViewSettings::importWindow1 - multiple WINDOW1 records" );
- WorkbookViewModel& rModel = createWorkbookView();
- rModel.mnWinX = nWinX;
- rModel.mnWinY = nWinY;
- rModel.mnWinWidth = nWinWidth;
- rModel.mnWinHeight = nWinHeight;
-
- if( getBiff() <= BIFF4 )
- {
- sal_uInt8 nHidden;
- rStrm >> nHidden;
- rModel.mnVisibility = (nHidden == 0) ? XML_visible : XML_hidden;
- }
- else
- {
- sal_uInt16 nFlags, nActiveTab, nFirstVisTab, nSelectCnt, nTabBarWidth;
- rStrm >> nFlags >> nActiveTab >> nFirstVisTab >> nSelectCnt >> nTabBarWidth;
-
- rModel.mnActiveSheet = nActiveTab;
- rModel.mnFirstVisSheet = nFirstVisTab;
- rModel.mnTabBarWidth = nTabBarWidth;
- rModel.mnVisibility = getFlagValue( nFlags, BIFF_WINDOW1_HIDDEN, XML_hidden, XML_visible );
- rModel.mbMinimized = getFlag( nFlags, BIFF_WINDOW1_MINIMIZED );
- rModel.mbShowHorScroll = getFlag( nFlags, BIFF_WINDOW1_SHOWHORSCROLL );
- rModel.mbShowVerScroll = getFlag( nFlags, BIFF_WINDOW1_SHOWVERSCROLL );
- rModel.mbShowTabBar = getFlag( nFlags, BIFF_WINDOW1_SHOWTABBAR );
- }
-}
-
-void ViewSettings::importOleSize( BiffInputStream& rStrm )
-{
- rStrm.skip( 2 );
- BinRange aBinRange;
- aBinRange.read( rStrm, false );
- mbValidOleSize = getAddressConverter().convertToCellRange( maOleSize, aBinRange, 0, true, false );
-}
-
void ViewSettings::setSheetViewSettings( sal_Int16 nSheet, const SheetViewModelRef& rxSheetView, const Any& rProperties )
{
maSheetViews[ nSheet ] = rxSheetView;
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index c3c5134c9ace..5958d7bee067 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -962,26 +962,11 @@ rtl_TextEncoding WorkbookHelper::getTextEncoding() const
return mrBookGlob.getTextEncoding();
}
-void WorkbookHelper::setCodePage( sal_uInt16 nCodePage )
-{
- mrBookGlob.setCodePage( nCodePage );
-}
-
void WorkbookHelper::setAppFontEncoding( rtl_TextEncoding eAppFontEnc )
{
mrBookGlob.setAppFontEncoding( eAppFontEnc );
}
-void WorkbookHelper::setIsWorkbookFile()
-{
- mrBookGlob.setIsWorkbookFile();
-}
-
-void WorkbookHelper::createBuffersPerSheet( sal_Int16 nSheet )
-{
- mrBookGlob.createBuffersPerSheet( nSheet );
-}
-
BiffCodecHelper& WorkbookHelper::getCodecHelper() const
{
return mrBookGlob.getCodecHelper();
diff --git a/sc/source/filter/oox/workbooksettings.cxx b/sc/source/filter/oox/workbooksettings.cxx
index b07fa83baf6b..0bdbf410c41b 100644
--- a/sc/source/filter/oox/workbooksettings.cxx
+++ b/sc/source/filter/oox/workbooksettings.cxx
@@ -195,12 +195,6 @@ void WorkbookSettings::setSaveExtLinkValues( bool bSaveExtLinks )
maBookSettings.mbSaveExtLinkValues = bSaveExtLinks;
}
-void WorkbookSettings::importBookBool( BiffInputStream& rStrm )
-{
- // value of 0 means save external values, value of 1 means strip external values
- maBookSettings.mbSaveExtLinkValues = rStrm.readuInt16() == 0;
-}
-
void WorkbookSettings::importCalcCount( BiffInputStream& rStrm )
{
maCalcSettings.mnIterateCount = rStrm.readuInt16();
@@ -213,53 +207,16 @@ void WorkbookSettings::importCalcMode( BiffInputStream& rStrm )
maCalcSettings.mnCalcMode = STATIC_ARRAY_SELECT( spnCalcModes, nCalcMode, XML_auto );
}
-void WorkbookSettings::importCodeName( BiffInputStream& rStrm )
-{
- maBookSettings.maCodeName = rStrm.readUniString();
-}
-
-void WorkbookSettings::importDateMode( BiffInputStream& rStrm )
-{
- setDateMode( rStrm.readuInt16() != 0 );
-}
-
void WorkbookSettings::importDelta( BiffInputStream& rStrm )
{
rStrm >> maCalcSettings.mfIterateDelta;
}
-void WorkbookSettings::importFileSharing( BiffInputStream& rStrm )
-{
- maFileSharing.mbRecommendReadOnly = rStrm.readuInt16() != 0;
- rStrm >> maFileSharing.mnPasswordHash;
- if( getBiff() == BIFF8 )
- {
- sal_uInt16 nStrLen = rStrm.readuInt16();
- // there is no string flags field if string is empty
- if( nStrLen > 0 )
- maFileSharing.maUserName = rStrm.readUniStringBody( nStrLen );
- }
- else
- {
- maFileSharing.maUserName = rStrm.readByteStringUC( false, getTextEncoding() );
- }
-}
-
-void WorkbookSettings::importHideObj( BiffInputStream& rStrm )
-{
- maBookSettings.setBiffObjectMode( rStrm.readuInt16() );
-}
-
void WorkbookSettings::importIteration( BiffInputStream& rStrm )
{
maCalcSettings.mbIterate = rStrm.readuInt16() != 0;
}
-void WorkbookSettings::importPrecision( BiffInputStream& rStrm )
-{
- maCalcSettings.mbFullPrecision = rStrm.readuInt16() != 0;
-}
-
void WorkbookSettings::importRefMode( BiffInputStream& rStrm )
{
maCalcSettings.mnRefMode = (rStrm.readuInt16() == 0) ? XML_R1C1 : XML_A1;
@@ -276,11 +233,6 @@ void WorkbookSettings::importUncalced( BiffInputStream& )
maCalcSettings.mbCalcCompleted = false;
}
-void WorkbookSettings::importUsesElfs( BiffInputStream& rStrm )
-{
- maCalcSettings.mbUseNlr = rStrm.readuInt16() != 0;
-}
-
void WorkbookSettings::finalizeImport()
{
// default settings
diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx
index 5178143cb9b3..36ee6e33a4a7 100644
--- a/sc/source/filter/oox/worksheetbuffer.cxx
+++ b/sc/source/filter/oox/worksheetbuffer.cxx
@@ -78,14 +78,6 @@ WorksheetBuffer::WorksheetBuffer( const WorkbookHelper& rHelper ) :
return rUrl.copy( nFileNamePos, nExtPos - nFileNamePos );
}
-void WorksheetBuffer::initializeSingleSheet()
-{
- OSL_ENSURE( maSheetInfos.empty(), "WorksheetBuffer::initializeSingleSheet - invalid call" );
- SheetInfoModel aModel;
- aModel.maName = getBaseFileName( getBaseFilter().getFileUrl() );
- insertSheet( aModel );
-}
-
void WorksheetBuffer::importSheet( const AttributeList& rAttribs )
{
SheetInfoModel aModel;
@@ -106,24 +98,6 @@ void WorksheetBuffer::importSheet( SequenceInputStream& rStrm )
insertSheet( aModel );
}
-void WorksheetBuffer::importSheet( BiffInputStream& rStrm )
-{
- SheetInfoModel aModel;
- if( getBiff() >= BIFF5 )
- {
- rStrm.enableDecoder( false );
- aModel.mnBiffHandle = rStrm.readuInt32();
- rStrm.enableDecoder( true );
- sal_uInt16 nState = rStrm.readuInt16();
- static const sal_Int32 spnStates[] = { XML_visible, XML_hidden, XML_veryHidden };
- aModel.mnState = STATIC_ARRAY_SELECT( spnStates, nState, XML_visible );
- }
- aModel.maName = (getBiff() == BIFF8) ?
- rStrm.readUniStringBody( rStrm.readuInt8() ) :
- rStrm.readByteStringUC( false, getTextEncoding() );
- insertSheet( aModel );
-}
-
sal_Int16 WorksheetBuffer::insertEmptySheet( const OUString& rPreferredName, bool bVisible )
{
return createSheet( rPreferredName, SAL_MAX_INT32, bVisible ).first;
@@ -140,12 +114,6 @@ OUString WorksheetBuffer::getWorksheetRelId( sal_Int32 nWorksheet ) const
return pSheetInfo ? pSheetInfo->maRelId : OUString();
}
-sal_Int64 WorksheetBuffer::getBiffRecordHandle( sal_Int32 nWorksheet ) const
-{
- const SheetInfo* pSheetInfo = maSheetInfos.get( nWorksheet ).get();
- return pSheetInfo ? pSheetInfo->mnBiffHandle : -1;
-}
-
sal_Int16 WorksheetBuffer::getCalcSheetIndex( sal_Int32 nWorksheet ) const
{
const SheetInfo* pSheetInfo = maSheetInfos.get( nWorksheet ).get();
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index b4484bdd1621..80911120bdd4 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -735,286 +735,6 @@ void WorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedDat
getBaseFilter().importBinaryData( orEmbeddedData, aFragmentPath );
}
-// ============================================================================
-
-BiffWorksheetFragment::BiffWorksheetFragment( const WorksheetHelper& rHelper, const BiffWorkbookFragmentBase& rParent ) :
- BiffWorksheetFragmentBase( rHelper, rParent )
-{
-}
-
-BiffWorksheetFragment::~BiffWorksheetFragment()
-{
-}
-
-bool BiffWorksheetFragment::importFragment()
-{
- // initial processing in base class WorksheetHelper
- initializeWorksheetImport();
-
- // create a SheetDataContext object that implements cell import
- BiffSheetDataContext aSheetData( *this );
-
- WorkbookSettings& rWorkbookSett = getWorkbookSettings();
- WorksheetSettings& rWorksheetSett = getWorksheetSettings();
- SheetViewSettings& rSheetViewSett = getSheetViewSettings();
- CondFormatBuffer& rCondFormats = getCondFormats();
- PageSettings& rPageSett = getPageSettings();
- BiffSheetDrawing& rDrawing = getBiffDrawing();
-
- // process all record in this sheet fragment
- BiffInputStream& rStrm = getInputStream();
- while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
- {
- if( BiffHelper::isBofRecord( rStrm ) )
- {
- // skip unknown embedded fragments (BOF/EOF blocks)
- skipFragment();
- }
- else
- {
- // cache base stream position to detect if record is already processed
- sal_Int64 nStrmPos = rStrm.tellBase();
- sal_uInt16 nRecId = rStrm.getRecId();
-
- switch( nRecId )
- {
- // records in all BIFF versions
- case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( rStrm ); break;
- case BIFF_ID_CALCCOUNT: rWorkbookSett.importCalcCount( rStrm ); break;
- case BIFF_ID_CALCMODE: rWorkbookSett.importCalcMode( rStrm ); break;
- case BIFF_ID_DEFCOLWIDTH: importDefColWidth( rStrm ); break;
- case BIFF_ID_DELTA: rWorkbookSett.importDelta( rStrm ); break;
- case BIFF2_ID_DIMENSION: importDimension( rStrm ); break;
- case BIFF3_ID_DIMENSION: importDimension( rStrm ); break;
- case BIFF_ID_FOOTER: rPageSett.importFooter( rStrm ); break;
- case BIFF_ID_HEADER: rPageSett.importHeader( rStrm ); break;
- case BIFF_ID_HORPAGEBREAKS: importPageBreaks( rStrm, true ); break;
- case BIFF_ID_ITERATION: rWorkbookSett.importIteration( rStrm ); break;
- case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( rStrm ); break;
- case BIFF_ID_NOTE: importNote( rStrm ); break;
- case BIFF_ID_PANE: rSheetViewSett.importPane( rStrm ); break;
- case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( rStrm ); break;
- case BIFF_ID_PRINTGRIDLINES: rPageSett.importPrintGridLines( rStrm ); break;
- case BIFF_ID_PRINTHEADERS: rPageSett.importPrintHeaders( rStrm ); break;
- case BIFF_ID_PROTECT: rWorksheetSett.importProtect( rStrm ); break;
- case BIFF_ID_REFMODE: rWorkbookSett.importRefMode( rStrm ); break;
- case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( rStrm ); break;
- case BIFF_ID_SELECTION: rSheetViewSett.importSelection( rStrm ); break;
- case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( rStrm ); break;
- case BIFF_ID_VERPAGEBREAKS: importPageBreaks( rStrm, false ); break;
-
- // BIFF specific records
- default: switch( getBiff() )
- {
- case BIFF2: switch( nRecId )
- {
- case BIFF_ID_COLUMNDEFAULT: importColumnDefault( rStrm ); break;
- case BIFF_ID_COLWIDTH: importColWidth( rStrm ); break;
- case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
- case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF3: switch( nRecId )
- {
- case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
- case BIFF_ID_DEFCOLWIDTH: importDefColWidth( rStrm ); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_OBJ: rDrawing.importObj( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF4: switch( nRecId )
- {
- case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_OBJ: rDrawing.importObj( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF5: switch( nRecId )
- {
- case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break;
- case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_MERGEDCELLS: importMergedCells( rStrm ); break; // #i62300# also in BIFF5
- case BIFF_ID_OBJ: rDrawing.importObj( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
- case BIFF_ID_PTDEFINITION: importPTDefinition( rStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF8: switch( nRecId )
- {
- case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break;
- case BIFF_ID_CFHEADER: rCondFormats.importCfHeader( rStrm ); break;
- case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break;
- case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
- case BIFF_ID_DATAVALIDATION: importDataValidation( rStrm ); break;
- case BIFF_ID_DATAVALIDATIONS: importDataValidations( rStrm ); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
- case BIFF_ID_HYPERLINK: importHyperlink( rStrm ); break;
- case BIFF_ID_LABELRANGES: importLabelRanges( rStrm ); break;
- case BIFF_ID_MERGEDCELLS: importMergedCells( rStrm ); break;
- case BIFF_ID_OBJ: rDrawing.importObj( rStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
- case BIFF_ID_PHONETICPR: rWorksheetSett.importPhoneticPr( rStrm ); break;
- case BIFF_ID_PICTURE: rPageSett.importPicture( rStrm ); break;
- case BIFF_ID_PTDEFINITION: importPTDefinition( rStrm ); break;
- case BIFF_ID_QUERYTABLE: importQueryTable( rStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
- case BIFF_ID_SCENARIOS: importScenarios( rStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
- case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( rStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
- case BIFF_ID_SHAREDFEATHEAD: importSharedFeatHead( rStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
- }
- break;
-
- case BIFF_UNKNOWN: break;
- }
- }
-
- // record not processed, try record context objects
- if( rStrm.tellBase() == nStrmPos )
- {
- // first, try cell table records
- aSheetData.importRecord( rStrm );
- // handle another open record context
- if( mxContext.get() )
- {
- // if it was a cell table record, forget the other record context
- if( rStrm.tellBase() == nStrmPos )
- mxContext->importRecord( rStrm );
- else
- mxContext.reset();
- }
- }
- }
- }
-
- // final processing in base class WorksheetHelper
- finalizeWorksheetImport();
- return rStrm.getRecId() == BIFF_ID_EOF;
-}
-
-// private --------------------------------------------------------------------
-
-void BiffWorksheetFragment::importAutoFilter( BiffInputStream& rStrm )
-{
- mxContext.reset( new BiffAutoFilterContext( *this, getAutoFilters().createAutoFilter() ) );
- mxContext->importRecord( rStrm );
-}
-
-void BiffWorksheetFragment::importColInfo( BiffInputStream& rStrm )
-{
- sal_uInt16 nFirstCol, nLastCol, nWidth, nXfId, nFlags;
- rStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
-
- ColumnModel aModel;
- // column indexes are 0-based in BIFF, but ColumnModel expects 1-based
- aModel.maRange.mnFirst = static_cast< sal_Int32 >( nFirstCol ) + 1;
- aModel.maRange.mnLast = static_cast< sal_Int32 >( nLastCol ) + 1;
- // width is stored as 1/256th of a character in BIFF, convert to entire character
- aModel.mfWidth = static_cast< double >( nWidth ) / 256.0;
- aModel.mnXfId = nXfId;
- aModel.mnLevel = extractValue< sal_Int32 >( nFlags, 8, 3 );
- aModel.mbShowPhonetic = getFlag( nFlags, BIFF_COLINFO_SHOWPHONETIC );
- aModel.mbHidden = getFlag( nFlags, BIFF_COLINFO_HIDDEN );
- aModel.mbCollapsed = getFlag( nFlags, BIFF_COLINFO_COLLAPSED );
- // set column properties in the current sheet
- setColumnModel( aModel );
-}
-
-void BiffWorksheetFragment::importColumnDefault( BiffInputStream& rStrm )
-{
- sal_uInt16 nFirstCol, nLastCol, nXfId;
- rStrm >> nFirstCol >> nLastCol >> nXfId;
- setDefaultColumnFormat( nFirstCol, nLastCol, nXfId );
-}
-
-void BiffWorksheetFragment::importColWidth( BiffInputStream& rStrm )
-{
- sal_uInt8 nFirstCol, nLastCol;
- sal_uInt16 nWidth;
- rStrm >> nFirstCol >> nLastCol >> nWidth;
-
- ColumnModel aModel;
- // column indexes are 0-based in BIFF, but ColumnModel expects 1-based
- aModel.maRange.mnFirst = static_cast< sal_Int32 >( nFirstCol ) + 1;
- aModel.maRange.mnLast = static_cast< sal_Int32 >( nLastCol ) + 1;
- // width is stored as 1/256th of a character in BIFF, convert to entire character
- aModel.mfWidth = static_cast< double >( nWidth ) / 256.0;
- // set column properties in the current sheet
- setColumnModel( aModel );
-}
-
-void BiffWorksheetFragment::importDefColWidth( BiffInputStream& rStrm )
-{
- /* Stored as entire number of characters without padding pixels, which
- will be added in setBaseColumnWidth(). Call has no effect, if a
- width has already been set from the STANDARDWIDTH record. */
- setBaseColumnWidth( rStrm.readuInt16() );
-}
-
-void BiffWorksheetFragment::importDefRowHeight( BiffInputStream& rStrm )
-{
- sal_uInt16 nFlags = BIFF_DEFROW_CUSTOMHEIGHT, nHeight;
- if( getBiff() != BIFF2 )
- rStrm >> nFlags;
- rStrm >> nHeight;
- if( getBiff() == BIFF2 )
- nHeight &= BIFF2_DEFROW_MASK;
- // row height is in twips in BIFF, convert to points
- setDefaultRowSettings(
- nHeight / 20.0,
- getFlag( nFlags, BIFF_DEFROW_CUSTOMHEIGHT ),
- getFlag( nFlags, BIFF_DEFROW_HIDDEN ),
- getFlag( nFlags, BIFF_DEFROW_THICKTOP ),
- getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
-}
-
-void BiffWorksheetFragment::importDataValidations( BiffInputStream& rStrm )
-{
- sal_Int32 nObjId;
- rStrm.skip( 10 );
- rStrm >> nObjId;
- //! TODO: invalidate object id in drawing object manager
-}
-
namespace {
OUString lclReadDataValMessage( BiffInputStream& rStrm )
@@ -1035,188 +755,6 @@ ApiTokenSequence lclReadDataValFormula( BiffInputStream& rStrm, FormulaParser& r
} // namespace
-void BiffWorksheetFragment::importDataValidation( BiffInputStream& rStrm )
-{
- ValidationModel aModel;
-
- // flags
- sal_uInt32 nFlags;
- rStrm >> nFlags;
- aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
- aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
- aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
- aModel.mbAllowBlank = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
- aModel.mbNoDropDown = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
- aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
- aModel.mbShowErrorMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWERROR );
-
- // message strings
- aModel.maInputTitle = lclReadDataValMessage( rStrm );
- aModel.maErrorTitle = lclReadDataValMessage( rStrm );
- aModel.maInputMessage = lclReadDataValMessage( rStrm );
- aModel.maErrorMessage = lclReadDataValMessage( rStrm );
-
- // condition formula(s)
- FormulaParser& rParser = getFormulaParser();
- aModel.maTokens1 = lclReadDataValFormula( rStrm, rParser );
- aModel.maTokens2 = lclReadDataValFormula( rStrm, rParser );
- // process string list of a list validation (convert to list of string tokens)
- if( (aModel.mnType == XML_list) && getFlag( nFlags, BIFF_DATAVAL_STRINGLIST ) )
- rParser.convertStringToStringList( aModel.maTokens1, '\0', true );
-
- // cell range list
- BinRangeList aRanges;
- rStrm >> aRanges;
- getAddressConverter().convertToCellRangeList( aModel.maRanges, aRanges, getSheetIndex(), true );
-
- // set validation data
- setValidation( aModel );
-}
-
-void BiffWorksheetFragment::importDimension( BiffInputStream& rStrm )
-{
- // 32-bit row indexes in BIFF8
- bool bInt32Rows = (rStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
- BinRange aBinRange;
- aBinRange.read( rStrm, true, bInt32Rows );
- /* BIFF stores the used area with end column and end row increased by 1
- (first unused column and row). */
- if( (aBinRange.maFirst.mnCol < aBinRange.maLast.mnCol) && (aBinRange.maFirst.mnRow < aBinRange.maLast.mnRow) )
- {
- // reduce range to used area
- --aBinRange.maLast.mnCol;
- --aBinRange.maLast.mnRow;
- CellRangeAddress aRange;
- getAddressConverter().convertToCellRangeUnchecked( aRange, aBinRange, getSheetIndex() );
- extendUsedArea( aRange );
- }
-}
-
-void BiffWorksheetFragment::importHyperlink( BiffInputStream& rStrm )
-{
- HyperlinkModel aModel;
-
- // read cell range for the hyperlink
- BinRange aBiffRange;
- rStrm >> aBiffRange;
- // #i80006# Excel silently ignores invalid hi-byte of column index (TODO: everywhere?)
- aBiffRange.maFirst.mnCol &= 0xFF;
- aBiffRange.maLast.mnCol &= 0xFF;
- if( !getAddressConverter().convertToCellRange( aModel.maRange, aBiffRange, getSheetIndex(), true, true ) )
- return;
-
- // try to read the StdHlink data
- if( !::oox::ole::OleHelper::importStdHlink( aModel, rStrm, true ) )
- return;
-
- // try to read the optional following SCREENTIP record
- if( (rStrm.getNextRecId() == BIFF_ID_SCREENTIP) && rStrm.startNextRecord() )
- {
- rStrm.skip( 2 ); // repeated record id
- // the cell range, again
- rStrm >> aBiffRange;
- CellRangeAddress aRange;
- if( getAddressConverter().convertToCellRange( aRange, aBiffRange, getSheetIndex(), true, true ) &&
- (aRange.StartColumn == aModel.maRange.StartColumn) &&
- (aRange.StartRow == aModel.maRange.StartRow) &&
- (aRange.EndColumn == aModel.maRange.EndColumn) &&
- (aRange.EndRow == aModel.maRange.EndRow) )
- {
- /* This time, we have no string length, no flag field, and a
- null-terminated 16-bit character array. */
- aModel.maTooltip = rStrm.readNulUnicodeArray();
- }
- }
-
- // store the hyperlink settings
- setHyperlink( aModel );
-}
-
-void BiffWorksheetFragment::importLabelRanges( BiffInputStream& rStrm )
-{
- BinRangeList aBiffRowRanges, aBiffColRanges;
- rStrm >> aBiffRowRanges >> aBiffColRanges;
- ApiCellRangeList aColRanges, aRowRanges;
- getAddressConverter().convertToCellRangeList( aColRanges, aBiffColRanges, getSheetIndex(), true );
- getAddressConverter().convertToCellRangeList( aRowRanges, aBiffRowRanges, getSheetIndex(), true );
- setLabelRanges( aColRanges, aRowRanges );
-}
-
-void BiffWorksheetFragment::importMergedCells( BiffInputStream& rStrm )
-{
- BinRangeList aBiffRanges;
- rStrm >> aBiffRanges;
- ApiCellRangeList aRanges;
- getAddressConverter().convertToCellRangeList( aRanges, aBiffRanges, getSheetIndex(), true );
- for( ApiCellRangeList::const_iterator aIt = aRanges.begin(), aEnd = aRanges.end(); aIt != aEnd; ++aIt )
- getSheetData().setMergedRange( *aIt );
-}
-
-void BiffWorksheetFragment::importNote( BiffInputStream& rStrm )
-{
- getComments().createComment()->importNote( rStrm );
-}
-
-void BiffWorksheetFragment::importPageBreaks( BiffInputStream& rStrm, bool bRowBreak )
-{
- PageBreakModel aModel;
- aModel.mbManual = true; // only manual breaks stored in BIFF
- bool bBiff8 = getBiff() == BIFF8; // skip start/end columns or rows in BIFF8
-
- sal_uInt16 nCount;
- rStrm >> nCount;
- for( sal_uInt16 nIndex = 0; !rStrm.isEof() && (nIndex < nCount); ++nIndex )
- {
- aModel.mnColRow = rStrm.readuInt16();
- setPageBreak( aModel, bRowBreak );
- if( bBiff8 )
- rStrm.skip( 4 );
- }
-}
-
-void BiffWorksheetFragment::importPTDefinition( BiffInputStream& rStrm )
-{
- mxContext.reset( new BiffPivotTableContext( *this ) );
- mxContext->importRecord( rStrm );
-}
-
-void BiffWorksheetFragment::importQueryTable( BiffInputStream& rStrm )
-{
- mxContext.reset( new BiffQueryTableContext( *this ) );
- mxContext->importRecord( rStrm );
-}
-
-void BiffWorksheetFragment::importScenarios( BiffInputStream& rStrm )
-{
- getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( rStrm );
-}
-
-void BiffWorksheetFragment::importSharedFeatHead( BiffInputStream& rStrm )
-{
- rStrm.skip( 12 );
- sal_uInt16 nType = rStrm.readuInt16();
- rStrm.skip( 5 );
- switch( nType )
- {
- case BIFF_SHRFEATHEAD_SHEETPROT:
- if( rStrm.getRemaining() >= 4 )
- getWorksheetSettings().importSheetProtection( rStrm );
- break;
- }
-}
-
-void BiffWorksheetFragment::importStandardWidth( BiffInputStream& rStrm )
-{
- sal_uInt16 nWidth;
- rStrm >> nWidth;
- // width is stored as 1/256th of a character in BIFF, convert to entire character
- double fWidth = static_cast< double >( nWidth ) / 256.0;
- // set as default width, will override the width from DEFCOLWIDTH record
- setDefaultColumnWidth( fWidth );
-}
-
-// ============================================================================
-
} // namespace xls
} // namespace oox