diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-11-09 10:52:14 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-11-09 10:52:14 +0100 |
commit | 32bb320ed0e4c52a7adf84d13a8066877adceb54 (patch) | |
tree | 4b191cf382c6603b1dfb3a71e12622b7b3e8b562 /oox/source/xls | |
parent | bf9cd246dc431e20181cfec8107e3b7c59866281 (diff) |
dr77: more cleanup: remove RecordInputStream, cleanup ContainerHelper
Diffstat (limited to 'oox/source/xls')
41 files changed, 364 insertions, 348 deletions
diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx index 0f9828b8e0f4..6d53be0c155b 100644 --- a/oox/source/xls/addressconverter.cxx +++ b/oox/source/xls/addressconverter.cxx @@ -34,7 +34,6 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include "oox/core/filterbase.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/biffoutputstream.hxx" @@ -123,7 +122,7 @@ CellAddress ApiCellRangeList::getBaseAddress() const // ============================================================================ -void BinAddress::read( RecordInputStream& rStrm ) +void BinAddress::read( SequenceInputStream& rStrm ) { rStrm >> mnRow >> mnCol; } @@ -154,7 +153,7 @@ bool BinRange::contains( const BinAddress& rAddr ) const (maFirst.mnRow <= rAddr.mnRow) && (rAddr.mnRow <= maLast.mnRow); } -void BinRange::read( RecordInputStream& rStrm ) +void BinRange::read( SequenceInputStream& rStrm ) { rStrm >> maFirst.mnRow >> maLast.mnRow >> maFirst.mnCol >> maLast.mnCol; } @@ -199,7 +198,7 @@ BinRange BinRangeList::getEnclosingRange() const return aRange; } -void BinRangeList::read( RecordInputStream& rStrm ) +void BinRangeList::read( SequenceInputStream& rStrm ) { sal_Int32 nCount = rStrm.readInt32(); resize( getLimitedValue< size_t, sal_Int64 >( nCount, 0, rStrm.getRemaining() / 16 ) ); diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index edee85dc3583..7cf359f6d3c9 100755 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -35,8 +35,8 @@ #include <com/sun/star/table/TableOrientation.hpp> #include <rtl/ustrbuf.hxx> #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" @@ -197,7 +197,7 @@ void FilterSettingsBase::importAttribs( sal_Int32 /*nElement*/, const AttributeL { } -void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, RecordInputStream& /*rStrm*/ ) +void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, SequenceInputStream& /*rStrm*/ ) { } @@ -238,7 +238,7 @@ void DiscreteFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAt } } -void DiscreteFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void DiscreteFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( nRecId ) { @@ -257,7 +257,7 @@ void DiscreteFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) case BIFF12_ID_DISCRETEFILTER: { - OUString aValue = rStrm.readString(); + OUString aValue = BiffHelper::readString( rStrm ); if( aValue.getLength() > 0 ) maValues.push_back( aValue ); } @@ -308,7 +308,7 @@ void Top10Filter::importAttribs( sal_Int32 nElement, const AttributeList& rAttri } } -void Top10Filter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void Top10Filter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( nRecId == BIFF12_ID_TOP10FILTER ) { @@ -352,7 +352,7 @@ void FilterCriterionModel::setBiffOperator( sal_uInt8 nOperator ) mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID ); } -void FilterCriterionModel::readBiffData( RecordInputStream& rStrm ) +void FilterCriterionModel::readBiffData( SequenceInputStream& rStrm ) { sal_uInt8 nOperator; rStrm >> mnDataType >> nOperator; @@ -366,7 +366,7 @@ void FilterCriterionModel::readBiffData( RecordInputStream& rStrm ) case BIFF_FILTER_DATATYPE_STRING: { rStrm.skip( 8 ); - OUString aValue = rStrm.readString().trim(); + OUString aValue = BiffHelper::readString( rStrm ).trim(); if( aValue.getLength() > 0 ) maValue <<= aValue; } @@ -485,7 +485,7 @@ void CustomFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttr } } -void CustomFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void CustomFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( nRecId ) { @@ -606,7 +606,7 @@ void FilterColumn::importFilterColumn( const AttributeList& rAttribs ) mbShowButton = rAttribs.getBool( XML_showButton, true ); } -void FilterColumn::importFilterColumn( RecordInputStream& rStrm ) +void FilterColumn::importFilterColumn( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> mnColId >> nFlags; @@ -654,7 +654,7 @@ void AutoFilter::importAutoFilter( const AttributeList& rAttribs, sal_Int16 nShe getAddressConverter().convertToCellRangeUnchecked( maRange, aRangeStr, nSheet ); } -void AutoFilter::importAutoFilter( RecordInputStream& rStrm, sal_Int16 nSheet ) +void AutoFilter::importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet ) { BinRange aBinRange; rStrm >> aBinRange; diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx index d88e7026b80f..81327944fc05 100644 --- a/oox/source/xls/autofiltercontext.cxx +++ b/oox/source/xls/autofiltercontext.cxx @@ -63,7 +63,7 @@ void FilterSettingsContext::onStartElement( const AttributeList& rAttribs ) mrFilterSettings.importAttribs( getCurrentElement(), rAttribs ); } -ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { switch( getCurrentElement() ) { @@ -77,7 +77,7 @@ ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId return 0; } -void FilterSettingsContext::onStartRecord( RecordInputStream& rStrm ) +void FilterSettingsContext::onStartRecord( SequenceInputStream& rStrm ) { mrFilterSettings.importRecord( getCurrentElement(), rStrm ); } @@ -109,7 +109,7 @@ void FilterColumnContext::onStartElement( const AttributeList& rAttribs ) mrFilterColumn.importFilterColumn( rAttribs ); } -ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { if( getCurrentElement() == BIFF12_ID_FILTERCOLUMN ) switch( nRecId ) { @@ -123,7 +123,7 @@ ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, return 0; } -void FilterColumnContext::onStartRecord( RecordInputStream& rStrm ) +void FilterColumnContext::onStartRecord( SequenceInputStream& rStrm ) { mrFilterColumn.importFilterColumn( rStrm ); } @@ -148,14 +148,14 @@ void AutoFilterContext::onStartElement( const AttributeList& rAttribs ) mrAutoFilter.importAutoFilter( rAttribs, getSheetIndex() ); } -ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { if( (getCurrentElement() == BIFF12_ID_AUTOFILTER) && (nRecId == BIFF12_ID_FILTERCOLUMN) ) return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() ); return 0; } -void AutoFilterContext::onStartRecord( RecordInputStream& rStrm ) +void AutoFilterContext::onStartRecord( SequenceInputStream& rStrm ) { mrAutoFilter.importAutoFilter( rStrm, getSheetIndex() ); } diff --git a/oox/source/xls/biffhelper.cxx b/oox/source/xls/biffhelper.cxx index 5989777456e0..55839043865e 100644 --- a/oox/source/xls/biffhelper.cxx +++ b/oox/source/xls/biffhelper.cxx @@ -189,6 +189,8 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, // ============================================================================ +// conversion ----------------------------------------------------------------- + /*static*/ double BiffHelper::calcDoubleFromRk( sal_Int32 nRkValue ) { DecodedDouble aDecDbl( 0.0 ); @@ -265,6 +267,35 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, return static_cast< sal_uInt16 >( (nCodePage == 0) ? 1252 : nCodePage ); } +// BIFF12 import -------------------------------------------------------------- + +/*static*/ OUString BiffHelper::readString( SequenceInputStream& rStrm, bool b32BitLen ) +{ + OUString aString; + if( !rStrm.isEof() ) + { + sal_Int32 nCharCount = b32BitLen ? rStrm.readValue< sal_Int32 >() : rStrm.readValue< sal_Int16 >(); + // string length -1 is often used to indicate a missing string + OSL_ENSURE( !rStrm.isEof() && (nCharCount >= -1), "BiffHelper::readString - invalid string length" ); + if( !rStrm.isEof() && (nCharCount > 0) ) + { + ::std::vector< sal_Unicode > aBuffer; + aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) ); + for( sal_Int32 nCharIdx = 0; !rStrm.isEof() && (nCharIdx < nCharCount); ++nCharIdx ) + { + sal_uInt16 nChar; + rStrm.readValue( nChar ); + aBuffer.push_back( static_cast< sal_Unicode >( nChar ) ); + } + aBuffer.push_back( 0 ); + aString = OUString( &aBuffer.front() ); + } + } + return aString; +} + +// BIFF2-BIFF8 import --------------------------------------------------------- + /*static*/ bool BiffHelper::isBofRecord( BiffInputStream& rStrm ) { return diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx index ca5c9c77b2d7..c67768ef2f22 100644 --- a/oox/source/xls/chartsheetfragment.cxx +++ b/oox/source/xls/chartsheetfragment.cxx @@ -28,7 +28,6 @@ #include "oox/xls/chartsheetfragment.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/viewsettings.hxx" @@ -109,7 +108,7 @@ void ChartsheetFragment::onCharacters( const OUString& rChars ) } } -ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -173,9 +172,9 @@ void ChartsheetFragment::importDrawing( const AttributeList& rAttribs ) setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) ); } -void ChartsheetFragment::importDrawing( RecordInputStream& rStrm ) +void ChartsheetFragment::importDrawing( SequenceInputStream& rStrm ) { - setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) ); + setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) ); } // ============================================================================ diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx index 264656eb7063..78d5fe044fe8 100644 --- a/oox/source/xls/commentsbuffer.cxx +++ b/oox/source/xls/commentsbuffer.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/sheet/XSheetAnnotations.hpp> #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp> #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/drawingfragment.hxx" @@ -70,7 +69,7 @@ void Comment::importComment( const AttributeList& rAttribs ) getAddressConverter().convertToCellRangeUnchecked( maModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() ); } -void Comment::importComment( RecordInputStream& rStrm ) +void Comment::importComment( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> maModel.mnAuthorId >> aBinRange; diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx index 9346686c79fb..b37860c4553e 100644 --- a/oox/source/xls/commentsfragment.cxx +++ b/oox/source/xls/commentsfragment.cxx @@ -82,7 +82,7 @@ void CommentsFragment::onEndElement() mxComment.reset(); } -ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -94,7 +94,7 @@ ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, Rec if( nRecId == BIFF12_ID_COMMENTLIST ) return this; break; case BIFF12_ID_COMMENTAUTHORS: - if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( rStrm.readString() ); + if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( BiffHelper::readString( rStrm ) ); break; case BIFF12_ID_COMMENTLIST: if( nRecId == BIFF12_ID_COMMENT ) { importComment( rStrm ); return this; } @@ -134,7 +134,7 @@ void CommentsFragment::importComment( const AttributeList& rAttribs ) mxComment->importComment( rAttribs ); } -void CommentsFragment::importComment( RecordInputStream& rStrm ) +void CommentsFragment::importComment( SequenceInputStream& rStrm ) { mxComment = getComments().createComment(); mxComment->importComment( rStrm ); diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx index 066b8188ddae..51d9170e1794 100644 --- a/oox/source/xls/condformatbuffer.cxx +++ b/oox/source/xls/condformatbuffer.cxx @@ -43,8 +43,8 @@ #include <com/sun/star/table/XCellRange.hpp> #include <rtl/ustrbuf.hxx> #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -199,7 +199,7 @@ void CondFormatRule::appendFormula( const OUString& rFormula ) maModel.maFormulas.push_back( aContext ); } -void CondFormatRule::importCfRule( RecordInputStream& rStrm ) +void CondFormatRule::importCfRule( SequenceInputStream& rStrm ) { sal_Int32 nType, nSubType, nOperator, nFmla1Size, nFmla2Size, nFmla3Size; sal_uInt16 nFlags; @@ -647,7 +647,7 @@ CondFormatRuleRef CondFormat::importCfRule( const AttributeList& rAttribs ) return xRule; } -void CondFormat::importCondFormatting( RecordInputStream& rStrm ) +void CondFormat::importCondFormatting( SequenceInputStream& rStrm ) { BinRangeList aRanges; rStrm.skip( 8 ); @@ -655,7 +655,7 @@ void CondFormat::importCondFormatting( RecordInputStream& rStrm ) getAddressConverter().convertToCellRangeList( maModel.maRanges, aRanges, getSheetIndex(), true ); } -void CondFormat::importCfRule( RecordInputStream& rStrm ) +void CondFormat::importCfRule( SequenceInputStream& rStrm ) { CondFormatRuleRef xRule = createRule(); xRule->importCfRule( rStrm ); @@ -725,7 +725,7 @@ CondFormatRef CondFormatBuffer::importConditionalFormatting( const AttributeList return xCondFmt; } -CondFormatRef CondFormatBuffer::importCondFormatting( RecordInputStream& rStrm ) +CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm ) { CondFormatRef xCondFmt = createCondFormat(); xCondFmt->importCondFormatting( rStrm ); diff --git a/oox/source/xls/condformatcontext.cxx b/oox/source/xls/condformatcontext.cxx index 23f32262cb07..091dc11fb614 100644 --- a/oox/source/xls/condformatcontext.cxx +++ b/oox/source/xls/condformatcontext.cxx @@ -73,7 +73,7 @@ void CondFormatContext::onCharacters( const OUString& rChars ) mxRule->appendFormula( rChars ); } -ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& ) +ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& ) { switch( getCurrentElement() ) { @@ -83,7 +83,7 @@ ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, Re return 0; } -void CondFormatContext::onStartRecord( RecordInputStream& rStrm ) +void CondFormatContext::onStartRecord( SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx index 30472d7dd919..6d0fcd65122f 100755 --- a/oox/source/xls/connectionsbuffer.cxx +++ b/oox/source/xls/connectionsbuffer.cxx @@ -28,7 +28,6 @@ #include "oox/xls/connectionsbuffer.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -285,7 +284,7 @@ void Connection::importTable( const AttributeList& rAttribs, sal_Int32 nElement } } -void Connection::importConnection( RecordInputStream& rStrm ) +void Connection::importConnection( SequenceInputStream& rStrm ) { sal_uInt16 nFlags, nStrFlags; sal_uInt8 nSavePassword, nCredentials; @@ -319,7 +318,7 @@ void Connection::importConnection( RecordInputStream& rStrm ) maModel.mbSavePassword = nSavePassword == BIFF12_CONNECTION_SAVEPASSWORD_ON; } -void Connection::importWebPr( RecordInputStream& rStrm ) +void Connection::importWebPr( SequenceInputStream& rStrm ) { WebPrModel& rWebPr = maModel.createWebPr(); @@ -348,7 +347,7 @@ void Connection::importWebPr( RecordInputStream& rStrm ) rWebPr.mbHtmlTables = getFlag( nFlags, BIFF12_WEBPR_HTMLTABLES ); } -void Connection::importWebPrTables( RecordInputStream& /*rStrm*/ ) +void Connection::importWebPrTables( SequenceInputStream& /*rStrm*/ ) { if( maModel.mxWebPr.get() ) { @@ -357,16 +356,16 @@ void Connection::importWebPrTables( RecordInputStream& /*rStrm*/ ) } } -void Connection::importWebPrTable( RecordInputStream& rStrm, sal_Int32 nRecId ) +void Connection::importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId ) { if( maModel.mxWebPr.get() ) { Any aTableAny; switch( nRecId ) { - case BIFF12_ID_PCITEM_MISSING: break; - case BIFF12_ID_PCITEM_STRING: aTableAny <<= rStrm.readString(); break; - case BIFF12_ID_PCITEM_INDEX: aTableAny <<= rStrm.readInt32(); break; + case BIFF12_ID_PCITEM_MISSING: break; + case BIFF12_ID_PCITEM_STRING: aTableAny <<= BiffHelper::readString( rStrm ); break; + case BIFF12_ID_PCITEM_INDEX: aTableAny <<= rStrm.readInt32(); break; default: OSL_ENSURE( false, "Connection::importWebPrTable - unexpected record" ); return; diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx index 1d60a954a8a8..7aafcd84cd7e 100644 --- a/oox/source/xls/connectionsfragment.cxx +++ b/oox/source/xls/connectionsfragment.cxx @@ -81,7 +81,7 @@ void ConnectionContext::onStartElement( const AttributeList& rAttribs ) mrConnection.importConnection( rAttribs ); } -ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -108,7 +108,7 @@ ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, Re return 0; } -void ConnectionContext::onStartRecord( RecordInputStream& rStrm ) +void ConnectionContext::onStartRecord( SequenceInputStream& rStrm ) { if( getCurrentElement() == BIFF12_ID_CONNECTION ) mrConnection.importConnection( rStrm ); @@ -138,7 +138,7 @@ ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, cons return 0; } -ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx index 360281143d88..96fcec0042f5 100644 --- a/oox/source/xls/defnamesbuffer.cxx +++ b/oox/source/xls/defnamesbuffer.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/sheet/XPrintAreas.hpp> #include <rtl/ustrbuf.hxx> #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -286,7 +287,7 @@ void DefinedNameBase::importOoxFormula( FormulaContext& rContext, sal_Int16 nBas getFormulaParser().convertErrorToFormula( rContext, BIFF_ERR_NAME ); } -void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm ) +void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm ) { rContext.setBaseAddress( CellAddress( nBaseSheet, 0, 0 ) ); getFormulaParser().importFormula( rContext, rStrm ); @@ -338,7 +339,7 @@ void DefinedName::setFormula( const OUString& rFormula ) maModel.maFormula = rFormula; } -void DefinedName::importDefinedName( RecordInputStream& rStrm ) +void DefinedName::importDefinedName( SequenceInputStream& rStrm ) { sal_uInt32 nFlags; rStrm >> nFlags; @@ -596,7 +597,7 @@ void DefinedName::implImportOoxFormula( FormulaContext& rContext ) { if( mxFormula.get() ) { - RecordInputStream aStrm( *mxFormula ); + SequenceInputStream aStrm( *mxFormula ); importBiff12Formula( rContext, mnCalcSheet, aStrm ); } else @@ -634,7 +635,7 @@ DefinedNameRef DefinedNamesBuffer::importDefinedName( const AttributeList& rAttr return xDefName; } -void DefinedNamesBuffer::importDefinedName( RecordInputStream& rStrm ) +void DefinedNamesBuffer::importDefinedName( SequenceInputStream& rStrm ) { createDefinedName()->importDefinedName( rStrm ); } diff --git a/oox/source/xls/excelchartconverter.cxx b/oox/source/xls/excelchartconverter.cxx index af0a445223ad..53c0a3b83bf2 100644 --- a/oox/source/xls/excelchartconverter.cxx +++ b/oox/source/xls/excelchartconverter.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/chart2/data/XDataProvider.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> #include "oox/drawingml/chart/datasourcemodel.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/xls/formulaparser.hxx" namespace oox { diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 36c5dc984cb2..683ac3582071 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -141,13 +141,13 @@ void ExternalName::importOleItem( const AttributeList& rAttribs ) maExtNameModel.mbIconified = rAttribs.getBool( XML_icon, false ); } -void ExternalName::importExternalName( RecordInputStream& rStrm ) +void ExternalName::importExternalName( SequenceInputStream& rStrm ) { rStrm >> maModel.maName; OSL_ENSURE( maModel.maName.getLength() > 0, "ExternalName::importExternalName - empty name" ); } -void ExternalName::importExternalNameFlags( RecordInputStream& rStrm ) +void ExternalName::importExternalNameFlags( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; sal_Int32 nSheetId; @@ -164,31 +164,31 @@ void ExternalName::importExternalNameFlags( RecordInputStream& rStrm ) "ExternalName::importExternalNameFlags - wrong OLE flag in external name" ); } -void ExternalName::importDdeItemValues( RecordInputStream& rStrm ) +void ExternalName::importDdeItemValues( SequenceInputStream& rStrm ) { sal_Int32 nRows, nCols; rStrm >> nRows >> nCols; setResultSize( nCols, nRows ); } -void ExternalName::importDdeItemBool( RecordInputStream& rStrm ) +void ExternalName::importDdeItemBool( SequenceInputStream& rStrm ) { appendResultValue< double >( (rStrm.readuInt8() == 0) ? 0.0 : 1.0 ); } -void ExternalName::importDdeItemDouble( RecordInputStream& rStrm ) +void ExternalName::importDdeItemDouble( SequenceInputStream& rStrm ) { appendResultValue( rStrm.readDouble() ); } -void ExternalName::importDdeItemError( RecordInputStream& rStrm ) +void ExternalName::importDdeItemError( SequenceInputStream& rStrm ) { appendResultValue( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ); } -void ExternalName::importDdeItemString( RecordInputStream& rStrm ) +void ExternalName::importDdeItemString( SequenceInputStream& rStrm ) { - appendResultValue( rStrm.readString() ); + appendResultValue( BiffHelper::readString( rStrm ) ); } void ExternalName::importExternalName( BiffInputStream& rStrm ) @@ -543,32 +543,32 @@ ExternalNameRef ExternalLink::importOleItem( const AttributeList& rAttribs ) return xExtName; } -void ExternalLink::importExternalRef( RecordInputStream& rStrm ) +void ExternalLink::importExternalRef( SequenceInputStream& rStrm ) { rStrm >> maRelId; } -void ExternalLink::importExternalSelf( RecordInputStream& ) +void ExternalLink::importExternalSelf( SequenceInputStream& ) { meLinkType = LINKTYPE_SELF; } -void ExternalLink::importExternalSame( RecordInputStream& ) +void ExternalLink::importExternalSame( SequenceInputStream& ) { meLinkType = LINKTYPE_SAME; } -void ExternalLink::importExternalAddin( RecordInputStream& ) +void ExternalLink::importExternalAddin( SequenceInputStream& ) { meLinkType = LINKTYPE_UNKNOWN; } -void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputStream& rStrm ) +void ExternalLink::importExternalBook( const Relations& rRelations, SequenceInputStream& rStrm ) { switch( rStrm.readuInt16() ) { case BIFF12_EXTERNALBOOK_BOOK: - parseExternalReference( rRelations, rStrm.readString() ); + parseExternalReference( rRelations, BiffHelper::readString( rStrm ) ); break; case BIFF12_EXTERNALBOOK_DDE: { @@ -579,8 +579,8 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS break; case BIFF12_EXTERNALBOOK_OLE: { - OUString aTargetUrl = rRelations.getExternalTargetFromRelId( rStrm.readString() ); - OUString aProgId = rStrm.readString(); + OUString aTargetUrl = rRelations.getExternalTargetFromRelId( BiffHelper::readString( rStrm ) ); + OUString aProgId = BiffHelper::readString( rStrm ); setDdeOleTargetUrl( aProgId, aTargetUrl, LINKTYPE_OLE ); } break; @@ -589,17 +589,17 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS } } -void ExternalLink::importExtSheetNames( RecordInputStream& rStrm ) +void ExternalLink::importExtSheetNames( SequenceInputStream& rStrm ) { // load external sheet names and create the sheet caches in the Calc document OSL_ENSURE( (meLinkType == LINKTYPE_EXTERNAL) || (meLinkType == LINKTYPE_LIBRARY), "ExternalLink::importExtSheetNames - invalid link type" ); if( meLinkType == LINKTYPE_EXTERNAL ) // ignore sheets of external libraries for( sal_Int32 nSheet = 0, nCount = rStrm.readInt32(); !rStrm.isEof() && (nSheet < nCount); ++nSheet ) - insertExternalSheet( rStrm.readString() ); + insertExternalSheet( BiffHelper::readString( rStrm ) ); } -ExternalNameRef ExternalLink::importExternalName( RecordInputStream& rStrm ) +ExternalNameRef ExternalLink::importExternalName( SequenceInputStream& rStrm ) { ExternalNameRef xExtName = createExternalName(); xExtName->importExternalName( rStrm ); @@ -718,7 +718,7 @@ sal_Int16 ExternalLink::getCalcSheetIndex( sal_Int32 nTabId ) const OSL_ENSURE( meLinkType == LINKTYPE_INTERNAL, "ExternalLink::getCalcSheetIndex - invalid link type" ); OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8), "ExternalLink::getCalcSheetIndex - invalid sheet index" ); - return ContainerHelper::getVectorElement< sal_Int16 >( maCalcSheets, nTabId, -1 ); + return ContainerHelper::getVectorElement( maCalcSheets, nTabId, -1 ); } sal_Int32 ExternalLink::getDocumentLinkIndex() const @@ -732,7 +732,7 @@ sal_Int32 ExternalLink::getSheetCacheIndex( sal_Int32 nTabId ) const OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getSheetCacheIndex - invalid link type" ); OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8), "ExternalLink::getSheetCacheIndex - invalid sheet index" ); - return ContainerHelper::getVectorElement< sal_Int32 >( maSheetCaches, nTabId, -1 ); + return ContainerHelper::getVectorElement( maSheetCaches, nTabId, -1 ); } Reference< XExternalSheetCache > ExternalLink::getSheetCache( sal_Int32 nTabId ) const @@ -926,7 +926,7 @@ RefSheetsModel::RefSheetsModel() : { } -void RefSheetsModel::readBiff12Data( RecordInputStream& rStrm ) +void RefSheetsModel::readBiff12Data( SequenceInputStream& rStrm ) { rStrm >> mnExtRefId >> mnTabId1 >> mnTabId2; } @@ -956,7 +956,7 @@ ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList return xExtLink; } -ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm ) +ExternalLinkRef ExternalLinkBuffer::importExternalRef( SequenceInputStream& rStrm ) { mbUseRefSheets = true; ExternalLinkRef xExtLink = createExternalLink(); @@ -965,25 +965,25 @@ ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm return xExtLink; } -void ExternalLinkBuffer::importExternalSelf( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalSelf( SequenceInputStream& rStrm ) { mbUseRefSheets = true; createExternalLink()->importExternalSelf( rStrm ); } -void ExternalLinkBuffer::importExternalSame( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalSame( SequenceInputStream& rStrm ) { mbUseRefSheets = true; createExternalLink()->importExternalSame( rStrm ); } -void ExternalLinkBuffer::importExternalAddin( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalAddin( SequenceInputStream& rStrm ) { mbUseRefSheets = true; createExternalLink()->importExternalAddin( rStrm ); } -void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalSheets( SequenceInputStream& rStrm ) { OSL_ENSURE( mbUseRefSheets, "ExternalLinkBuffer::importExternalSheets - missing EXTERNALREFS records" ); mbUseRefSheets = true; diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index 9d984c918145..094b192b817c 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -95,7 +95,7 @@ void ExternalSheetDataContext::onCharacters( const OUString& rChars ) } } -ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -126,35 +126,35 @@ void ExternalSheetDataContext::importCell( const AttributeList& rAttribs ) mnCurrType = XML_TOKEN_INVALID; } -void ExternalSheetDataContext::importExtCellBlank( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellBlank( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); setCellValue( Any( OUString() ) ); } -void ExternalSheetDataContext::importExtCellBool( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellBool( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0; setCellValue( Any( fValue ) ); } -void ExternalSheetDataContext::importExtCellDouble( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellDouble( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); setCellValue( Any( rStrm.readDouble() ) ); } -void ExternalSheetDataContext::importExtCellError( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellError( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); setCellValue( Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) ); } -void ExternalSheetDataContext::importExtCellString( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellString( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); - setCellValue( Any( rStrm.readString() ) ); + setCellValue( Any( BiffHelper::readString( rStrm ) ) ); } void ExternalSheetDataContext::setCellValue( const Any& rValue ) @@ -280,7 +280,7 @@ void ExternalLinkFragment::onEndElement() } } -ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index 21dd049c0515..c0ad5d513709 100644 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -43,7 +43,7 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include "oox/core/filterbase.hxx" -#include "oox/helper/recordinputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -109,7 +109,7 @@ void BinSingleRef2d::setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelat mnRow -= 0x10000; } -void BinSingleRef2d::readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ) +void BinSingleRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ) { sal_Int32 nRow; sal_uInt16 nCol; @@ -134,7 +134,7 @@ void BinSingleRef2d::readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffs // ---------------------------------------------------------------------------- -void BinComplexRef2d::readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ) +void BinComplexRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ) { sal_Int32 nRow1, nRow2; sal_uInt16 nCol1, nCol2; diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx index 7ab32981a6ba..8b1f1b809d88 100644 --- a/oox/source/xls/formulaparser.cxx +++ b/oox/source/xls/formulaparser.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/sheet/ReferenceFlags.hpp> #include <com/sun/star/sheet/SingleReference.hpp> #include "oox/core/filterbase.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" @@ -419,7 +418,7 @@ public: /** Imports and converts a BIFF12 token array from the passed stream. */ virtual void importBiff12Formula( FormulaContext& rContext, - RecordInputStream& rStrm ); + SequenceInputStream& rStrm ); /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. */ virtual void importBiffFormula( @@ -583,7 +582,7 @@ void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& ) OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" ); } -void FormulaParserImpl::importBiff12Formula( FormulaContext&, RecordInputStream& ) +void FormulaParserImpl::importBiff12Formula( FormulaContext&, SequenceInputStream& ) { OSL_ENSURE( false, "FormulaParserImpl::importBiff12Formula - not implemented" ); } @@ -1241,31 +1240,31 @@ public: virtual void importBiff12Formula( FormulaContext& rContext, - RecordInputStream& rStrm ); + SequenceInputStream& rStrm ); private: // import token contents and create API formula token --------------------- - bool importAttrToken( RecordInputStream& rStrm ); - bool importSpaceToken( RecordInputStream& rStrm ); - bool importTableToken( RecordInputStream& rStrm ); - bool importArrayToken( RecordInputStream& rStrm ); - bool importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importMemAreaToken( RecordInputStream& rStrm, bool bAddData ); - bool importMemFuncToken( RecordInputStream& rStrm ); - bool importNameToken( RecordInputStream& rStrm ); - bool importNameXToken( RecordInputStream& rStrm ); - bool importFuncToken( RecordInputStream& rStrm ); - bool importFuncVarToken( RecordInputStream& rStrm ); - bool importExpToken( RecordInputStream& rStrm ); - - LinkSheetRange readSheetRange( RecordInputStream& rStrm ); - - void swapStreamPosition( RecordInputStream& rStrm ); - void skipMemAreaAddData( RecordInputStream& rStrm ); + bool importAttrToken( SequenceInputStream& rStrm ); + bool importSpaceToken( SequenceInputStream& rStrm ); + bool importTableToken( SequenceInputStream& rStrm ); + bool importArrayToken( SequenceInputStream& rStrm ); + bool importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importMemAreaToken( SequenceInputStream& rStrm, bool bAddData ); + bool importMemFuncToken( SequenceInputStream& rStrm ); + bool importNameToken( SequenceInputStream& rStrm ); + bool importNameXToken( SequenceInputStream& rStrm ); + bool importFuncToken( SequenceInputStream& rStrm ); + bool importFuncVarToken( SequenceInputStream& rStrm ); + bool importExpToken( SequenceInputStream& rStrm ); + + LinkSheetRange readSheetRange( SequenceInputStream& rStrm ); + + void swapStreamPosition( SequenceInputStream& rStrm ); + void skipMemAreaAddData( SequenceInputStream& rStrm ); // convert BIN token and push API operand or operator --------------------- @@ -1301,7 +1300,7 @@ void OoxFormulaParserImpl::importOoxFormula( FormulaContext& rContext, const OUS finalizeImport( maApiParser.parseFormula( rFormulaString, rContext.getBaseAddress() ) ); } -void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, RecordInputStream& rStrm ) +void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, SequenceInputStream& rStrm ) { initializeImport( rContext ); @@ -1330,34 +1329,34 @@ void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, Record // base tokens switch( nBaseId ) { - case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break; - case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break; - case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break; - case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break; - case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break; - case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break; - case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break; - case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break; - case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break; - case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break; - case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break; - case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break; - case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break; - case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break; - case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break; - case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break; - case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break; - case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break; - case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break; - case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break; - case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break; - case BIFF_TOKID_STR: bOk = pushValueOperand( rStrm.readString( false ) ); break; - case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break; - case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break; - case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break; - case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break; - case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break; - case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break; + case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break; + case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break; + case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break; + case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break; + case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break; + case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break; + case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break; + case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break; + case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break; + case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break; + case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break; + case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break; + case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break; + case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break; + case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break; + case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break; + case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break; + case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break; + case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break; + case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break; + case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break; + case BIFF_TOKID_STR: bOk = pushValueOperand( BiffHelper::readString( rStrm, false ) ); break; + case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break; + case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break; + case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break; + case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break; + case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break; + case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break; default: bOk = false; } } @@ -1403,7 +1402,7 @@ void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, Record // import token contents and create API formula token ------------------------- -bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importAttrToken( SequenceInputStream& rStrm ) { bool bOk = true; sal_uInt8 nType; @@ -1436,7 +1435,7 @@ bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm ) return bOk; } -bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importSpaceToken( SequenceInputStream& rStrm ) { // equal constants in BIFF and OOX sal_uInt8 nType, nCount; @@ -1465,7 +1464,7 @@ bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm ) return true; } -bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importTableToken( SequenceInputStream& rStrm ) { sal_uInt16 nFlags, nTableId, nCol1, nCol2; rStrm.skip( 3 ); @@ -1590,7 +1589,7 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm ) return pushBiffErrorOperand( BIFF_ERR_REF ); } -bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importArrayToken( SequenceInputStream& rStrm ) { rStrm.skip( 14 ); @@ -1620,7 +1619,7 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) appendRawToken( OPCODE_PUSH ) <<= rStrm.readDouble(); break; case BIFF_TOK_ARRAY_STRING: - appendRawToken( OPCODE_PUSH ) <<= rStrm.readString( false ); + appendRawToken( OPCODE_PUSH ) <<= BiffHelper::readString( rStrm, false ); break; case BIFF_TOK_ARRAY_BOOL: appendRawToken( OPCODE_PUSH ) <<= static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 ); @@ -1643,21 +1642,21 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) return true; } -bool OoxFormulaParserImpl::importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { BinSingleRef2d aRef; aRef.readBiff12Data( rStrm, bRelativeAsOffset ); return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { BinComplexRef2d aRef; aRef.readBiff12Data( rStrm, bRelativeAsOffset ); return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { LinkSheetRange aSheetRange = readSheetRange( rStrm ); BinSingleRef2d aRef; @@ -1665,7 +1664,7 @@ bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDel return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { LinkSheetRange aSheetRange = readSheetRange( rStrm ); BinComplexRef2d aRef; @@ -1673,7 +1672,7 @@ bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDe return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bAddData ) +bool OoxFormulaParserImpl::importMemAreaToken( SequenceInputStream& rStrm, bool bAddData ) { rStrm.skip( 6 ); if( bAddData ) @@ -1681,32 +1680,32 @@ bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bA return true; } -bool OoxFormulaParserImpl::importMemFuncToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importMemFuncToken( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); return true; } -bool OoxFormulaParserImpl::importNameToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importNameToken( SequenceInputStream& rStrm ) { return pushBiff12Name( rStrm.readInt32() ); } -bool OoxFormulaParserImpl::importNameXToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importNameXToken( SequenceInputStream& rStrm ) { sal_Int32 nRefId = rStrm.readInt16(); sal_Int32 nNameId = rStrm.readInt32(); return pushBiff12ExtName( nRefId, nNameId ); } -bool OoxFormulaParserImpl::importFuncToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importFuncToken( SequenceInputStream& rStrm ) { sal_uInt16 nFuncId; rStrm >> nFuncId; return pushBiff12Function( nFuncId ); } -bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importFuncVarToken( SequenceInputStream& rStrm ) { sal_uInt8 nParamCount; sal_uInt16 nFuncId; @@ -1714,7 +1713,7 @@ bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm ) return pushBiff12Function( nFuncId, nParamCount ); } -bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importExpToken( SequenceInputStream& rStrm ) { BinAddress aBaseAddr; rStrm >> aBaseAddr.mnRow; @@ -1726,19 +1725,19 @@ bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm ) return false; } -LinkSheetRange OoxFormulaParserImpl::readSheetRange( RecordInputStream& rStrm ) +LinkSheetRange OoxFormulaParserImpl::readSheetRange( SequenceInputStream& rStrm ) { return getExternalLinks().getSheetRange( rStrm.readInt16() ); } -void OoxFormulaParserImpl::swapStreamPosition( RecordInputStream& rStrm ) +void OoxFormulaParserImpl::swapStreamPosition( SequenceInputStream& rStrm ) { sal_Int64 nRecPos = rStrm.tell(); rStrm.seek( mnAddDataPos ); mnAddDataPos = nRecPos; } -void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm ) +void OoxFormulaParserImpl::skipMemAreaAddData( SequenceInputStream& rStrm ) { swapStreamPosition( rStrm ); rStrm.skip( 16 * rStrm.readInt32() ); @@ -2771,7 +2770,7 @@ void FormulaParser::importFormula( FormulaContext& rContext, const OUString& rFo mxImpl->importOoxFormula( rContext, rFormulaString ); } -void FormulaParser::importFormula( FormulaContext& rContext, RecordInputStream& rStrm ) const +void FormulaParser::importFormula( FormulaContext& rContext, SequenceInputStream& rStrm ) const { mxImpl->importBiff12Formula( rContext, rStrm ); } @@ -2833,7 +2832,7 @@ OUString FormulaParser::importOleTargetLink( const OUString& rFormulaString ) return OUString(); } -OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm ) +OUString FormulaParser::importOleTargetLink( SequenceInputStream& rStrm ) { OUString aTargetLink; sal_Int32 nFmlaSize = rStrm.readInt32(); diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index f610167e5edd..c77381b2a1c8 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -40,7 +40,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -1998,10 +1997,10 @@ NumberFormatRef NumberFormatsBuffer::importNumFmt( const AttributeList& rAttribs return createNumFmt( nNumFmtId, aFmtCode ); } -void NumberFormatsBuffer::importNumFmt( RecordInputStream& rStrm ) +void NumberFormatsBuffer::importNumFmt( SequenceInputStream& rStrm ) { sal_Int32 nNumFmtId = rStrm.readuInt16(); - OUString aFmtCode = rStrm.readString(); + OUString aFmtCode = BiffHelper::readString( rStrm ); createNumFmt( nNumFmtId, aFmtCode ); } diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx index b50a23989356..188bf78544ec 100644 --- a/oox/source/xls/pagesettings.cxx +++ b/oox/source/xls/pagesettings.cxx @@ -44,7 +44,6 @@ #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelhandlers.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -242,14 +241,14 @@ void PageSettings::importPicture( const Relations& rRelations, const AttributeLi importPictureData( rRelations, rAttribs.getString( R_TOKEN( id ), OUString() ) ); } -void PageSettings::importPageMargins( RecordInputStream& rStrm ) +void PageSettings::importPageMargins( SequenceInputStream& rStrm ) { rStrm >> maModel.mfLeftMargin >> maModel.mfRightMargin >> maModel.mfTopMargin >> maModel.mfBottomMargin >> maModel.mfHeaderMargin >> maModel.mfFooterMargin; } -void PageSettings::importPrintOptions( RecordInputStream& rStrm ) +void PageSettings::importPrintOptions( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags; @@ -259,7 +258,7 @@ void PageSettings::importPrintOptions( RecordInputStream& rStrm ) maModel.mbPrintHeadings = getFlag( nFlags, BIFF12_PRINTOPT_PRINTHEADING ); } -void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStream& rStrm ) +void PageSettings::importPageSetup( const Relations& rRelations, SequenceInputStream& rStrm ) { OUString aRelId; sal_uInt16 nFlags; @@ -279,7 +278,7 @@ void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStre maModel.mbDraftQuality = getFlag( nFlags, BIFF12_PAGESETUP_DRAFTQUALITY ); } -void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInputStream& rStrm ) +void PageSettings::importChartPageSetup( const Relations& rRelations, SequenceInputStream& rStrm ) { OUString aRelId; sal_uInt16 nFirstPage, nFlags; @@ -294,7 +293,7 @@ void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInpu maModel.mbDraftQuality = getFlag( nFlags, BIFF12_CHARTPAGESETUP_DRAFTQUALITY ); } -void PageSettings::importHeaderFooter( RecordInputStream& rStrm ) +void PageSettings::importHeaderFooter( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags @@ -305,9 +304,9 @@ void PageSettings::importHeaderFooter( RecordInputStream& rStrm ) maModel.mbUseFirstHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFFIRST ); } -void PageSettings::importPicture( const Relations& rRelations, RecordInputStream& rStrm ) +void PageSettings::importPicture( const Relations& rRelations, SequenceInputStream& rStrm ) { - importPictureData( rRelations, rStrm.readString() ); + importPictureData( rRelations, BiffHelper::readString( rStrm ) ); } void PageSettings::importLeftMargin( BiffInputStream& rStrm ) diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx index 76fd48dc3ab1..e8ca3539e167 100644 --- a/oox/source/xls/pivotcachebuffer.cxx +++ b/oox/source/xls/pivotcachebuffer.cxx @@ -38,8 +38,8 @@ #include <rtl/ustrbuf.hxx> #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" #include "oox/xls/excelhandlers.hxx" @@ -212,19 +212,19 @@ void PivotCacheItem::readIndex( const AttributeList& rAttribs ) mnType = XML_x; } -void PivotCacheItem::readString( RecordInputStream& rStrm ) +void PivotCacheItem::readString( SequenceInputStream& rStrm ) { - maValue <<= rStrm.readString(); + maValue <<= BiffHelper::readString( rStrm ); mnType = XML_s; } -void PivotCacheItem::readDouble( RecordInputStream& rStrm ) +void PivotCacheItem::readDouble( SequenceInputStream& rStrm ) { maValue <<= rStrm.readDouble(); mnType = XML_n; } -void PivotCacheItem::readDate( RecordInputStream& rStrm ) +void PivotCacheItem::readDate( SequenceInputStream& rStrm ) { DateTime aDateTime; aDateTime.Year = rStrm.readuInt16(); @@ -238,19 +238,19 @@ void PivotCacheItem::readDate( RecordInputStream& rStrm ) mnType = XML_d; } -void PivotCacheItem::readBool( RecordInputStream& rStrm ) +void PivotCacheItem::readBool( SequenceInputStream& rStrm ) { maValue <<= (rStrm.readuInt8() != 0); mnType = XML_b; } -void PivotCacheItem::readError( RecordInputStream& rStrm ) +void PivotCacheItem::readError( SequenceInputStream& rStrm ) { maValue <<= static_cast< sal_Int32 >( rStrm.readuInt8() ); mnType = XML_e; } -void PivotCacheItem::readIndex( RecordInputStream& rStrm ) +void PivotCacheItem::readIndex( SequenceInputStream& rStrm ) { maValue <<= rStrm.readInt32(); mnType = XML_x; @@ -338,7 +338,7 @@ void PivotCacheItemList::importItem( sal_Int32 nElement, const AttributeList& rA } } -void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheItemList::importItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( nRecId == BIFF12_ID_PCITEM_ARRAY ) { @@ -407,7 +407,7 @@ PivotCacheItem& PivotCacheItemList::createItem() return maItems.back(); } -void PivotCacheItemList::importArray( RecordInputStream& rStrm ) +void PivotCacheItemList::importArray( SequenceInputStream& rStrm ) { sal_uInt16 nType = rStrm.readuInt16(); sal_Int32 nCount = rStrm.readInt32(); @@ -558,7 +558,7 @@ void PivotCacheField::importGroupItem( sal_Int32 nElement, const AttributeList& maGroupItems.importItem( nElement, rAttribs ); } -void PivotCacheField::importPCDField( RecordInputStream& rStrm ) +void PivotCacheField::importPCDField( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags >> maFieldModel.mnNumFmtId; @@ -579,7 +579,7 @@ void PivotCacheField::importPCDField( RecordInputStream& rStrm ) maFieldModel.mbMemberPropField = getFlag( nFlags, BIFF12_PCDFIELD_MEMBERPROPFIELD ); } -void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm ) +void PivotCacheField::importPCDFSharedItems( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags; @@ -594,17 +594,17 @@ void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm ) maSharedItemsModel.mbHasLongText = getFlag( nFlags, BIFF12_PCDFSITEMS_HASLONGTEXT ); } -void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { maSharedItems.importItem( nRecId, rStrm ); } -void PivotCacheField::importPCDFieldGroup( RecordInputStream& rStrm ) +void PivotCacheField::importPCDFieldGroup( SequenceInputStream& rStrm ) { rStrm >> maFieldGroupModel.mnParentField >> maFieldGroupModel.mnBaseField; } -void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm ) +void PivotCacheField::importPCDFRangePr( SequenceInputStream& rStrm ) { sal_uInt8 nGroupBy, nFlags; rStrm >> nGroupBy >> nFlags >> maFieldGroupModel.mfStartValue >> maFieldGroupModel.mfEndValue >> maFieldGroupModel.mfInterval; @@ -623,14 +623,14 @@ void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm ) } } -void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { OSL_ENSURE( nRecId == BIFF12_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" ); if( nRecId == BIFF12_ID_PCITEM_INDEX ) maDiscreteItems.push_back( rStrm.readInt32() ); } -void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { maGroupItems.importItem( nRecId, rStrm ); } @@ -833,7 +833,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie typedef ::std::vector< GroupItemList > GroupItemMap; GroupItemMap aItemMap( maGroupItems.size() ); for( IndexVector::const_iterator aBeg = maDiscreteItems.begin(), aIt = aBeg, aEnd = maDiscreteItems.end(); aIt != aEnd; ++aIt ) - if( GroupItemList* pItems = ContainerHelper::getVectorElement( aItemMap, *aIt ) ) + if( GroupItemList* pItems = ContainerHelper::getVectorElementAccess( aItemMap, *aIt ) ) pItems->push_back( static_cast< sal_Int32 >( aIt - aBeg ) ); // process all groups @@ -920,7 +920,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie } // replace original item names in passed vector with group name for( GroupItemList::iterator aIt2 = aIt->begin(), aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 ) - if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElement( orItemNames, *aIt2 ) ) + if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElementAccess( orItemNames, *aIt2 ) ) pName->maGroupName = aGroupName; } } @@ -949,7 +949,7 @@ void PivotCacheField::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_In writeItemToSourceDataCell( rSheetHelper, nCol, nRow, rItem ); } -void PivotCacheField::importPCRecordItem( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const +void PivotCacheField::importPCRecordItem( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const { if( hasSharedItems() ) { @@ -1084,7 +1084,7 @@ void PivotCache::importWorksheetSource( const AttributeList& rAttribs, const Rel getAddressConverter().convertToCellRangeUnchecked( maSheetSrcModel.maRange, rAttribs.getString( XML_ref, OUString() ), 0 ); } -void PivotCache::importPCDefinition( RecordInputStream& rStrm ) +void PivotCache::importPCDefinition( SequenceInputStream& rStrm ) { sal_uInt8 nFlags1, nFlags2; rStrm.skip( 3 ); // create/refresh version id's @@ -1106,7 +1106,7 @@ void PivotCache::importPCDefinition( RecordInputStream& rStrm ) maDefModel.mbSupportDrill = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTDRILL ); } -void PivotCache::importPCDSource( RecordInputStream& rStrm ) +void PivotCache::importPCDSource( SequenceInputStream& rStrm ) { sal_Int32 nSourceType; rStrm >> nSourceType >> maSourceModel.mnConnectionId; @@ -1114,7 +1114,7 @@ void PivotCache::importPCDSource( RecordInputStream& rStrm ) maSourceModel.mnSourceType = STATIC_ARRAY_SELECT( spnSourceTypes, nSourceType, XML_TOKEN_INVALID ); } -void PivotCache::importPCDSheetSource( RecordInputStream& rStrm, const Relations& rRelations ) +void PivotCache::importPCDSheetSource( SequenceInputStream& rStrm, const Relations& rRelations ) { sal_uInt8 nIsDefName, nIsBuiltinName, nFlags; rStrm >> nIsDefName >> nIsBuiltinName >> nFlags; @@ -1264,7 +1264,7 @@ const PivotCacheField* PivotCache::getCacheField( sal_Int32 nFieldIdx ) const sal_Int32 PivotCache::getCacheDatabaseIndex( sal_Int32 nFieldIdx ) const { - return ContainerHelper::getVectorElement< sal_Int32 >( maDatabaseIndexes, nFieldIdx, -1 ); + return ContainerHelper::getVectorElement( maDatabaseIndexes, nFieldIdx, -1 ); } void PivotCache::writeSourceHeaderCells( WorksheetHelper& rSheetHelper ) const @@ -1286,7 +1286,7 @@ void PivotCache::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 n pCacheField->writeSourceDataCell( rSheetHelper, maSheetSrcModel.maRange.StartColumn + nCol, maSheetSrcModel.maRange.StartRow + nRow, rItem ); } -void PivotCache::importPCRecord( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const +void PivotCache::importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const { OSL_ENSURE( (0 < nRow) && (nRow <= maSheetSrcModel.maRange.EndRow - maSheetSrcModel.maRange.StartRow), "PivotCache::importPCRecord - invalid row index" ); sal_Int32 nCol = maSheetSrcModel.maRange.StartColumn; @@ -1504,7 +1504,7 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId ) { /* Resolve cache index to cache identifier and try to find pivot cache. Cache must exist already for a valid cache index. */ - nCacheId = ContainerHelper::getVectorElement< sal_Int32 >( maCacheIds, nCacheId, -1 ); + nCacheId = ContainerHelper::getVectorElement( maCacheIds, nCacheId, -1 ); PivotCache* pCache = maCaches.get( nCacheId ).get(); if( !pCache ) return 0; diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx index 68e24c03c3d7..d49077af4f91 100644 --- a/oox/source/xls/pivotcachefragment.cxx +++ b/oox/source/xls/pivotcachefragment.cxx @@ -28,7 +28,6 @@ #include "oox/xls/pivotcachefragment.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pivotcachebuffer.hxx" @@ -82,7 +81,7 @@ void PivotCacheFieldContext::onStartElement( const AttributeList& rAttribs ) mrCacheField.importCacheField( rAttribs ); } -ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -110,7 +109,7 @@ ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecI return 0; } -void PivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm ) +void PivotCacheFieldContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrCacheField.importPCDField( rStrm ); @@ -152,7 +151,7 @@ ContextHandlerRef PivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElem return 0; } -ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -261,7 +260,7 @@ ContextHandlerRef PivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement return 0; } -ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -300,14 +299,14 @@ void PivotCacheRecordsFragment::startCacheRecord() mbInRecord = true; } -void PivotCacheRecordsFragment::importPCRecord( RecordInputStream& rStrm ) +void PivotCacheRecordsFragment::importPCRecord( SequenceInputStream& rStrm ) { startCacheRecord(); mrPivotCache.importPCRecord( rStrm, *this, mnRow ); mbInRecord = false; } -void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( mbInRecord ) { diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx index be48e63f001f..7cdeddaa879b 100644 --- a/oox/source/xls/pivottablebuffer.cxx +++ b/oox/source/xls/pivottablebuffer.cxx @@ -47,8 +47,8 @@ #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp> #include <com/sun/star/sheet/XSheetOperation.hpp> #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -383,7 +383,7 @@ void PivotTableField::importReferenceItem( const AttributeList& rAttribs ) maModel.mnSortRefItem = rAttribs.getInteger( XML_v, -1 ); } -void PivotTableField::importPTField( RecordInputStream& rStrm ) +void PivotTableField::importPTField( SequenceInputStream& rStrm ) { sal_uInt32 nFlags1, nFlags2; rStrm >> nFlags1 >> maModel.mnNumFmtId >> nFlags2 >> maModel.mnAutoShowItems >> maModel.mnAutoShowRankBy; @@ -417,7 +417,7 @@ void PivotTableField::importPTField( RecordInputStream& rStrm ) maModel.mnSortType = bAutoSort ? (bAscending ? XML_ascending : XML_descending) : XML_manual; } -void PivotTableField::importPTFItem( RecordInputStream& rStrm ) +void PivotTableField::importPTFItem( SequenceInputStream& rStrm ) { PTFieldItemModel aModel; sal_uInt8 nType; @@ -431,12 +431,12 @@ void PivotTableField::importPTFItem( RecordInputStream& rStrm ) maItems.push_back( aModel ); } -void PivotTableField::importPTReference( RecordInputStream& rStrm ) +void PivotTableField::importPTReference( SequenceInputStream& rStrm ) { rStrm >> maModel.mnSortRefField; } -void PivotTableField::importPTReferenceItem( RecordInputStream& rStrm ) +void PivotTableField::importPTReferenceItem( SequenceInputStream& rStrm ) { rStrm >> maModel.mnSortRefItem; } @@ -906,7 +906,7 @@ void PivotTableFilter::importTop10( const AttributeList& rAttribs ) maModel.mbTopFilter = rAttribs.getBool( XML_top, true ); } -void PivotTableFilter::importPTFilter( RecordInputStream& rStrm ) +void PivotTableFilter::importPTFilter( SequenceInputStream& rStrm ) { sal_Int32 nType; sal_uInt16 nFlags; @@ -946,7 +946,7 @@ void PivotTableFilter::importPTFilter( RecordInputStream& rStrm ) maModel.mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID ); } -void PivotTableFilter::importTop10Filter( RecordInputStream& rStrm ) +void PivotTableFilter::importTop10Filter( SequenceInputStream& rStrm ) { sal_uInt8 nFlags; rStrm >> nFlags >> maModel.mfValue; @@ -1128,7 +1128,7 @@ void PivotTable::importDataField( const AttributeList& rAttribs ) maDataFields.push_back( aModel ); } -void PivotTable::importPTDefinition( RecordInputStream& rStrm ) +void PivotTable::importPTDefinition( SequenceInputStream& rStrm ) { sal_uInt32 nFlags1, nFlags2, nFlags3; sal_uInt8 nDataAxis; @@ -1196,7 +1196,7 @@ void PivotTable::importPTDefinition( RecordInputStream& rStrm ) maDefModel.mbCustomListSort = !getFlag( nFlags3, BIFF12_PTDEF_NOCUSTOMLISTSORT ); } -void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet ) +void PivotTable::importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet ) { BinRange aBinRange; rStrm >> aBinRange >> maLocationModel.mnFirstHeaderRow @@ -1205,17 +1205,17 @@ void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet ) getAddressConverter().convertToCellRangeUnchecked( maLocationModel.maRange, aBinRange, nSheet ); } -void PivotTable::importPTRowFields( RecordInputStream& rStrm ) +void PivotTable::importPTRowFields( SequenceInputStream& rStrm ) { importFields( maRowFields, rStrm ); } -void PivotTable::importPTColFields( RecordInputStream& rStrm ) +void PivotTable::importPTColFields( SequenceInputStream& rStrm ) { importFields( maColFields, rStrm ); } -void PivotTable::importPTPageField( RecordInputStream& rStrm ) +void PivotTable::importPTPageField( SequenceInputStream& rStrm ) { PTPageFieldModel aModel; sal_uInt8 nFlags; @@ -1227,7 +1227,7 @@ void PivotTable::importPTPageField( RecordInputStream& rStrm ) maPageFields.push_back( aModel ); } -void PivotTable::importPTDataField( RecordInputStream& rStrm ) +void PivotTable::importPTDataField( SequenceInputStream& rStrm ) { PTDataFieldModel aModel; sal_Int32 nSubtotal, nShowDataAs; @@ -1521,7 +1521,7 @@ void PivotTable::importField( IndexVector& orFields, const AttributeList& rAttri orFields.push_back( rAttribs.getInteger( XML_x, -1 ) ); } -void PivotTable::importFields( IndexVector& orFields, RecordInputStream& rStrm ) +void PivotTable::importFields( IndexVector& orFields, SequenceInputStream& rStrm ) { OSL_ENSURE( orFields.empty(), "PivotTable::importFields - multiple record instances" ); orFields.clear(); diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx index 7c16eb7c5b51..6e28118711c9 100644 --- a/oox/source/xls/pivottablefragment.cxx +++ b/oox/source/xls/pivottablefragment.cxx @@ -83,7 +83,7 @@ void PivotTableFieldContext::onStartElement( const AttributeList& rAttribs ) mrTableField.importPivotField( rAttribs ); } -ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -113,7 +113,7 @@ ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecI return 0; } -void PivotTableFieldContext::onStartRecord( RecordInputStream& rStrm ) +void PivotTableFieldContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrTableField.importPTField( rStrm ); @@ -150,7 +150,7 @@ void PivotTableFilterContext::onStartElement( const AttributeList& rAttribs ) mrTableFilter.importFilter( rAttribs ); } -ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -167,7 +167,7 @@ ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRec return 0; } -void PivotTableFilterContext::onStartRecord( RecordInputStream& rStrm ) +void PivotTableFilterContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrTableFilter.importPTFilter( rStrm ); @@ -224,7 +224,7 @@ ContextHandlerRef PivotTableFragment::onCreateContext( sal_Int32 nElement, const return 0; } -ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx index 26f677f1bbc3..28ace4de52d8 100644 --- a/oox/source/xls/querytablebuffer.cxx +++ b/oox/source/xls/querytablebuffer.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/sheet/XAreaLinks.hpp> #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/connectionsbuffer.hxx" @@ -219,7 +218,7 @@ void QueryTable::importQueryTable( const AttributeList& rAttribs ) maModel.mbApplyProtection = rAttribs.getBool( XML_applyWidthHeightFormats, false ); } -void QueryTable::importQueryTable( RecordInputStream& rStrm ) +void QueryTable::importQueryTable( SequenceInputStream& rStrm ) { sal_uInt32 nFlags; rStrm >> nFlags; diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx index a6ed80af2194..c74aa53a581e 100644 --- a/oox/source/xls/querytablefragment.cxx +++ b/oox/source/xls/querytablefragment.cxx @@ -59,7 +59,7 @@ ContextHandlerRef QueryTableFragment::onCreateContext( sal_Int32 nElement, const return 0; } -ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/richstring.cxx b/oox/source/xls/richstring.cxx index 2fc659f83536..5c79373b09b2 100644 --- a/oox/source/xls/richstring.cxx +++ b/oox/source/xls/richstring.cxx @@ -31,7 +31,6 @@ #include <rtl/ustrbuf.hxx> #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -108,7 +107,7 @@ void RichStringPortion::convert( const Reference< XText >& rxText, sal_Int32 nXf // ---------------------------------------------------------------------------- -void FontPortionModel::read( RecordInputStream& rStrm ) +void FontPortionModel::read( SequenceInputStream& rStrm ) { mnPos = rStrm.readuInt16(); mnFontId = rStrm.readuInt16(); @@ -146,7 +145,7 @@ void FontPortionModelList::appendPortion( const FontPortionModel& rPortion ) back().mnFontId = rPortion.mnFontId; } -void FontPortionModelList::importPortions( RecordInputStream& rStrm ) +void FontPortionModelList::importPortions( SequenceInputStream& rStrm ) { sal_Int32 nCount = rStrm.readInt32(); clear(); @@ -216,7 +215,7 @@ void PhoneticSettings::importPhoneticPr( const AttributeList& rAttribs ) maModel.mnAlignment = rAttribs.getToken( XML_alignment, XML_left ); } -void PhoneticSettings::importPhoneticPr( RecordInputStream& rStrm ) +void PhoneticSettings::importPhoneticPr( SequenceInputStream& rStrm ) { sal_uInt16 nFontId; sal_Int32 nType, nAlignment; @@ -234,7 +233,7 @@ void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm ) // following: range list with cells showing phonetic text } -void PhoneticSettings::importStringData( RecordInputStream& rStrm ) +void PhoneticSettings::importStringData( SequenceInputStream& rStrm ) { sal_uInt16 nFontId, nFlags; rStrm >> nFontId >> nFlags; @@ -278,7 +277,7 @@ void RichStringPhonetic::setBaseRange( sal_Int32 nBasePos, sal_Int32 nBaseEnd ) // ---------------------------------------------------------------------------- -void PhoneticPortionModel::read( RecordInputStream& rStrm ) +void PhoneticPortionModel::read( SequenceInputStream& rStrm ) { mnPos = rStrm.readuInt16(); mnBasePos = rStrm.readuInt16(); @@ -311,7 +310,7 @@ void PhoneticPortionModelList::appendPortion( const PhoneticPortionModel& rPorti } } -void PhoneticPortionModelList::importPortions( RecordInputStream& rStrm ) +void PhoneticPortionModelList::importPortions( SequenceInputStream& rStrm ) { sal_Int32 nCount = rStrm.readInt32(); clear(); @@ -383,10 +382,10 @@ void RichString::importPhoneticPr( const AttributeList& rAttribs ) maPhonSettings.importPhoneticPr( rAttribs ); } -void RichString::importString( RecordInputStream& rStrm, bool bRich ) +void RichString::importString( SequenceInputStream& rStrm, bool bRich ) { sal_uInt8 nFlags = bRich ? rStrm.readuInt8() : 0; - OUString aBaseText = rStrm.readString(); + OUString aBaseText = BiffHelper::readString( rStrm ); if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) ) { @@ -401,7 +400,7 @@ void RichString::importString( RecordInputStream& rStrm, bool bRich ) if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) ) { - OUString aPhoneticText = rStrm.readString(); + OUString aPhoneticText = BiffHelper::readString( rStrm ); PhoneticPortionModelList aPortions; aPortions.importPortions( rStrm ); maPhonSettings.importStringData( rStrm ); diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx index 697b74889dad..8915f1ae0c7b 100644 --- a/oox/source/xls/scenariobuffer.cxx +++ b/oox/source/xls/scenariobuffer.cxx @@ -34,8 +34,8 @@ #include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -102,7 +102,7 @@ void Scenario::importInputCells( const AttributeList& rAttribs ) maCells.push_back( aModel ); } -void Scenario::importScenario( RecordInputStream& rStrm ) +void Scenario::importScenario( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); // cell count // two longs instead of flag field @@ -111,7 +111,7 @@ void Scenario::importScenario( RecordInputStream& rStrm ) rStrm >> maModel.maName >> maModel.maComment >> maModel.maUser; } -void Scenario::importInputCells( RecordInputStream& rStrm ) +void Scenario::importInputCells( SequenceInputStream& rStrm ) { // TODO: where is the deleted flag? ScenarioCellModel aModel; @@ -232,7 +232,7 @@ void SheetScenarios::importScenarios( const AttributeList& rAttribs ) maModel.mnShown = rAttribs.getInteger( XML_show, 0 ); } -void SheetScenarios::importScenarios( RecordInputStream& rStrm ) +void SheetScenarios::importScenarios( SequenceInputStream& rStrm ) { maModel.mnCurrent = rStrm.readuInt16(); maModel.mnShown = rStrm.readuInt16(); diff --git a/oox/source/xls/scenariocontext.cxx b/oox/source/xls/scenariocontext.cxx index 1ecb8ce1fe59..be44bc8545f2 100644 --- a/oox/source/xls/scenariocontext.cxx +++ b/oox/source/xls/scenariocontext.cxx @@ -61,7 +61,7 @@ void ScenarioContext::onStartElement( const AttributeList& rAttribs ) mrScenario.importScenario( rAttribs ); } -ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -72,7 +72,7 @@ ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, Reco return 0; } -void ScenarioContext::onStartRecord( RecordInputStream& rStrm ) +void ScenarioContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrScenario.importScenario( rStrm ); @@ -103,7 +103,7 @@ void ScenariosContext::onStartElement( const AttributeList& rAttribs ) mrSheetScenarios.importScenarios( rAttribs ); } -ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& ) +ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& ) { switch( getCurrentElement() ) { @@ -114,7 +114,7 @@ ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, Rec return 0; } -void ScenariosContext::onStartRecord( RecordInputStream& rStrm ) +void ScenariosContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrSheetScenarios.importScenarios( rStrm ); diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx index 0cf616646722..efdfe801f784 100644 --- a/oox/source/xls/sharedformulabuffer.cxx +++ b/oox/source/xls/sharedformulabuffer.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/sheet/XFormulaTokens.hpp> #include <rtl/ustrbuf.hxx> #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/formulaparser.hxx" @@ -112,7 +111,7 @@ void SharedFormulaBuffer::importSharedFmla( const OUString& rFormula, const OUSt } } -void SharedFormulaBuffer::importSharedFmla( RecordInputStream& rStrm, const CellAddress& rBaseAddr ) +void SharedFormulaBuffer::importSharedFmla( SequenceInputStream& rStrm, const CellAddress& rBaseAddr ) { BinRange aRange; rStrm >> aRange; diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx index a356e9b29d7e..bdb60f6962b8 100644 --- a/oox/source/xls/sharedstringsfragment.cxx +++ b/oox/source/xls/sharedstringsfragment.cxx @@ -64,7 +64,7 @@ ContextHandlerRef SharedStringsFragment::onCreateContext( sal_Int32 nElement, co return 0; } -ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx index 258ec995e9e0..c515ec02bfbe 100644 --- a/oox/source/xls/sheetdatacontext.cxx +++ b/oox/source/xls/sheetdatacontext.cxx @@ -35,7 +35,6 @@ #include <com/sun/star/text/XText.hpp> #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/formulaparser.hxx" @@ -285,7 +284,7 @@ void SheetDataContext::onEndElement() } } -ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -375,7 +374,7 @@ void SheetDataContext::importFormula( const AttributeList& rAttribs ) maTableData.mbRef2Deleted = rAttribs.getBool( XML_del2, false ); } -void SheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellHeader( SequenceInputStream& rStrm, CellType eCellType ) { maCurrCell.reset(); @@ -398,7 +397,7 @@ void SheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCel extendUsedArea( maCurrCell.maAddress ); } -void SheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellBool( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_b; @@ -419,14 +418,14 @@ void SheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellT setCellFormat( maCurrCell ); } -void SheetDataContext::importCellBlank( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellBlank( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellBlank - no formula cells supported" ); importCellHeader( rStrm, eCellType ); setCellFormat( maCurrCell ); } -void SheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellDouble( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_n; @@ -441,7 +440,7 @@ void SheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCel setCellFormat( maCurrCell ); } -void SheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellError( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_e; @@ -456,7 +455,7 @@ void SheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCell setCellFormat( maCurrCell ); } -void SheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellRk( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRk - no formula cells supported" ); importCellHeader( rStrm, eCellType ); @@ -466,7 +465,7 @@ void SheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellTyp setCellFormat( maCurrCell ); } -void SheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellRString( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRString - no formula cells supported" ); importCellHeader( rStrm, eCellType ); @@ -482,7 +481,7 @@ void SheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCe setCellFormat( maCurrCell ); } -void SheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellSi( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellSi - no formula cells supported" ); importCellHeader( rStrm, eCellType ); @@ -492,7 +491,7 @@ void SheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellTyp setCellFormat( maCurrCell ); } -void SheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellString( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_inlineStr; @@ -510,7 +509,7 @@ void SheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCel setCellFormat( maCurrCell ); } -void SheetDataContext::importCellFormula( RecordInputStream& rStrm ) +void SheetDataContext::importCellFormula( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY ); @@ -521,7 +520,7 @@ void SheetDataContext::importCellFormula( RecordInputStream& rStrm ) } } -void SheetDataContext::importRow( RecordInputStream& rStrm ) +void SheetDataContext::importRow( SequenceInputStream& rStrm ) { RowModel aModel; @@ -545,7 +544,7 @@ void SheetDataContext::importRow( RecordInputStream& rStrm ) setRowModel( aModel ); } -void SheetDataContext::importArray( RecordInputStream& rStrm ) +void SheetDataContext::importArray( SequenceInputStream& rStrm ) { BinRange aRange; rStrm >> aRange; @@ -560,12 +559,12 @@ void SheetDataContext::importArray( RecordInputStream& rStrm ) } } -void SheetDataContext::importSharedFmla( RecordInputStream& rStrm ) +void SheetDataContext::importSharedFmla( SequenceInputStream& rStrm ) { getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress ); } -void SheetDataContext::importDataTable( RecordInputStream& rStrm ) +void SheetDataContext::importDataTable( SequenceInputStream& rStrm ) { BinRange aRange; rStrm >> aRange; diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 13c4bb6612a6..56c26d8b9f67 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -46,9 +46,9 @@ #include <rtl/ustrbuf.hxx> #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/condformatbuffer.hxx" #include "oox/xls/excelhandlers.hxx" @@ -366,7 +366,7 @@ void Color::importColor( const AttributeList& rAttribs ) } } -void Color::importColor( RecordInputStream& rStrm ) +void Color::importColor( SequenceInputStream& rStrm ) { sal_uInt8 nFlags, nIndex; sal_Int16 nTint; @@ -403,12 +403,12 @@ void Color::importColor( RecordInputStream& rStrm ) } } -void Color::importColorId( RecordInputStream& rStrm ) +void Color::importColorId( SequenceInputStream& rStrm ) { setIndexed( rStrm.readInt32() ); } -void Color::importColorRgb( RecordInputStream& rStrm ) +void Color::importColorRgb( SequenceInputStream& rStrm ) { setRgb( lclReadRgbColor( rStrm ) ); } @@ -423,7 +423,7 @@ void Color::importColorRgb( BiffInputStream& rStrm ) setRgb( lclReadRgbColor( rStrm ) ); } -RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor ) +SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ) { orColor.importColor( rStrm ); return rStrm; @@ -518,7 +518,7 @@ void ColorPalette::importPaletteColor( const AttributeList& rAttribs ) appendColor( rAttribs.getIntegerHex( XML_rgb, API_RGB_WHITE ) ); } -void ColorPalette::importPaletteColor( RecordInputStream& rStrm ) +void ColorPalette::importPaletteColor( SequenceInputStream& rStrm ) { sal_Int32 nRgb = lclReadRgbColor( rStrm ); appendColor( nRgb & 0xFFFFFF ); @@ -791,7 +791,7 @@ void Font::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ) } } -void Font::importFont( RecordInputStream& rStrm ) +void Font::importFont( SequenceInputStream& rStrm ) { OSL_ENSURE( !mbDxf, "Font::importFont - unexpected conditional formatting flag" ); @@ -816,56 +816,56 @@ void Font::importFont( RecordInputStream& rStrm ) maModel.mbShadow = getFlag( nFlags, BIFF_FONTFLAG_SHADOW ); } -void Font::importDxfName( RecordInputStream& rStrm ) +void Font::importDxfName( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfName - missing conditional formatting flag" ); - maModel.maName = rStrm.readString( false ); + maModel.maName = BiffHelper::readString( rStrm, false ); maUsedFlags.mbColorUsed = true; } -void Font::importDxfColor( RecordInputStream& rStrm ) +void Font::importDxfColor( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfColor - missing conditional formatting flag" ); rStrm >> maModel.maColor; maUsedFlags.mbColorUsed = true; } -void Font::importDxfScheme( RecordInputStream& rStrm ) +void Font::importDxfScheme( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfScheme - missing conditional formatting flag" ); maModel.setBiff12Scheme( rStrm.readuInt8() ); maUsedFlags.mbSchemeUsed = true; } -void Font::importDxfHeight( RecordInputStream& rStrm ) +void Font::importDxfHeight( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfHeight - missing conditional formatting flag" ); maModel.setBiffHeight( rStrm.readuInt16() ); maUsedFlags.mbHeightUsed = true; } -void Font::importDxfWeight( RecordInputStream& rStrm ) +void Font::importDxfWeight( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfWeight - missing conditional formatting flag" ); maModel.setBiffWeight( rStrm.readuInt16() ); maUsedFlags.mbWeightUsed = true; } -void Font::importDxfUnderline( RecordInputStream& rStrm ) +void Font::importDxfUnderline( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfUnderline - missing conditional formatting flag" ); maModel.setBiffUnderline( rStrm.readuInt16() ); maUsedFlags.mbUnderlineUsed = true; } -void Font::importDxfEscapement( RecordInputStream& rStrm ) +void Font::importDxfEscapement( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfEscapement - missing conditional formatting flag" ); maModel.setBiffEscapement( rStrm.readuInt16() ); maUsedFlags.mbEscapementUsed = true; } -void Font::importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm ) +void Font::importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfFlag - missing conditional formatting flag" ); bool bFlag = rStrm.readuInt8() != 0; @@ -1652,7 +1652,7 @@ void Border::importColor( sal_Int32 nElement, const AttributeList& rAttribs ) pBorderLine->maColor.importColor( rAttribs ); } -void Border::importBorder( RecordInputStream& rStrm ) +void Border::importBorder( SequenceInputStream& rStrm ) { sal_uInt8 nFlags = rStrm.readuInt8(); maModel.mbDiagTLtoBR = getFlag( nFlags, BIFF12_BORDER_DIAG_TLBR ); @@ -1669,7 +1669,7 @@ void Border::importBorder( RecordInputStream& rStrm ) rStrm >> maModel.maDiagonal.maColor; } -void Border::importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm ) +void Border::importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Border::importDxfBorder - missing conditional formatting flag" ); if( BorderLineModel* pBorderLine = getBorderLine( nElement ) ) @@ -1861,7 +1861,7 @@ GradientFillModel::GradientFillModel() : { } -void GradientFillModel::readGradient( RecordInputStream& rStrm ) +void GradientFillModel::readGradient( SequenceInputStream& rStrm ) { sal_Int32 nType; rStrm >> nType >> mfAngle >> mfLeft >> mfRight >> mfTop >> mfBottom; @@ -1869,7 +1869,7 @@ void GradientFillModel::readGradient( RecordInputStream& rStrm ) mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID ); } -void GradientFillModel::readGradientStop( RecordInputStream& rStrm, bool bDxf ) +void GradientFillModel::readGradientStop( SequenceInputStream& rStrm, bool bDxf ) { Color aColor; double fPosition; @@ -1976,7 +1976,7 @@ void Fill::importColor( const AttributeList& rAttribs, double fPosition ) mxGradientModel->maColors[ fPosition ].importColor( rAttribs ); } -void Fill::importFill( RecordInputStream& rStrm ) +void Fill::importFill( SequenceInputStream& rStrm ) { OSL_ENSURE( !mbDxf, "Fill::importFill - unexpected conditional formatting flag" ); sal_Int32 nPattern = rStrm.readInt32(); @@ -1998,7 +1998,7 @@ void Fill::importFill( RecordInputStream& rStrm ) } } -void Fill::importDxfPattern( RecordInputStream& rStrm ) +void Fill::importDxfPattern( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfPattern - missing conditional formatting flag" ); if( !mxPatternModel ) @@ -2007,7 +2007,7 @@ void Fill::importDxfPattern( RecordInputStream& rStrm ) mxPatternModel->mbPatternUsed = true; } -void Fill::importDxfFgColor( RecordInputStream& rStrm ) +void Fill::importDxfFgColor( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfFgColor - missing conditional formatting flag" ); if( !mxPatternModel ) @@ -2016,7 +2016,7 @@ void Fill::importDxfFgColor( RecordInputStream& rStrm ) mxPatternModel->mbPattColorUsed = true; } -void Fill::importDxfBgColor( RecordInputStream& rStrm ) +void Fill::importDxfBgColor( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfBgColor - missing conditional formatting flag" ); if( !mxPatternModel ) @@ -2025,7 +2025,7 @@ void Fill::importDxfBgColor( RecordInputStream& rStrm ) mxPatternModel->mbFillColorUsed = true; } -void Fill::importDxfGradient( RecordInputStream& rStrm ) +void Fill::importDxfGradient( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfGradient - missing conditional formatting flag" ); if( !mxGradientModel ) @@ -2033,7 +2033,7 @@ void Fill::importDxfGradient( RecordInputStream& rStrm ) mxGradientModel->readGradient( rStrm ); } -void Fill::importDxfStop( RecordInputStream& rStrm ) +void Fill::importDxfStop( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfStop - missing conditional formatting flag" ); if( !mxGradientModel ) @@ -2255,7 +2255,7 @@ void Xf::importProtection( const AttributeList& rAttribs ) maProtection.importProtection( rAttribs ); } -void Xf::importXf( RecordInputStream& rStrm, bool bCellXf ) +void Xf::importXf( SequenceInputStream& rStrm, bool bCellXf ) { maModel.mbCellXf = bCellXf; maModel.mnStyleXfId = rStrm.readuInt16(); @@ -2546,7 +2546,7 @@ void Dxf::importProtection( const AttributeList& rAttribs ) mxProtection->importProtection( rAttribs ); } -void Dxf::importDxf( RecordInputStream& rStrm ) +void Dxf::importDxf( SequenceInputStream& rStrm ) { sal_Int32 nNumFmtId = -1; OUString aFmtCode; @@ -2581,7 +2581,7 @@ void Dxf::importDxf( RecordInputStream& rStrm ) case BIFF12_DXF_FONT_SHADOW: createFont( false )->importDxfFlag( XML_shadow, rStrm ); break; case BIFF12_DXF_FONT_HEIGHT: createFont( false )->importDxfHeight( rStrm ); break; case BIFF12_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break; - case BIFF12_DXF_NUMFMT_CODE: aFmtCode = rStrm.readString( false ); break; + case BIFF12_DXF_NUMFMT_CODE: aFmtCode = BiffHelper::readString( rStrm, false ); break; case BIFF12_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break; } rStrm.seek( nRecEnd ); @@ -2851,7 +2851,7 @@ void CellStyle::importCellStyle( const AttributeList& rAttribs ) maModel.mbHidden = rAttribs.getBool( XML_hidden, false ); } -void CellStyle::importCellStyle( RecordInputStream& rStrm ) +void CellStyle::importCellStyle( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> maModel.mnXfId >> nFlags; @@ -2952,7 +2952,7 @@ CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs ) return xCellStyle; } -CellStyleRef CellStyleBuffer::importCellStyle( RecordInputStream& rStrm ) +CellStyleRef CellStyleBuffer::importCellStyle( SequenceInputStream& rStrm ) { CellStyleRef xCellStyle( new CellStyle( *this ) ); xCellStyle->importCellStyle( rStrm ); @@ -3189,17 +3189,17 @@ CellStyleRef StylesBuffer::importCellStyle( const AttributeList& rAttribs ) return maCellStyles.importCellStyle( rAttribs ); } -void StylesBuffer::importPaletteColor( RecordInputStream& rStrm ) +void StylesBuffer::importPaletteColor( SequenceInputStream& rStrm ) { maPalette.importPaletteColor( rStrm ); } -void StylesBuffer::importNumFmt( RecordInputStream& rStrm ) +void StylesBuffer::importNumFmt( SequenceInputStream& rStrm ) { maNumFmts.importNumFmt( rStrm ); } -void StylesBuffer::importCellStyle( RecordInputStream& rStrm ) +void StylesBuffer::importCellStyle( SequenceInputStream& rStrm ) { maCellStyles.importCellStyle( rStrm ); } diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx index 2ea01a8a84e2..c890196dc518 100644 --- a/oox/source/xls/stylesfragment.cxx +++ b/oox/source/xls/stylesfragment.cxx @@ -56,7 +56,7 @@ ContextHandlerRef IndexedColorsContext::onCreateContext( sal_Int32 nElement, con return 0; } -ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -242,7 +242,7 @@ ContextHandlerRef StylesFragment::onCreateContext( sal_Int32 nElement, const Att return 0; } -ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index b3dac5e85eed..91fad31e6ee4 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -29,8 +29,8 @@ #include <com/sun/star/sheet/XDatabaseRange.hpp> #include "oox/helper/attributelist.hxx" +#include "oox/helper/binaryinputstream.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" namespace oox { @@ -74,7 +74,7 @@ void Table::importTable( const AttributeList& rAttribs, sal_Int16 nSheet ) maModel.mnTotalsRows = rAttribs.getInteger( XML_totalsRowCount, 0 ); } -void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet ) +void Table::importTable( SequenceInputStream& rStrm, sal_Int16 nSheet ) { BinRange aBinRange; sal_Int32 nType; diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx index 027a37eb4dcc..37503f8577fb 100644 --- a/oox/source/xls/tablefragment.cxx +++ b/oox/source/xls/tablefragment.cxx @@ -67,7 +67,7 @@ ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const Attr return 0; } -ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx index b86ec1fe7612..c9658dd41cf9 100644 --- a/oox/source/xls/viewsettings.cxx +++ b/oox/source/xls/viewsettings.cxx @@ -39,7 +39,6 @@ #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/unitconverter.hxx" @@ -289,7 +288,7 @@ void SheetViewSettings::importChartSheetView( const AttributeList& rAttribs ) rModel.mbZoomToFit = rAttribs.getBool( XML_zoomToFit, false ); } -void SheetViewSettings::importSheetView( RecordInputStream& rStrm ) +void SheetViewSettings::importSheetView( SequenceInputStream& rStrm ) { SheetViewModel& rModel = *createSheetView(); sal_uInt16 nFlags; @@ -316,7 +315,7 @@ void SheetViewSettings::importSheetView( RecordInputStream& rStrm ) rModel.mbShowOutline = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWOUTLINE ); } -void SheetViewSettings::importPane( RecordInputStream& rStrm ) +void SheetViewSettings::importPane( SequenceInputStream& rStrm ) { OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing sheet view model" ); if( !maSheetViews.empty() ) @@ -334,7 +333,7 @@ void SheetViewSettings::importPane( RecordInputStream& rStrm ) } } -void SheetViewSettings::importSelection( RecordInputStream& rStrm ) +void SheetViewSettings::importSelection( SequenceInputStream& rStrm ) { OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importSelection - missing sheet view model" ); if( !maSheetViews.empty() ) @@ -354,7 +353,7 @@ void SheetViewSettings::importSelection( RecordInputStream& rStrm ) } } -void SheetViewSettings::importChartSheetView( RecordInputStream& rStrm ) +void SheetViewSettings::importChartSheetView( SequenceInputStream& rStrm ) { SheetViewModel& rModel = *createSheetView(); sal_uInt16 nFlags; @@ -649,7 +648,7 @@ void ViewSettings::importOleSize( const AttributeList& rAttribs ) mbValidOleSize = getAddressConverter().convertToCellRange( maOleSize, aRange, 0, true, false ); } -void ViewSettings::importWorkbookView( RecordInputStream& rStrm ) +void ViewSettings::importWorkbookView( SequenceInputStream& rStrm ) { WorkbookViewModel& rModel = createWorkbookView(); sal_uInt8 nFlags; @@ -661,7 +660,7 @@ void ViewSettings::importWorkbookView( RecordInputStream& rStrm ) rModel.mbMinimized = getFlag( nFlags, BIFF12_WBVIEW_MINIMIZED ); } -void ViewSettings::importOleSize( RecordInputStream& rStrm ) +void ViewSettings::importOleSize( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> aBinRange; diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx index 042acc50dcbb..dce3c8eb461e 100644 --- a/oox/source/xls/workbookfragment.cxx +++ b/oox/source/xls/workbookfragment.cxx @@ -33,7 +33,6 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/progressbar.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/ole/olestorage.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/chartsheetfragment.hxx" @@ -128,7 +127,7 @@ void WorkbookFragment::onCharacters( const OUString& rChars ) mxCurrName->setFormula( rChars ); } -ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -317,16 +316,16 @@ void WorkbookFragment::importPivotCache( const AttributeList& rAttribs ) importPivotCacheDefFragment( aRelId, nCacheId ); } -void WorkbookFragment::importExternalRef( RecordInputStream& rStrm ) +void WorkbookFragment::importExternalRef( SequenceInputStream& rStrm ) { if( ExternalLink* pExtLink = getExternalLinks().importExternalRef( rStrm ).get() ) importExternalLinkFragment( *pExtLink ); } -void WorkbookFragment::importPivotCache( RecordInputStream& rStrm ) +void WorkbookFragment::importPivotCache( SequenceInputStream& rStrm ) { sal_Int32 nCacheId = rStrm.readInt32(); - OUString aRelId = rStrm.readString(); + OUString aRelId = BiffHelper::readString( rStrm ); importPivotCacheDefFragment( aRelId, nCacheId ); } diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx index e54628a6143f..6889d42ed2f6 100644 --- a/oox/source/xls/workbooksettings.cxx +++ b/oox/source/xls/workbooksettings.cxx @@ -34,7 +34,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/unitconverter.hxx" @@ -156,13 +155,13 @@ void WorkbookSettings::importCalcPr( const AttributeList& rAttribs ) maCalcSettings.mbConcurrent = rAttribs.getBool( XML_concurrentCalc, true ); } -void WorkbookSettings::importFileSharing( RecordInputStream& rStrm ) +void WorkbookSettings::importFileSharing( SequenceInputStream& rStrm ) { maFileSharing.mbRecommendReadOnly = rStrm.readuInt16() != 0; rStrm >> maFileSharing.mnPasswordHash >> maFileSharing.maUserName; } -void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm ) +void WorkbookSettings::importWorkbookPr( SequenceInputStream& rStrm ) { sal_uInt32 nFlags; rStrm >> nFlags >> maBookSettings.mnDefaultThemeVer >> maBookSettings.maCodeName; @@ -172,7 +171,7 @@ void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm ) setDateMode( getFlag( nFlags, BIFF12_WORKBOOKPR_DATE1904 ) ); } -void WorkbookSettings::importCalcPr( RecordInputStream& rStrm ) +void WorkbookSettings::importCalcPr( SequenceInputStream& rStrm ) { sal_Int32 nCalcMode, nProcCount; sal_uInt16 nFlags; diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx index 12903a4b3c27..6144c35d6a55 100644 --- a/oox/source/xls/worksheetbuffer.cxx +++ b/oox/source/xls/worksheetbuffer.cxx @@ -36,8 +36,8 @@ #include <rtl/ustrbuf.hxx> #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelhandlers.hxx" @@ -95,7 +95,7 @@ void WorksheetBuffer::importSheet( const AttributeList& rAttribs ) insertSheet( aModel ); } -void WorksheetBuffer::importSheet( RecordInputStream& rStrm ) +void WorksheetBuffer::importSheet( SequenceInputStream& rStrm ) { sal_Int32 nState; SheetInfoModel aModel; diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index 1008a67af9b5..4867c7c350c1 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -30,7 +30,6 @@ #include "oox/core/filterbase.hxx" #include "oox/core/relations.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/autofiltercontext.hxx" @@ -164,7 +163,7 @@ void DataValidationsContext::onEndElement() } -ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( nRecId == BIFF12_ID_DATAVALIDATION ) importDataValidation( rStrm ); @@ -191,7 +190,7 @@ void DataValidationsContext::importDataValidation( const AttributeList& rAttribs mxValModel->mbAllowBlank = rAttribs.getBool( XML_allowBlank, false ); } -void DataValidationsContext::importDataValidation( RecordInputStream& rStrm ) +void DataValidationsContext::importDataValidation( SequenceInputStream& rStrm ) { ValidationModel aModel; @@ -370,7 +369,7 @@ void WorksheetFragment::onCharacters( const OUString& rChars ) } } -ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -621,7 +620,7 @@ void WorksheetFragment::importControl( const AttributeList& rAttribs ) getVmlDrawing().registerControl( aInfo ); } -void WorksheetFragment::importDimension( RecordInputStream& rStrm ) +void WorksheetFragment::importDimension( SequenceInputStream& rStrm ) { BinRange aBinRange; aBinRange.read( rStrm ); @@ -635,7 +634,7 @@ void WorksheetFragment::importDimension( RecordInputStream& rStrm ) extendUsedArea( aRange ); } -void WorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm ) +void WorksheetFragment::importSheetFormatPr( SequenceInputStream& rStrm ) { sal_Int32 nDefaultWidth; sal_uInt16 nBaseWidth, nDefaultHeight, nFlags; @@ -654,7 +653,7 @@ void WorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm ) getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) ); } -void WorksheetFragment::importCol( RecordInputStream& rStrm ) +void WorksheetFragment::importCol( SequenceInputStream& rStrm ) { ColumnModel aModel; @@ -676,7 +675,7 @@ void WorksheetFragment::importCol( RecordInputStream& rStrm ) setColumnModel( aModel ); } -void WorksheetFragment::importMergeCell( RecordInputStream& rStrm ) +void WorksheetFragment::importMergeCell( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> aBinRange; @@ -685,20 +684,20 @@ void WorksheetFragment::importMergeCell( RecordInputStream& rStrm ) setMergedRange( aRange ); } -void WorksheetFragment::importHyperlink( RecordInputStream& rStrm ) +void WorksheetFragment::importHyperlink( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> aBinRange; HyperlinkModel aModel; if( getAddressConverter().convertToCellRange( aModel.maRange, aBinRange, getSheetIndex(), true, true ) ) { - aModel.maTarget = getRelations().getExternalTargetFromRelId( rStrm.readString() ); + aModel.maTarget = getRelations().getExternalTargetFromRelId( BiffHelper::readString( rStrm ) ); rStrm >> aModel.maLocation >> aModel.maTooltip >> aModel.maDisplay; setHyperlink( aModel ); } } -void WorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak ) +void WorksheetFragment::importBrk( SequenceInputStream& rStrm, bool bRowBreak ) { PageBreakModel aModel; sal_Int32 nManual; @@ -707,17 +706,17 @@ void WorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak ) setPageBreak( aModel, bRowBreak ); } -void WorksheetFragment::importDrawing( RecordInputStream& rStrm ) +void WorksheetFragment::importDrawing( SequenceInputStream& rStrm ) { - setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) ); + setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) ); } -void WorksheetFragment::importLegacyDrawing( RecordInputStream& rStrm ) +void WorksheetFragment::importLegacyDrawing( SequenceInputStream& rStrm ) { - setVmlDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) ); + setVmlDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) ); } -void WorksheetFragment::importOleObject( RecordInputStream& rStrm ) +void WorksheetFragment::importOleObject( SequenceInputStream& rStrm ) { ::oox::vml::OleObjectInfo aInfo; sal_Int32 nAspect, nUpdateMode, nShapeId; @@ -727,7 +726,7 @@ void WorksheetFragment::importOleObject( RecordInputStream& rStrm ) if( aInfo.mbLinked ) aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rStrm ); else - importEmbeddedOleData( aInfo.maEmbeddedData, rStrm.readString() ); + importEmbeddedOleData( aInfo.maEmbeddedData, BiffHelper::readString( rStrm ) ); aInfo.setShapeId( nShapeId ); aInfo.mbShowAsIcon = nAspect == BIFF12_OLEOBJECT_ICON; aInfo.mbAutoUpdate = nUpdateMode == BIFF12_OLEOBJECT_ALWAYS; @@ -735,11 +734,11 @@ void WorksheetFragment::importOleObject( RecordInputStream& rStrm ) getVmlDrawing().registerOleObject( aInfo ); } -void WorksheetFragment::importControl( RecordInputStream& rStrm ) +void WorksheetFragment::importControl( SequenceInputStream& rStrm ) { ::oox::vml::ControlInfo aInfo; aInfo.setShapeId( rStrm.readInt32() ); - aInfo.maFragmentPath = getFragmentPathFromRelId( rStrm.readString() ); + aInfo.maFragmentPath = getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ); rStrm >> aInfo.maName; getVmlDrawing().registerControl( aInfo ); } diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx index b81f7fb6b841..cc1aa45f2012 100644 --- a/oox/source/xls/worksheetsettings.cxx +++ b/oox/source/xls/worksheetsettings.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/util/XProtectable.hpp> #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/workbooksettings.hxx" @@ -178,7 +177,7 @@ void WorksheetSettings::importPhoneticPr( const AttributeList& rAttribs ) maPhoneticSett.importPhoneticPr( rAttribs ); } -void WorksheetSettings::importSheetPr( RecordInputStream& rStrm ) +void WorksheetSettings::importSheetPr( SequenceInputStream& rStrm ) { sal_uInt16 nFlags1; sal_uInt8 nFlags2; @@ -196,13 +195,13 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm ) getPageSettings().setFitToPagesMode( getFlag( nFlags1, BIFF_SHEETPR_FITTOPAGES ) ); } -void WorksheetSettings::importChartSheetPr( RecordInputStream& rStrm ) +void WorksheetSettings::importChartSheetPr( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); // flags, contains only the 'published' flag rStrm >> maSheetSettings.maTabColor >> maSheetSettings.maCodeName; } -void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm ) +void WorksheetSettings::importSheetProtection( SequenceInputStream& rStrm ) { rStrm >> maSheetProt.mnPasswordHash; // no flags field for all these boolean flags?!? @@ -224,7 +223,7 @@ void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm ) maSheetProt.mbSelectUnlocked = rStrm.readInt32() != 0; } -void WorksheetSettings::importChartProtection( RecordInputStream& rStrm ) +void WorksheetSettings::importChartProtection( SequenceInputStream& rStrm ) { rStrm >> maSheetProt.mnPasswordHash; // no flags field for all these boolean flags?!? @@ -232,7 +231,7 @@ void WorksheetSettings::importChartProtection( RecordInputStream& rStrm ) maSheetProt.mbObjects = rStrm.readInt32() != 0; } -void WorksheetSettings::importPhoneticPr( RecordInputStream& rStrm ) +void WorksheetSettings::importPhoneticPr( SequenceInputStream& rStrm ) { maPhoneticSett.importPhoneticPr( rStrm ); } |