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 | |
parent | bf9cd246dc431e20181cfec8107e3b7c59866281 (diff) |
dr77: more cleanup: remove RecordInputStream, cleanup ContainerHelper
121 files changed, 1245 insertions, 1219 deletions
diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx index 10de170f9e40..b1f24d051c70 100644 --- a/oox/inc/oox/core/contexthandler.hxx +++ b/oox/inc/oox/core/contexthandler.hxx @@ -39,7 +39,7 @@ namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XLocator; } } } } } -namespace oox { class RecordInputStream; } +namespace oox { class SequenceInputStream; } namespace oox { namespace core { @@ -93,8 +93,8 @@ public: // record context interface ----------------------------------------------- - virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void endRecord( sal_Int32 nRecId ); protected: diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx index 314a0886b866..0c9ac794e94b 100644 --- a/oox/inc/oox/core/contexthandler2.hxx +++ b/oox/inc/oox/core/contexthandler2.hxx @@ -31,7 +31,7 @@ #include <vector> #include <boost/shared_ptr.hpp> #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" +#include "oox/helper/binaryinputstream.hxx" #include "oox/core/contexthandler.hxx" namespace oox { @@ -124,7 +124,7 @@ public: Usually 'this' can be returned to improve performance by reusing the same instance to process several records. Used by BIFF import only. */ - virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) = 0; + virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) = 0; /** Will be called when a new record block in a binary stream has been started. @@ -132,7 +132,7 @@ public: The current record identifier can be accessed with getCurrentElement() or isCurrentElement(). Used by BIFF import only. */ - virtual void onStartRecord( RecordInputStream& rStrm ) = 0; + virtual void onStartRecord( SequenceInputStream& rStrm ) = 0; /** Will be called when the current record block is about to be left. @@ -189,10 +189,10 @@ protected: void implEndElement( sal_Int32 nElement ); /** Must be called from createRecordContext() in derived classes. */ - ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Must be called from startRecord() in derived classes. */ - void implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + void implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Must be called from endRecord() in derived classes. */ void implEndRecord( sal_Int32 nRecId ); @@ -250,8 +250,8 @@ public: // oox.core.ContextHandler interface -------------------------------------- - virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void endRecord( sal_Int32 nRecId ); // oox.core.ContextHandler2Helper interface ------------------------------- @@ -261,8 +261,8 @@ public: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); virtual void onEndRecord(); }; diff --git a/oox/inc/oox/core/fragmenthandler2.hxx b/oox/inc/oox/core/fragmenthandler2.hxx index 2473b9e91436..51408005ecdd 100644 --- a/oox/inc/oox/core/fragmenthandler2.hxx +++ b/oox/inc/oox/core/fragmenthandler2.hxx @@ -84,8 +84,8 @@ public: // oox.core.ContextHandler interface -------------------------------------- - virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void endRecord( sal_Int32 nRecId ); // oox.core.ContextHandler2Helper interface ------------------------------- @@ -95,8 +95,8 @@ public: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); virtual void onEndRecord(); // oox.core.FragmentHandler2 interface ------------------------------------ diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx index f29374bd6c69..278a8af9fed3 100644 --- a/oox/inc/oox/drawingml/chart/modelbase.hxx +++ b/oox/inc/oox/drawingml/chart/modelbase.hxx @@ -28,8 +28,9 @@ #ifndef OOX_DRAWINGML_CHART_MODELBASE_HXX #define OOX_DRAWINGML_CHART_MODELBASE_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" namespace oox { class AttributeList; } diff --git a/oox/inc/oox/drawingml/chart/objectformatter.hxx b/oox/inc/oox/drawingml/chart/objectformatter.hxx index 1b0f5f781044..c35cd66f65e1 100644 --- a/oox/inc/oox/drawingml/chart/objectformatter.hxx +++ b/oox/inc/oox/drawingml/chart/objectformatter.hxx @@ -28,7 +28,6 @@ #ifndef OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX #define OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/chart/modelbase.hxx" diff --git a/oox/inc/oox/drawingml/textbody.hxx b/oox/inc/oox/drawingml/textbody.hxx index a2eb6106e651..ce747c62bdbb 100644 --- a/oox/inc/oox/drawingml/textbody.hxx +++ b/oox/inc/oox/drawingml/textbody.hxx @@ -28,7 +28,6 @@ #ifndef OOX_DRAWINGML_TEXTBODY_HXX #define OOX_DRAWINGML_TEXTBODY_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/drawingml/textbodyproperties.hxx" #include "oox/drawingml/textliststyle.hxx" diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx index 6ba4cdf1d62a..cafcc951504b 100644 --- a/oox/inc/oox/drawingml/textliststyle.hxx +++ b/oox/inc/oox/drawingml/textliststyle.hxx @@ -28,8 +28,8 @@ #ifndef OOX_DRAWINGML_TEXTLISTSTYLE_HXX #define OOX_DRAWINGML_TEXTLISTSTYLE_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/drawingml/textparagraphproperties.hxx" +#include "oox/helper/refvector.hxx" namespace oox { namespace drawingml { diff --git a/oox/inc/oox/drawingml/textparagraph.hxx b/oox/inc/oox/drawingml/textparagraph.hxx index d8c97cbfa114..c059edc73f43 100644 --- a/oox/inc/oox/drawingml/textparagraph.hxx +++ b/oox/inc/oox/drawingml/textparagraph.hxx @@ -31,7 +31,6 @@ #include <com/sun/star/text/XTextCursor.hpp> #include <com/sun/star/text/XText.hpp> -#include "oox/helper/containerhelper.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/textrun.hxx" #include "oox/drawingml/textliststyle.hxx" diff --git a/oox/inc/oox/drawingml/theme.hxx b/oox/inc/oox/drawingml/theme.hxx index 15f5ce82ce12..7f982a1eec71 100644 --- a/oox/inc/oox/drawingml/theme.hxx +++ b/oox/inc/oox/drawingml/theme.hxx @@ -28,7 +28,6 @@ #ifndef OOX_DRAWINGML_THEME_HXX #define OOX_DRAWINGML_THEME_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/drawingml/clrscheme.hxx" #include "oox/drawingml/shape.hxx" #include "oox/drawingml/textfont.hxx" diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx index 345202f67a4a..6fa1c9bd7e45 100644 --- a/oox/inc/oox/dump/xlsbdumper.hxx +++ b/oox/inc/oox/dump/xlsbdumper.hxx @@ -29,7 +29,6 @@ #define OOX_DUMP_XLSBDUMPER_HXX #include "oox/dump/dumperbase.hxx" -#include "oox/helper/recordinputstream.hxx" #if OOX_INCLUDE_DUMPER @@ -96,9 +95,9 @@ private: bool readCompressedInt( BinaryInputStream& rStrm, sal_Int32& ornValue ); private: - typedef ::boost::shared_ptr< RecordInputStream > RecordInputStreamRef; + typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef; - RecordInputStreamRef mxBiffStrm; + SequenceInputStreamRef mxBiffStrm; NameListRef mxErrCodes; }; diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx index ba93dc9ad60c..96b9feeffe07 100644 --- a/oox/inc/oox/helper/containerhelper.hxx +++ b/oox/inc/oox/helper/containerhelper.hxx @@ -30,8 +30,6 @@ #include <vector> #include <map> -#include <boost/shared_ptr.hpp> -#include <boost/bind.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.h> @@ -49,304 +47,6 @@ namespace oox { // ============================================================================ -/** Template for a vector of ref-counted objects with additional accessor functions. - - An instance of the class RefVector< Type > stores elements of the type - ::boost::shared_ptr< Type >. The new accessor functions has() and get() - work correctly for indexes out of the current range, there is no need to - check the passed index before. - */ -template< typename ObjType > -class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > > -{ -public: - typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::size_type size_type; - -public: - /** Returns true, if the object with the passed index exists. Returns - false, if the vector element exists but is an empty reference. */ - inline bool has( sal_Int32 nIndex ) const - { - const value_type* pxRef = getRef( nIndex ); - return pxRef && pxRef->get(); - } - - /** Returns a reference to the object with the passed index, or 0 on error. */ - inline value_type get( sal_Int32 nIndex ) const - { - if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef; - return value_type(); - } - - /** Returns the index of the last element, or -1, if the vector is empty. - Does *not* check whether the last element is an empty reference. */ - inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; } - - /** Calls the passed functor for every contained object, automatically - skips all elements that are empty references. */ - template< typename FunctorType > - inline void forEach( FunctorType aFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType > - inline void forEachMem( FuncType pFunc ) const - { - forEach( ::boost::bind( pFunc, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType > - inline void forEachMem( FuncType pFunc, ParamType aParam ) const - { - forEach( ::boost::bind( pFunc, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); - } - - /** Calls the passed functor for every contained object. Passes the index as - first argument and the object reference as second argument to rFunctor. */ - template< typename FunctorType > - inline void forEachWithIndex( const FunctorType& rFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index to the member function. */ - template< typename FuncType > - inline void forEachMemWithIndex( FuncType pFunc ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType > - inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } - - /** Searches for an element by using the passed functor that takes a - constant reference of the object type (const ObjType&). */ - template< typename FunctorType > - inline value_type findIf( const FunctorType& rFunctor ) const - { - typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) ); - return (aIt == this->end()) ? value_type() : *aIt; - } - -private: - template< typename FunctorType > - struct ForEachFunctor - { - FunctorType maFunctor; - inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); } - }; - - template< typename FunctorType > - struct ForEachFunctorWithIndex - { - FunctorType maFunctor; - sal_Int32 mnIndex; - inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {} - inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; } - }; - - template< typename FunctorType > - struct FindFunctor - { - FunctorType maFunctor; - inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); } - }; - - inline const value_type* getRef( sal_Int32 nIndex ) const - { - return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ? - &(*this)[ static_cast< size_type >( nIndex ) ] : 0; - } -}; - -// ============================================================================ - -/** Template for a map of ref-counted objects with additional accessor functions. - - An instance of the class RefMap< Type > stores elements of the type - ::boost::shared_ptr< Type >. The new accessor functions has() and get() - work correctly for nonexisting keys, there is no need to check the passed - key before. - */ -template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > > -class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > -{ -public: - typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type; - typedef typename container_type::key_type key_type; - typedef typename container_type::mapped_type mapped_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::key_compare key_compare; - -public: - /** Returns true, if the object accossiated to the passed key exists. - Returns false, if the key exists but points to an empty reference. */ - inline bool has( key_type nKey ) const - { - const mapped_type* pxRef = getRef( nKey ); - return pxRef && pxRef->get(); - } - - /** Returns a reference to the object accossiated to the passed key, or an - empty reference on error. */ - inline mapped_type get( key_type nKey ) const - { - if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef; - return mapped_type(); - } - - /** Calls the passed functor for every contained object, automatically - skips all elements that are empty references. */ - template< typename FunctorType > - inline void forEach( const FunctorType& rFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType > - inline void forEachMem( FuncType pFunc ) const - { - forEach( ::boost::bind( pFunc, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType > - inline void forEachMem( FuncType pFunc, ParamType aParam ) const - { - forEach( ::boost::bind( pFunc, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); - } - /** Calls the passed functor for every contained object. Passes the key as - first argument and the object reference as second argument to rFunctor. */ - template< typename FunctorType > - inline void forEachWithKey( const FunctorType& rFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as argument to the member function. */ - template< typename FuncType > - inline void forEachMemWithKey( FuncType pFunc ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType > - inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } - -private: - template< typename FunctorType > - struct ForEachFunctor - { - FunctorType maFunctor; - inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); } - }; - - template< typename FunctorType > - struct ForEachFunctorWithKey - { - FunctorType maFunctor; - inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); } - }; - - inline const mapped_type* getRef( key_type nKey ) const - { - typename container_type::const_iterator aIt = find( nKey ); - return (aIt == this->end()) ? 0 : &aIt->second; - } -}; - -// ============================================================================ - /** Template for a 2-dimensional array of objects. This class template provides a similar interface to the ::std::vector @@ -518,45 +218,53 @@ public: /** Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds. */ - template< typename Type > - static const Type* getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex ); + template< typename VectorType > + static const typename VectorType::value_type* + getVectorElement( const VectorType& rVector, sal_Int32 nIndex ); /** Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds. */ - template< typename Type > - static Type* getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex ); + template< typename VectorType > + static typename VectorType::value_type* + getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex ); /** Returns the reference to an existing element of the passed vector, or the passed default value, if the passed index is out of bounds. */ - template< typename Type > - static const Type& getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault ); + template< typename VectorType > + static const typename VectorType::value_type& + getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault ); /** Returns the reference to an existing element of the passed vector, or the passed default value, if the passed index is out of bounds. */ - template< typename Type > - static Type& getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault ); + template< typename VectorType > + static typename VectorType::value_type& + getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ); /** Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static const Type* getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey ); + template< typename MapType > + static const typename MapType::mapped_type* + getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ); /** Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static Type* getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey ); + template< typename MapType > + static typename MapType::mapped_type* + getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ); /** Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static const Type& getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault ); + template< typename MapType > + static const typename MapType::mapped_type& + getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ); /** Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static Type& getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault ); + template< typename MapType > + static typename MapType::mapped_type& + getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ); - // vector/matrix to Sequence ---------------------------------------------- + // vector/map/matrix to UNO sequence -------------------------------------- /** Creates a UNO sequence from a std::vector with copies of all elements. @@ -565,9 +273,20 @@ public: @return A com.sun.star.uno.Sequence object with copies of all objects contained in the passed vector. */ - template< typename Type > - static ::com::sun::star::uno::Sequence< Type > - vectorToSequence( const ::std::vector< Type >& rVector ); + template< typename VectorType > + static ::com::sun::star::uno::Sequence< typename VectorType::value_type > + vectorToSequence( const VectorType& rVector ); + + /** Creates a UNO sequence from a std::map with copies of all elements. + + @param rMap The map to be converted to a sequence. + + @return A com.sun.star.uno.Sequence object with copies of all objects + contained in the passed map. + */ + template< typename MapType > + static ::com::sun::star::uno::Sequence< typename MapType::mapped_type > + mapToSequence( const MapType& rMap ); /** Creates a UNO sequence of sequences from a matrix with copies of all elements. @@ -577,125 +296,104 @@ public: com.sun.star.uno.Sequence objects with copies of all objects contained in the passed matrix. */ - template< typename Type > - static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > - matrixToSequenceSequence( const Matrix< Type >& rMatrix ); + template< typename MatrixType > + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > + matrixToSequenceSequence( const MatrixType& rMatrix ); }; // ---------------------------------------------------------------------------- -template< typename Type > -const Type* ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex ) +template< typename VectorType > +/*static*/ const typename VectorType::value_type* ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0; } -template< typename Type > -Type* ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex ) +template< typename VectorType > +/*static*/ typename VectorType::value_type* ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0; } -template< typename Type > -const Type& ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault ) +template< typename VectorType > +/*static*/ const typename VectorType::value_type& ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; } -template< typename Type > -Type& ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault ) +template< typename VectorType > +/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; } -template< typename Type, typename KeyType > -const Type* ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey ) +template< typename MapType > +/*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ) { - typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey ); + typename MapType::const_iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? 0 : &aIt->second; } -template< typename Type, typename KeyType > -Type* ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey ) +template< typename MapType > +/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ) { - typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey ); + typename MapType::iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? 0 : &aIt->second; } -template< typename Type, typename KeyType > -const Type& ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault ) +template< typename MapType > +/*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ) { - typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey ); + typename MapType::const_iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? rDefault : aIt->second; } -template< typename Type, typename KeyType > -Type& ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault ) +template< typename MapType > +/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ) { - typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey ); + typename MapType::iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? rDefault : aIt->second; } -template< typename Type > -::com::sun::star::uno::Sequence< Type > ContainerHelper::vectorToSequence( const ::std::vector< Type >& rVector ) +template< typename VectorType > +/*static*/ ::com::sun::star::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector ) { + typedef typename VectorType::value_type ValueType; if( rVector.empty() ) - return ::com::sun::star::uno::Sequence< Type >(); - return ::com::sun::star::uno::Sequence< Type >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) ); + return ::com::sun::star::uno::Sequence< ValueType >(); + return ::com::sun::star::uno::Sequence< ValueType >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) ); } -template< typename Type > -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > ContainerHelper::matrixToSequenceSequence( const Matrix< Type >& rMatrix ) +template< typename MapType > +/*static*/ ::com::sun::star::uno::Sequence< typename MapType::mapped_type > ContainerHelper::mapToSequence( const MapType& rMap ) +{ + typedef typename MapType::mapped_type ValueType; + if( rMap.empty() ) + return ::com::sun::star::uno::Sequence< ValueType >(); + ::com::sun::star::uno::Sequence< ValueType > aSeq( static_cast< sal_Int32 >( rMap.size() ) ); + sal_Int32 nIndex = 0; + for( typename MapType::const_iterator aIt = rMap.begin(), aEnd = rMap.end(); aIt != aEnd; ++aIt, ++nIndex ) + aSeq[ nIndex ] = *aIt; + return aSeq; +} + +template< typename MatrixType > +/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > ContainerHelper::matrixToSequenceSequence( const MatrixType& rMatrix ) { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > aSeq; + typedef typename MatrixType::value_type ValueType; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ValueType > > aSeq; if( !rMatrix.empty() ) { aSeq.realloc( static_cast< sal_Int32 >( rMatrix.height() ) ); for( size_t nRow = 0, nHeight = rMatrix.height(); nRow < nHeight; ++nRow ) aSeq[ static_cast< sal_Int32 >( nRow ) ] = - ::com::sun::star::uno::Sequence< Type >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) ); + ::com::sun::star::uno::Sequence< ValueType >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) ); } return aSeq; } // ============================================================================ -/** This helper manages named objects in a container, which is created on demand. - */ -class ObjectContainer -{ -public: - explicit ObjectContainer( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory, - const ::rtl::OUString& rServiceName ); - ~ObjectContainer(); - - /** Returns true, if the object with the passed name exists in the container. */ - bool hasObject( const ::rtl::OUString& rObjName ) const; - - /** Returns the object with the passed name from the container. */ - ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const; - - /** Inserts the passed object into the container, returns its final name. */ - ::rtl::OUString insertObject( - const ::rtl::OUString& rObjName, - const ::com::sun::star::uno::Any& rObj, - bool bInsertByUnusedName ); - -private: - void createContainer() const; - -private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - mxFactory; /// Factory to create the container. - mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > - mxContainer; /// Container for the objects. - ::rtl::OUString maServiceName; /// Service name to create the container. - sal_Int32 mnIndex; /// Index to create unique identifiers. -}; - -// ============================================================================ - } // namespace oox #endif diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx index 82d06bac1109..e36e7001e613 100644 --- a/oox/inc/oox/helper/modelobjecthelper.hxx +++ b/oox/inc/oox/helper/modelobjecthelper.hxx @@ -29,19 +29,55 @@ #define OOX_HELPER_MODELOBJECTHELPER_HXX #include <com/sun/star/uno/Reference.hxx> -#include "oox/helper/containerhelper.hxx" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } namespace awt { struct Gradient; } + namespace container { class XNameContainer; } namespace drawing { struct LineDash; } namespace drawing { struct PolyPolygonBezierCoords; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { // ============================================================================ +/** This helper manages named objects in a container, which is created on demand. + */ +class ObjectContainer +{ +public: + explicit ObjectContainer( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory, + const ::rtl::OUString& rServiceName ); + ~ObjectContainer(); + + /** Returns true, if the object with the passed name exists in the container. */ + bool hasObject( const ::rtl::OUString& rObjName ) const; + + /** Returns the object with the passed name from the container. */ + ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const; + + /** Inserts the passed object into the container, returns its final name. */ + ::rtl::OUString insertObject( + const ::rtl::OUString& rObjName, + const ::com::sun::star::uno::Any& rObj, + bool bInsertByUnusedName ); + +private: + void createContainer() const; + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + mxFactory; /// Factory to create the container. + mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > + mxContainer; /// Container for the objects. + ::rtl::OUString maServiceName; /// Service name to create the container. + sal_Int32 mnIndex; /// Index to create unique identifiers. +}; + +// ============================================================================ + /** Contains tables for named drawing objects for a document model. Contains tables for named line markers, line dashes, fill gradients, and @@ -77,13 +113,13 @@ public: ::rtl::OUString insertFillBitmap( const ::rtl::OUString& rGraphicUrl ); private: - ObjectContainer maMarkerContainer; - ObjectContainer maDashContainer; - ObjectContainer maGradientContainer; - ObjectContainer maBitmapContainer; - const ::rtl::OUString maDashNameBase; - const ::rtl::OUString maGradientNameBase; - const ::rtl::OUString maBitmapNameBase; + ObjectContainer maMarkerContainer; /// Contains all named line markers (line end polygons). + ObjectContainer maDashContainer; /// Contains all named line dsahes. + ObjectContainer maGradientContainer; /// Contains all named fill gradients. + ObjectContainer maBitmapContainer; /// Contains all named fill bitmaps. + const ::rtl::OUString maDashNameBase; /// Base name for all named line dashes. + const ::rtl::OUString maGradientNameBase; /// Base name for all named fill gradients. + const ::rtl::OUString maBitmapNameBase; /// Base name for all named fill bitmaps. }; // ============================================================================ diff --git a/oox/inc/oox/helper/recordinputstream.hxx b/oox/inc/oox/helper/recordinputstream.hxx deleted file mode 100644 index 3cf8514897ec..000000000000 --- a/oox/inc/oox/helper/recordinputstream.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_HELPER_RECORDINPUTSTREAM_HXX -#define OOX_HELPER_RECORDINPUTSTREAM_HXX - -#include "oox/helper/binaryinputstream.hxx" - -namespace oox { - -// ============================================================================ - -/** Reads the contents of a record from a BIFF stream. */ -class RecordInputStream : public SequenceInputStream -{ -public: - explicit RecordInputStream( const StreamDataSequence& rData ); - - /** Reads a string with leading 16-bit or 32-bit length field. */ - ::rtl::OUString readString( bool b32BitLen = true ); - - /** Stream operator for integral types. */ - template< typename Type > - inline RecordInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; } - /** Stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */ - inline RecordInputStream& operator>>( ::rtl::OUString& orString ) { orString = readString(); return *this; } -}; - -// ============================================================================ - -} // namespace oox - -#endif diff --git a/oox/inc/oox/helper/refmap.hxx b/oox/inc/oox/helper/refmap.hxx new file mode 100755 index 000000000000..e833e1196c81 --- /dev/null +++ b/oox/inc/oox/helper/refmap.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_HELPER_REFMAP_HXX +#define OOX_HELPER_REFMAP_HXX + +#include <map> +#include <boost/bind.hpp> +#include <boost/shared_ptr.hpp> +#include <sal/types.h> + +namespace oox { + +// ============================================================================ + +/** Template for a map of ref-counted objects with additional accessor functions. + + An instance of the class RefMap< Type > stores elements of the type + ::boost::shared_ptr< Type >. The new accessor functions has() and get() + work correctly for nonexisting keys, there is no need to check the passed + key before. + */ +template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > > +class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > +{ +public: + typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type; + typedef typename container_type::key_type key_type; + typedef typename container_type::mapped_type mapped_type; + typedef typename container_type::value_type value_type; + typedef typename container_type::key_compare key_compare; + +public: + /** Returns true, if the object accossiated to the passed key exists. + Returns false, if the key exists but points to an empty reference. */ + inline bool has( key_type nKey ) const + { + const mapped_type* pxRef = getRef( nKey ); + return pxRef && pxRef->get(); + } + + /** Returns a reference to the object accossiated to the passed key, or an + empty reference on error. */ + inline mapped_type get( key_type nKey ) const + { + if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef; + return mapped_type(); + } + + /** Calls the passed functor for every contained object, automatically + skips all elements that are empty references. */ + template< typename FunctorType > + inline void forEach( const FunctorType& rFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType > + inline void forEachMem( FuncType pFunc ) const + { + forEach( ::boost::bind( pFunc, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType > + inline void forEachMem( FuncType pFunc, ParamType aParam ) const + { + forEach( ::boost::bind( pFunc, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); + } + /** Calls the passed functor for every contained object. Passes the key as + first argument and the object reference as second argument to rFunctor. */ + template< typename FunctorType > + inline void forEachWithKey( const FunctorType& rFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as argument to the member function. */ + template< typename FuncType > + inline void forEachMemWithKey( FuncType pFunc ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as first argument to the member function. */ + template< typename FuncType, typename ParamType > + inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); + } + +private: + template< typename FunctorType > + struct ForEachFunctor + { + FunctorType maFunctor; + inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); } + }; + + template< typename FunctorType > + struct ForEachFunctorWithKey + { + FunctorType maFunctor; + inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); } + }; + + inline const mapped_type* getRef( key_type nKey ) const + { + typename container_type::const_iterator aIt = find( nKey ); + return (aIt == this->end()) ? 0 : &aIt->second; + } +}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/helper/refvector.hxx b/oox/inc/oox/helper/refvector.hxx new file mode 100755 index 000000000000..0a2d8be62e2f --- /dev/null +++ b/oox/inc/oox/helper/refvector.hxx @@ -0,0 +1,201 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_HELPER_REFVECTOR_HXX +#define OOX_HELPER_REFVECTOR_HXX + +#include <vector> +#include <boost/bind.hpp> +#include <boost/shared_ptr.hpp> +#include <sal/types.h> + +namespace oox { + +// ============================================================================ + +/** Template for a vector of ref-counted objects with additional accessor functions. + + An instance of the class RefVector< Type > stores elements of the type + ::boost::shared_ptr< Type >. The new accessor functions has() and get() + work correctly for indexes out of the current range, there is no need to + check the passed index before. + */ +template< typename ObjType > +class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > > +{ +public: + typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type; + typedef typename container_type::value_type value_type; + typedef typename container_type::size_type size_type; + +public: + /** Returns true, if the object with the passed index exists. Returns + false, if the vector element exists but is an empty reference. */ + inline bool has( sal_Int32 nIndex ) const + { + const value_type* pxRef = getRef( nIndex ); + return pxRef && pxRef->get(); + } + + /** Returns a reference to the object with the passed index, or 0 on error. */ + inline value_type get( sal_Int32 nIndex ) const + { + if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef; + return value_type(); + } + + /** Returns the index of the last element, or -1, if the vector is empty. + Does *not* check whether the last element is an empty reference. */ + inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; } + + /** Calls the passed functor for every contained object, automatically + skips all elements that are empty references. */ + template< typename FunctorType > + inline void forEach( FunctorType aFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType > + inline void forEachMem( FuncType pFunc ) const + { + forEach( ::boost::bind( pFunc, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType > + inline void forEachMem( FuncType pFunc, ParamType aParam ) const + { + forEach( ::boost::bind( pFunc, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); + } + + /** Calls the passed functor for every contained object. Passes the index as + first argument and the object reference as second argument to rFunctor. */ + template< typename FunctorType > + inline void forEachWithIndex( const FunctorType& rFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index to the member function. */ + template< typename FuncType > + inline void forEachMemWithIndex( FuncType pFunc ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index as first argument to the member function. */ + template< typename FuncType, typename ParamType > + inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); + } + + /** Searches for an element by using the passed functor that takes a + constant reference of the object type (const ObjType&). */ + template< typename FunctorType > + inline value_type findIf( const FunctorType& rFunctor ) const + { + typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) ); + return (aIt == this->end()) ? value_type() : *aIt; + } + +private: + template< typename FunctorType > + struct ForEachFunctor + { + FunctorType maFunctor; + inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); } + }; + + template< typename FunctorType > + struct ForEachFunctorWithIndex + { + FunctorType maFunctor; + sal_Int32 mnIndex; + inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {} + inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; } + }; + + template< typename FunctorType > + struct FindFunctor + { + FunctorType maFunctor; + inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); } + }; + + inline const value_type* getRef( sal_Int32 nIndex ) const + { + return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ? + &(*this)[ static_cast< size_type >( nIndex ) ] : 0; + } +}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/helper/storagebase.hxx b/oox/inc/oox/helper/storagebase.hxx index 5a179e73cf75..d48e5fdd1844 100644 --- a/oox/inc/oox/helper/storagebase.hxx +++ b/oox/inc/oox/helper/storagebase.hxx @@ -28,8 +28,10 @@ #ifndef OOX_HELPER_STORAGEBASE_HXX #define OOX_HELPER_STORAGEBASE_HXX +#include <vector> +#include <com/sun/star/uno/Reference.hxx> +#include "oox/helper/refmap.hxx" #include "oox/dllapi.h" -#include "oox/helper/containerhelper.hxx" namespace com { namespace sun { namespace star { namespace embed { class XStorage; } diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx index 36346402a0e3..f26075ff52eb 100644 --- a/oox/inc/oox/ole/axbinaryreader.hxx +++ b/oox/inc/oox/ole/axbinaryreader.hxx @@ -30,7 +30,7 @@ #include <utility> #include "oox/helper/binaryinputstream.hxx" -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refvector.hxx" namespace oox { namespace ole { diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index 58d0029fcce3..40e81c923d25 100644 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -30,6 +30,7 @@ #include <map> #include <com/sun/star/uno/XInterface.hpp> +#include "oox/helper/refvector.hxx" #include "oox/helper/storagebase.hxx" #include "oox/dllapi.h" diff --git a/oox/inc/oox/token/tokenmap.hxx b/oox/inc/oox/token/tokenmap.hxx index 108feee9a2e8..b197c491ac51 100644 --- a/oox/inc/oox/token/tokenmap.hxx +++ b/oox/inc/oox/token/tokenmap.hxx @@ -66,7 +66,6 @@ private: typedef ::std::vector< TokenName > TokenNameVector; TokenNameVector maTokenNames; - }; // ============================================================================ diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index e1df24a9a6f8..7b13763e0e40 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -29,7 +29,8 @@ #define OOX_VML_VMLSHAPECONTAINER_HXX #include <com/sun/star/awt/Rectangle.hpp> -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" namespace com { namespace sun { namespace star { namespace drawing { class XShapes; } diff --git a/oox/inc/oox/xls/addressconverter.hxx b/oox/inc/oox/xls/addressconverter.hxx index 8ce4388db2f2..11b5e74ccd5c 100644 --- a/oox/inc/oox/xls/addressconverter.hxx +++ b/oox/inc/oox/xls/addressconverter.hxx @@ -69,7 +69,7 @@ struct BinAddress inline void set( sal_Int32 nCol, sal_Int32 nRow ) { mnCol = nCol; mnRow = nRow; } inline void set( const ::com::sun::star::table::CellAddress& rAddr ) { mnCol = rAddr.Column; mnRow = rAddr.Row; } - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; }; @@ -86,7 +86,7 @@ inline bool operator<( const BinAddress& rL, const BinAddress& rR ) return (rL.mnCol < rR.mnCol) || ((rL.mnCol == rR.mnCol) && (rL.mnRow < rR.mnRow)); } -inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinAddress& orPos ) +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinAddress& orPos ) { orPos.read( rStrm ); return rStrm; @@ -134,7 +134,7 @@ struct BinRange inline sal_Int32 getRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; } bool contains( const BinAddress& rAddr ) const; - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; }; @@ -151,7 +151,7 @@ inline bool operator<( const BinRange& rL, const BinRange& rR ) return (rL.maFirst < rR.maFirst) || ((rL.maFirst == rR.maFirst) && (rL.maLast < rR.maLast)); } -inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRange& orRange ) +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRange& orRange ) { orRange.read( rStrm ); return rStrm; @@ -179,7 +179,7 @@ public: BinRange getEnclosingRange() const; - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; void writeSubList( BiffOutputStream& rStrm, @@ -188,7 +188,7 @@ public: // ---------------------------------------------------------------------------- -inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRangeList& orRanges ) +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRangeList& orRanges ) { orRanges.read( rStrm ); return rStrm; diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx index 31aeca252414..ddf083c2ea98 100755 --- a/oox/inc/oox/xls/autofilterbuffer.hxx +++ b/oox/inc/oox/xls/autofilterbuffer.hxx @@ -29,6 +29,7 @@ #define OOX_XLS_AUTOFILTERBUFFER_HXX #include <com/sun/star/table/CellRangeAddress.hpp> +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -68,7 +69,7 @@ public: /** Derived classes import filter settings from the passed attribute list. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Derived classes import filter settings from the passed record. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Derived classes import filter settings from the FILTERCOLUMN record. */ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); @@ -91,7 +92,7 @@ public: /** Imports filter settings from the filters and filter elements. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Returns converted UNO API filter settings representing all filter settings. */ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); @@ -115,7 +116,7 @@ public: /** Imports filter settings from the filters and filter elements. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports filter settings from the FILTERCOLUMN record. */ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); @@ -144,7 +145,7 @@ struct FilterCriterionModel void setBiffOperator( sal_uInt8 nOperator ); /** Imports the criterion model from the passed BIFF12 stream. */ - void readBiffData( RecordInputStream& rStrm ); + void readBiffData( SequenceInputStream& rStrm ); /** Imports the initial criterion data from the passed BIFF5/BIFF8 stream. */ void readBiffData( BiffInputStream& rStrm ); /** Imports the trailing string data from the passed BIFF5/BIFF8 stream. */ @@ -164,7 +165,7 @@ public: /** Imports filter settings from the filters and filter elements. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports filter settings from the FILTERCOLUMN record. */ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); @@ -195,7 +196,7 @@ public: /** Imports auto filter column settings from the filterColumn element. */ void importFilterColumn( const AttributeList& rAttribs ); /** Imports auto filter column settings from the FILTERCOLUMN record. */ - void importFilterColumn( RecordInputStream& rStrm ); + void importFilterColumn( SequenceInputStream& rStrm ); /** Imports auto filter column settings from the FILTERCOLUMN record. */ void importFilterColumn( BiffInputStream& rStrm ); @@ -228,10 +229,10 @@ public: /** Imports auto filter settings from the autoFilter element. */ void importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet ); /** Imports auto filter settings from the AUTOFILTER record. */ - void importAutoFilter( RecordInputStream& rStrm, sal_Int16 nSheet ); + void importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet ); /** Creates a new auto filter column and stores it internally. */ - FilterColumn& createFilterColumn(); + FilterColumn& createFilterColumn(); /** Applies the filter to the passed filter descriptor. */ void finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor2 >& rxFilterDesc ); diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx index 6deb40bedd9c..13508bbf5e63 100644 --- a/oox/inc/oox/xls/autofiltercontext.hxx +++ b/oox/inc/oox/xls/autofiltercontext.hxx @@ -48,8 +48,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: FilterSettingsBase& mrFilterSettings; @@ -66,8 +66,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: FilterColumn& mrFilterColumn; @@ -84,8 +84,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: AutoFilter& mrAutoFilter; diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx index dd93621ba130..9c0a57a83c04 100644 --- a/oox/inc/oox/xls/biffhelper.hxx +++ b/oox/inc/oox/xls/biffhelper.hxx @@ -30,6 +30,8 @@ #include "oox/helper/binarystreambase.hxx" +namespace oox { class SequenceInputStream; } + namespace oox { namespace xls { @@ -615,7 +617,12 @@ public: /** Returns a Windows code page from a text encoding. */ static sal_uInt16 calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc ); - // import ----------------------------------------------------------------- + // BIFF12 import ---------------------------------------------------------- + + /** Reads a BIFF12 string with leading 16-bit or 32-bit length field. */ + static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true ); + + // BIFF2-BIFF8 import ----------------------------------------------------- /** Returns true, if the current record of the stream is a BOF record. */ static bool isBofRecord( BiffInputStream& rStrm ); @@ -644,6 +651,15 @@ private: ~BiffHelper(); // not implemented }; +// ---------------------------------------------------------------------------- + +/** BIFF12 stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */ +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, ::rtl::OUString& orString ) +{ + orString = BiffHelper::readString( rStrm ); + return rStrm; +} + // ============================================================================ } // namespace xls diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx index 6609618a8b7d..8dfedc5ba48e 100644 --- a/oox/inc/oox/xls/chartsheetfragment.hxx +++ b/oox/inc/oox/xls/chartsheetfragment.hxx @@ -48,7 +48,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void initializeImport(); @@ -58,7 +58,7 @@ private: /** Imports the the relation identifier for the DrawingML part. */ void importDrawing( const AttributeList& rAttribs ); /** Imports the DRAWING record containing the relation identifier for the DrawingML part. */ - void importDrawing( RecordInputStream& rStrm ); + void importDrawing( SequenceInputStream& rStrm ); }; // ============================================================================ diff --git a/oox/inc/oox/xls/commentsbuffer.hxx b/oox/inc/oox/xls/commentsbuffer.hxx index bc03fcdc1c0c..e87d52ff03a2 100644 --- a/oox/inc/oox/xls/commentsbuffer.hxx +++ b/oox/inc/oox/xls/commentsbuffer.hxx @@ -56,7 +56,7 @@ public: /** Imports a cell comment from the passed attributes of the comment element. */ void importComment( const AttributeList& rAttribs ); /** Imports a cell comment from the passed stream of a COMMENT record. */ - void importComment( RecordInputStream& rStrm ); + void importComment( SequenceInputStream& rStrm ); /** Creates and returns a new rich-string object for the comment text. */ RichStringRef createText(); diff --git a/oox/inc/oox/xls/commentsfragment.hxx b/oox/inc/oox/xls/commentsfragment.hxx index ba0870f85503..3751cde764f4 100644 --- a/oox/inc/oox/xls/commentsfragment.hxx +++ b/oox/inc/oox/xls/commentsfragment.hxx @@ -47,7 +47,7 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void onEndRecord(); virtual const ::oox::core::RecordInfo* getRecordInfos() const; @@ -56,7 +56,7 @@ private: /** Imports comment data from the comment element. */ void importComment( const AttributeList& rAttribs ); /** Imports comment data from the COMMENT record. */ - void importComment( RecordInputStream& rStrm ); + void importComment( SequenceInputStream& rStrm ); private: CommentRef mxComment; diff --git a/oox/inc/oox/xls/condformatbuffer.hxx b/oox/inc/oox/xls/condformatbuffer.hxx index da844f8c3669..fae6381f6402 100644 --- a/oox/inc/oox/xls/condformatbuffer.hxx +++ b/oox/inc/oox/xls/condformatbuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_CONDFORMATBUFFER_HXX #include <com/sun/star/sheet/ConditionOperator.hpp> -#include "oox/helper/containerhelper.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheethelper.hxx" @@ -87,7 +86,7 @@ public: void appendFormula( const ::rtl::OUString& rFormula ); /** Imports rule settings from a CFRULE record. */ - void importCfRule( RecordInputStream& rStrm ); + void importCfRule( SequenceInputStream& rStrm ); /** Imports rule settings from a CFRULE record. */ void importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority ); @@ -131,9 +130,9 @@ public: CondFormatRuleRef importCfRule( const AttributeList& rAttribs ); /** Imports settings from the CONDFORMATTING record. */ - void importCondFormatting( RecordInputStream& rStrm ); + void importCondFormatting( SequenceInputStream& rStrm ); /** Imports a conditional formatting rule from the CFRULE record. */ - void importCfRule( RecordInputStream& rStrm ); + void importCfRule( SequenceInputStream& rStrm ); /** Imports settings from the CFHEADER record. */ void importCfHeader( BiffInputStream& rStrm ); @@ -167,7 +166,7 @@ public: /** Imports settings from the conditionalFormatting element. */ CondFormatRef importConditionalFormatting( const AttributeList& rAttribs ); /** Imports settings from the CONDFORMATTING record. */ - CondFormatRef importCondFormatting( RecordInputStream& rStrm ); + CondFormatRef importCondFormatting( SequenceInputStream& rStrm ); /** Imports settings from the CFHEADER record. */ void importCfHeader( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/condformatcontext.hxx b/oox/inc/oox/xls/condformatcontext.hxx index 72953bffe423..44c9fe592250 100644 --- a/oox/inc/oox/xls/condformatcontext.hxx +++ b/oox/inc/oox/xls/condformatcontext.hxx @@ -46,8 +46,8 @@ protected: virtual void onStartElement( const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: CondFormatRef mxCondFmt; diff --git a/oox/inc/oox/xls/connectionsbuffer.hxx b/oox/inc/oox/xls/connectionsbuffer.hxx index 69d609993864..98a5bea17bc6 100755 --- a/oox/inc/oox/xls/connectionsbuffer.hxx +++ b/oox/inc/oox/xls/connectionsbuffer.hxx @@ -28,6 +28,7 @@ #ifndef OOX_XLS_CONNECTIONSBUFFER_HXX #define OOX_XLS_CONNECTIONSBUFFER_HXX +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace oox { @@ -120,13 +121,13 @@ public: void importTable( const AttributeList& rAttribs, sal_Int32 nElement ); /** Imports connection settings from the CONNECTION record. */ - void importConnection( RecordInputStream& rStrm ); + void importConnection( SequenceInputStream& rStrm ); /** Imports web query settings from the WEBPR record. */ - void importWebPr( RecordInputStream& rStrm ); + void importWebPr( SequenceInputStream& rStrm ); /** Imports web query table settings from the WEBPRTABLES record. */ - void importWebPrTables( RecordInputStream& rStrm ); + void importWebPrTables( SequenceInputStream& rStrm ); /** Imports a web query table identifier from the PCITEM_MISSING, PCITEM_STRING, or PCITEM_INDEX record. */ - void importWebPrTable( RecordInputStream& rStrm, sal_Int32 nRecId ); + void importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId ); /** Imports connection settings from the DBQUERY record. */ void importDbQuery( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/connectionsfragment.hxx b/oox/inc/oox/xls/connectionsfragment.hxx index 8c4a608de7d1..5a9a9085c6c5 100644 --- a/oox/inc/oox/xls/connectionsfragment.hxx +++ b/oox/inc/oox/xls/connectionsfragment.hxx @@ -46,8 +46,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: Connection& mrConnection; @@ -64,7 +64,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx index 15d7db41832d..5374c47f6a07 100644 --- a/oox/inc/oox/xls/defnamesbuffer.hxx +++ b/oox/inc/oox/xls/defnamesbuffer.hxx @@ -28,8 +28,6 @@ #ifndef OOX_XLS_DEFINEDNAMESBUFFER_HXX #define OOX_XLS_DEFINEDNAMESBUFFER_HXX -#include "oox/helper/containerhelper.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/formulabase.hxx" namespace com { namespace sun { namespace star { @@ -99,7 +97,7 @@ protected: /** Imports the OOXML formula string, using the passed formula context. */ void importOoxFormula( FormulaContext& rContext, sal_Int16 nBaseSheet ); /** Imports the BIFF12 formula, using the passed formula context. */ - void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm ); + void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm ); /** Imports the BIFF formula, using the passed formula context. */ void importBiffFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 ); @@ -125,7 +123,7 @@ public: /** Sets the formula string from the body of the definedName element. */ void setFormula( const ::rtl::OUString& rFormula ); /** Imports the defined name from a DEFINEDNAME record in the passed stream. */ - void importDefinedName( RecordInputStream& rStrm ); + void importDefinedName( SequenceInputStream& rStrm ); /** Imports the defined name from a DEFINEDNAME record in the passed BIFF stream. */ void importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcSheet ); @@ -187,7 +185,7 @@ public: /** Imports a defined name from the passed attribute set. */ DefinedNameRef importDefinedName( const AttributeList& rAttribs ); /** Imports a defined name from a DEFINEDNAME record in the passed stream. */ - void importDefinedName( RecordInputStream& rStrm ); + void importDefinedName( SequenceInputStream& rStrm ); /** Imports a defined name from a DEFINEDNAME record in the passed BIFF stream. */ void importDefinedName( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/externallinkbuffer.hxx b/oox/inc/oox/xls/externallinkbuffer.hxx index efa99440594f..c616a2b97e97 100644 --- a/oox/inc/oox/xls/externallinkbuffer.hxx +++ b/oox/inc/oox/xls/externallinkbuffer.hxx @@ -84,19 +84,19 @@ public: void importOleItem( const AttributeList& rAttribs ); /** Imports the EXTERNALNAME record containing the name (only). */ - void importExternalName( RecordInputStream& rStrm ); + void importExternalName( SequenceInputStream& rStrm ); /** Imports the EXTERNALNAMEFLAGS record containing the settings of an external name. */ - void importExternalNameFlags( RecordInputStream& rStrm ); + void importExternalNameFlags( SequenceInputStream& rStrm ); /** Imports the DDEITEMVALUES record containing the size of the DDE result matrix. */ - void importDdeItemValues( RecordInputStream& rStrm ); + void importDdeItemValues( SequenceInputStream& rStrm ); /** Imports the DDEITEM_BOOL record containing a boolean value in a link result. */ - void importDdeItemBool( RecordInputStream& rStrm ); + void importDdeItemBool( SequenceInputStream& rStrm ); /** Imports the DDEITEM_DOUBLE record containing a double value in a link result. */ - void importDdeItemDouble( RecordInputStream& rStrm ); + void importDdeItemDouble( SequenceInputStream& rStrm ); /** Imports the DDEITEM_ERROR record containing an error code in a link result. */ - void importDdeItemError( RecordInputStream& rStrm ); + void importDdeItemError( SequenceInputStream& rStrm ); /** Imports the DDEITEM_STRING record containing a string in a link result. */ - void importDdeItemString( RecordInputStream& rStrm ); + void importDdeItemString( SequenceInputStream& rStrm ); /** Imports the EXTERNALNAME record from the passed stream. */ void importExternalName( BiffInputStream& rStrm ); @@ -227,19 +227,19 @@ public: ExternalNameRef importOleItem( const AttributeList& rAttribs ); /** Imports the EXTERNALBOOK record describing an externally linked document, DDE link, or OLE link. */ - void importExternalBook( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importExternalBook( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the EXTSHEETNAMES record containing the sheet names in an externally linked document. */ - void importExtSheetNames( RecordInputStream& rStrm ); + void importExtSheetNames( SequenceInputStream& rStrm ); /** Imports the EXTERNALNAME record describing an external name. */ - ExternalNameRef importExternalName( RecordInputStream& rStrm ); + ExternalNameRef importExternalName( SequenceInputStream& rStrm ); /** Imports the EXTERNALREF record from the passed stream. */ - void importExternalRef( RecordInputStream& rStrm ); + void importExternalRef( SequenceInputStream& rStrm ); /** Imports the EXTERNALSELF record from the passed stream. */ - void importExternalSelf( RecordInputStream& rStrm ); + void importExternalSelf( SequenceInputStream& rStrm ); /** Imports the EXTERNALSAME record from the passed stream. */ - void importExternalSame( RecordInputStream& rStrm ); + void importExternalSame( SequenceInputStream& rStrm ); /** Imports the EXTERNALADDIN record from the passed stream. */ - void importExternalAddin( RecordInputStream& rStrm ); + void importExternalAddin( SequenceInputStream& rStrm ); /** Imports the EXTERNSHEET record from the passed stream. */ void importExternSheet( BiffInputStream& rStrm ); @@ -332,7 +332,7 @@ struct RefSheetsModel explicit RefSheetsModel(); - void readBiff12Data( RecordInputStream& rStrm ); + void readBiff12Data( SequenceInputStream& rStrm ); void readBiff8Data( BiffInputStream& rStrm ); }; @@ -347,15 +347,15 @@ public: ExternalLinkRef importExternalReference( const AttributeList& rAttribs ); /** Imports the EXTERNALREF record from the passed stream. */ - ExternalLinkRef importExternalRef( RecordInputStream& rStrm ); + ExternalLinkRef importExternalRef( SequenceInputStream& rStrm ); /** Imports the EXTERNALSELF record from the passed stream. */ - void importExternalSelf( RecordInputStream& rStrm ); + void importExternalSelf( SequenceInputStream& rStrm ); /** Imports the EXTERNALSAME record from the passed stream. */ - void importExternalSame( RecordInputStream& rStrm ); + void importExternalSame( SequenceInputStream& rStrm ); /** Imports the EXTERNALADDIN record from the passed stream. */ - void importExternalAddin( RecordInputStream& rStrm ); + void importExternalAddin( SequenceInputStream& rStrm ); /** Imports the EXTERNALSHEETS record from the passed stream. */ - void importExternalSheets( RecordInputStream& rStrm ); + void importExternalSheets( SequenceInputStream& rStrm ); /** Imports the EXTERNSHEET record from the passed stream. */ ExternalLinkRef importExternSheet( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/externallinkfragment.hxx b/oox/inc/oox/xls/externallinkfragment.hxx index 1a89e17c96a4..0e1f293d2444 100644 --- a/oox/inc/oox/xls/externallinkfragment.hxx +++ b/oox/inc/oox/xls/externallinkfragment.hxx @@ -55,22 +55,22 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: /** Imports cell settings from a c element. */ void importCell( const AttributeList& rAttribs ); /** Imports the EXTCELL_BLANK from the passed stream. */ - void importExtCellBlank( RecordInputStream& rStrm ); + void importExtCellBlank( SequenceInputStream& rStrm ); /** Imports the EXTCELL_BOOL from the passed stream. */ - void importExtCellBool( RecordInputStream& rStrm ); + void importExtCellBool( SequenceInputStream& rStrm ); /** Imports the EXTCELL_DOUBLE from the passed stream. */ - void importExtCellDouble( RecordInputStream& rStrm ); + void importExtCellDouble( SequenceInputStream& rStrm ); /** Imports the EXTCELL_ERROR from the passed stream. */ - void importExtCellError( RecordInputStream& rStrm ); + void importExtCellError( SequenceInputStream& rStrm ); /** Imports the EXTCELL_STRING from the passed stream. */ - void importExtCellString( RecordInputStream& rStrm ); + void importExtCellString( SequenceInputStream& rStrm ); /** Sets the passed cell value to the current position in the sheet cache. */ void setCellValue( const ::com::sun::star::uno::Any& rValue ); @@ -97,7 +97,7 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx index d9fdf34cfbbb..013e63f3bf30 100644 --- a/oox/inc/oox/xls/formulabase.hxx +++ b/oox/inc/oox/xls/formulabase.hxx @@ -33,8 +33,8 @@ #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> #include <com/sun/star/uno/Sequence.hxx> -#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/addressconverter.hxx" namespace com { namespace sun { namespace star { @@ -232,7 +232,7 @@ struct BinSingleRef2d void setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset ); void setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelativeAsOffset ); - void readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ); + void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ); void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); }; @@ -245,7 +245,7 @@ struct BinComplexRef2d BinSingleRef2d maRef1; /// Start (top-left) cell address. BinSingleRef2d maRef2; /// End (bottom-right) cell address. - void readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ); + void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ); void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); }; diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx index 6368606282b6..c595993264d9 100644 --- a/oox/inc/oox/xls/formulaparser.hxx +++ b/oox/inc/oox/xls/formulaparser.hxx @@ -120,7 +120,7 @@ public: /** Imports and converts a BIFF12 token array from the passed stream. */ void importFormula( FormulaContext& rContext, - RecordInputStream& rStrm ) const; + SequenceInputStream& rStrm ) const; /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. @param pnFmlaSize Size of the token array. If null is passed, reads @@ -150,7 +150,7 @@ public: ::rtl::OUString importOleTargetLink( const ::rtl::OUString& rFormulaString ); /** Imports and converts an OLE link target from the passed stream. */ - ::rtl::OUString importOleTargetLink( RecordInputStream& rStrm ); + ::rtl::OUString importOleTargetLink( SequenceInputStream& rStrm ); /** Imports and converts an OLE link target from the passed stream. */ ::rtl::OUString importOleTargetLink( diff --git a/oox/inc/oox/xls/numberformatsbuffer.hxx b/oox/inc/oox/xls/numberformatsbuffer.hxx index 4db4bddafc09..768572a5839c 100644 --- a/oox/inc/oox/xls/numberformatsbuffer.hxx +++ b/oox/inc/oox/xls/numberformatsbuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_NUMBERFORMATSBUFFER_HXX #include <com/sun/star/lang/Locale.hpp> -#include "oox/helper/containerhelper.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -109,7 +108,7 @@ public: /** Inserts a new number format code. */ NumberFormatRef importNumFmt( const AttributeList& rAttribs ); /** Inserts a new number format code from a NUMFMT record. */ - void importNumFmt( RecordInputStream& rStrm ); + void importNumFmt( SequenceInputStream& rStrm ); /** Inserts a new number format code from a FORMAT record. */ void importFormat( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/pagesettings.hxx b/oox/inc/oox/xls/pagesettings.hxx index cbb92aa01244..6ff896b1bb51 100644 --- a/oox/inc/oox/xls/pagesettings.hxx +++ b/oox/inc/oox/xls/pagesettings.hxx @@ -110,17 +110,17 @@ public: void importPicture( const ::oox::core::Relations& rRelations, const AttributeList& rAttribs ); /** Imports the PRINTOPTIONS record from the passed stream. */ - void importPrintOptions( RecordInputStream& rStrm ); + void importPrintOptions( SequenceInputStream& rStrm ); /** Imports the PAGEMARGINS record from the passed stream. */ - void importPageMargins( RecordInputStream& rStrm ); + void importPageMargins( SequenceInputStream& rStrm ); /** Imports the PAGESETUP record from the passed stream. */ - void importPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the CHARTPAGESETUP record from the passed stream. */ - void importChartPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importChartPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the HEADERFOOTER record from the passed stream. */ - void importHeaderFooter( RecordInputStream& rStrm ); + void importHeaderFooter( SequenceInputStream& rStrm ); /** Imports the PICTURE record from the passed stream. */ - void importPicture( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importPicture( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the LEFTMARGIN record from the passed BIFF stream. */ void importLeftMargin( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/pivotcachebuffer.hxx b/oox/inc/oox/xls/pivotcachebuffer.hxx index 0c33516746ca..2e32d0faa7e5 100644 --- a/oox/inc/oox/xls/pivotcachebuffer.hxx +++ b/oox/inc/oox/xls/pivotcachebuffer.hxx @@ -31,7 +31,7 @@ #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> #include <com/sun/star/util/DateTime.hpp> -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -66,17 +66,17 @@ public: void readIndex( const AttributeList& rAttribs ); /** Reads the string value from a pivot cache item. */ - void readString( RecordInputStream& rStrm ); + void readString( SequenceInputStream& rStrm ); /** Reads the double value from a pivot cache item. */ - void readDouble( RecordInputStream& rStrm ); + void readDouble( SequenceInputStream& rStrm ); /** Reads the date/time value from a pivot cache item. */ - void readDate( RecordInputStream& rStrm ); + void readDate( SequenceInputStream& rStrm ); /** Reads the boolean value from a pivot cache item. */ - void readBool( RecordInputStream& rStrm ); + void readBool( SequenceInputStream& rStrm ); /** Reads the error code value from a pivot cache item. */ - void readError( RecordInputStream& rStrm ); + void readError( SequenceInputStream& rStrm ); /** Reads the index of a shared item. */ - void readIndex( RecordInputStream& rStrm ); + void readIndex( SequenceInputStream& rStrm ); /** Reads the string value from a pivot cache item. */ void readString( BiffInputStream& rStrm, const WorkbookHelper& rHelper ); @@ -113,7 +113,7 @@ public: /** Imports the item from the passed attribute list. */ void importItem( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the item from the passed stream and record. */ - void importItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports a complete item list from the passed stream. */ void importItemList( BiffInputStream& rStrm, sal_uInt16 nCount ); @@ -131,7 +131,7 @@ private: /** Creates and returns a new item at the end of the items list. */ PivotCacheItem& createItem(); /** Imports an array of items from the PCITEM_ARRAY record */ - void importArray( RecordInputStream& rStrm ); + void importArray( SequenceInputStream& rStrm ); private: typedef ::std::vector< PivotCacheItem > CacheItemVector; @@ -237,19 +237,19 @@ public: void importGroupItem( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports pivot cache field settings from the PCDFIELD record. */ - void importPCDField( RecordInputStream& rStrm ); + void importPCDField( SequenceInputStream& rStrm ); /** Imports shared items settings from the PCDFSHAREDITEMS record. */ - void importPCDFSharedItems( RecordInputStream& rStrm ); + void importPCDFSharedItems( SequenceInputStream& rStrm ); /** Imports one or more shared items from the passed record. */ - void importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports grouping settings from the PCDFIELDGROUP record. */ - void importPCDFieldGroup( RecordInputStream& rStrm ); + void importPCDFieldGroup( SequenceInputStream& rStrm ); /** Imports numeric grouping settings from the PCDFRANGEPR record. */ - void importPCDFRangePr( RecordInputStream& rStrm ); + void importPCDFRangePr( SequenceInputStream& rStrm ); /** Imports an item of the mapping between group items and base items from the passed record. */ - void importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports one or more group items from the passed record. */ - void importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports pivot cache field settings from the PCDFIELD record. */ void importPCDField( BiffInputStream& rStrm ); @@ -304,7 +304,7 @@ public: const PivotCacheItem& rItem ) const; /** Reads an item from the PCRECORD record and writes it to the passed sheet. */ - void importPCRecordItem( RecordInputStream& rStrm, + void importPCRecordItem( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const; /** Reads an item index from the PCITEM_INDEXLIST record and writes the item to the passed sheet. */ void importPCItemIndex( BiffInputStream& rStrm, @@ -392,11 +392,11 @@ public: void importWorksheetSource( const AttributeList& rAttribs, const ::oox::core::Relations& rRelations ); /** Reads pivot cache global settings from the PCDEFINITION record. */ - void importPCDefinition( RecordInputStream& rStrm ); + void importPCDefinition( SequenceInputStream& rStrm ); /** Reads cache source settings from the PCDSOURCE record. */ - void importPCDSource( RecordInputStream& rStrm ); + void importPCDSource( SequenceInputStream& rStrm ); /** Reads sheet source settings from the PCDSHEETSOURCE record. */ - void importPCDSheetSource( RecordInputStream& rStrm, const ::oox::core::Relations& rRelations ); + void importPCDSheetSource( SequenceInputStream& rStrm, const ::oox::core::Relations& rRelations ); /** Reads cache source settings from the PCDSOURCE record. */ void importPCDSource( BiffInputStream& rStrm ); @@ -434,7 +434,7 @@ public: const PivotCacheItem& rItem ) const; /** Reads a PCRECORD record and writes all item values to the passed sheet. */ - void importPCRecord( RecordInputStream& rStrm, + void importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const; /** Reads a PCITEM_INDEXLIST record and writes all item values to the passed sheet. */ void importPCItemIndexList( BiffInputStream& rStrm, diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx index 4521fc8c0859..34a833e26525 100644 --- a/oox/inc/oox/xls/pivotcachefragment.hxx +++ b/oox/inc/oox/xls/pivotcachefragment.hxx @@ -48,8 +48,8 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: PivotCacheField& mrCacheField; @@ -67,7 +67,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); @@ -87,13 +87,13 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; private: void startCacheRecord(); - void importPCRecord( RecordInputStream& rStrm ); - void importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCRecord( SequenceInputStream& rStrm ); + void importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: const PivotCache& mrPivotCache; diff --git a/oox/inc/oox/xls/pivottablebuffer.hxx b/oox/inc/oox/xls/pivottablebuffer.hxx index cd62c6fb0a8b..7732037bd579 100644 --- a/oox/inc/oox/xls/pivottablebuffer.hxx +++ b/oox/inc/oox/xls/pivottablebuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_PIVOTTABLEBUFFER_HXX #include <com/sun/star/table/CellRangeAddress.hpp> -#include "oox/helper/containerhelper.hxx" #include "oox/xls/pivotcachebuffer.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -145,13 +144,13 @@ public: void importReferenceItem( const AttributeList& rAttribs ); /** Imports pivot field settings from the PTFIELD record. */ - void importPTField( RecordInputStream& rStrm ); + void importPTField( SequenceInputStream& rStrm ); /** Imports settings of an item in this pivot field from the PTFITEM record. */ - void importPTFItem( RecordInputStream& rStrm ); + void importPTFItem( SequenceInputStream& rStrm ); /** Imports pivot field reference settings from the PTREFERENCE record. */ - void importPTReference( RecordInputStream& rStrm ); + void importPTReference( SequenceInputStream& rStrm ); /** Imports pivot field item reference settings from the PTREFERENCEITEM record. */ - void importPTReferenceItem( RecordInputStream& rStrm ); + void importPTReferenceItem( SequenceInputStream& rStrm ); /** Imports pivot field settings from the PTFIELD and following records. */ void importPTField( BiffInputStream& rStrm ); @@ -235,9 +234,9 @@ public: void importTop10( const AttributeList& rAttribs ); /** Reads the settings of a field filter from the PTFILTER record. */ - void importPTFilter( RecordInputStream& rStrm ); + void importPTFilter( SequenceInputStream& rStrm ); /** Reads additional settings of a field filter from the TOP10FILTER record. */ - void importTop10Filter( RecordInputStream& rStrm ); + void importTop10Filter( SequenceInputStream& rStrm ); /** Applies the filter to the associated pivot table field if possible. */ void finalizeImport(); @@ -334,17 +333,17 @@ public: void importDataField( const AttributeList& rAttribs ); /** Reads global pivot table settings from the PTDEFINITION record. */ - void importPTDefinition( RecordInputStream& rStrm ); + void importPTDefinition( SequenceInputStream& rStrm ); /** Reads the location of the pivot table from the PTLOCATION record. */ - void importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet ); + void importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet ); /** Reads the indexes of all fields located in the row dimension from a PTROWFIELDS record. */ - void importPTRowFields( RecordInputStream& rStrm ); + void importPTRowFields( SequenceInputStream& rStrm ); /** Reads the indexes of all fields located in the column dimension from a PTCOLFIELDS record. */ - void importPTColFields( RecordInputStream& rStrm ); + void importPTColFields( SequenceInputStream& rStrm ); /** Reads the settings of a field located in the page dimension from the PTPAGEFIELD record. */ - void importPTPageField( RecordInputStream& rStrm ); + void importPTPageField( SequenceInputStream& rStrm ); /** Reads the settings of a field located in the data dimension from the PTDATAFIELD record. */ - void importPTDataField( RecordInputStream& rStrm ); + void importPTDataField( SequenceInputStream& rStrm ); /** Reads global pivot table settings from the PTDEFINITION record. */ void importPTDefinition( BiffInputStream& rStrm, sal_Int16 nSheet ); @@ -404,7 +403,7 @@ private: /** Reads a field index for the row or column dimension. */ static void importField( IndexVector& orFields, const AttributeList& rAttribs ); /** Reads an array of field indexes for the row or column dimension. */ - static void importFields( IndexVector& orFields, RecordInputStream& rStrm ); + static void importFields( IndexVector& orFields, SequenceInputStream& rStrm ); /** Reads an array of field indexes for the row or column dimension. */ static void importFields( IndexVector& orFields, BiffInputStream& rStrm, sal_Int32 nCount ); diff --git a/oox/inc/oox/xls/pivottablefragment.hxx b/oox/inc/oox/xls/pivottablefragment.hxx index 039adc36134f..aafae063990c 100644 --- a/oox/inc/oox/xls/pivottablefragment.hxx +++ b/oox/inc/oox/xls/pivottablefragment.hxx @@ -50,8 +50,8 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: PivotTableField& mrTableField; @@ -69,8 +69,8 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: PivotTableFilter& mrTableFilter; @@ -87,7 +87,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; private: diff --git a/oox/inc/oox/xls/querytablebuffer.hxx b/oox/inc/oox/xls/querytablebuffer.hxx index 0034a3b44c82..fa67ca8874c0 100644 --- a/oox/inc/oox/xls/querytablebuffer.hxx +++ b/oox/inc/oox/xls/querytablebuffer.hxx @@ -67,7 +67,7 @@ public: /** Imports query table settings from the queryTable element. */ void importQueryTable( const AttributeList& rAttribs ); /** Imports query table settings from the QUERYTABLE record. */ - void importQueryTable( RecordInputStream& rStrm ); + void importQueryTable( SequenceInputStream& rStrm ); /** Imports query table settings from the QUERYTABLE record. */ void importQueryTable( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/querytablefragment.hxx b/oox/inc/oox/xls/querytablefragment.hxx index 9aafdd15684e..6eb561aa5a5e 100644 --- a/oox/inc/oox/xls/querytablefragment.hxx +++ b/oox/inc/oox/xls/querytablefragment.hxx @@ -46,7 +46,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; diff --git a/oox/inc/oox/xls/richstring.hxx b/oox/inc/oox/xls/richstring.hxx index 8bf371ed448d..f21e2a021111 100644 --- a/oox/inc/oox/xls/richstring.hxx +++ b/oox/inc/oox/xls/richstring.hxx @@ -28,7 +28,7 @@ #ifndef OOX_XLS_RICHSTRING_HXX #define OOX_XLS_RICHSTRING_HXX -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/stylesbuffer.hxx" namespace com { namespace sun { namespace star { @@ -110,7 +110,7 @@ struct FontPortionModel explicit inline FontPortionModel( sal_Int32 nPos, sal_Int32 nFontId ) : mnPos( nPos ), mnFontId( nFontId ) {} - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, BiffFontPortionMode eMode ); }; @@ -125,7 +125,7 @@ public: /** Appends a rich-string font identifier. */ void appendPortion( const FontPortionModel& rPortion ); /** Reads count and font identifiers from the passed stream. */ - void importPortions( RecordInputStream& rStrm ); + void importPortions( SequenceInputStream& rStrm ); /** Reads nCount font identifiers from the passed stream. */ void importPortions( BiffInputStream& rStrm, sal_uInt16 nCount, BiffFontPortionMode eMode ); /** Reads count and font identifiers from the passed stream. */ @@ -156,12 +156,12 @@ public: /** Imports phonetic settings from the phoneticPr element. */ void importPhoneticPr( const AttributeList& rAttribs ); /** Imports phonetic settings from the PHONETICPR record. */ - void importPhoneticPr( RecordInputStream& rStrm ); + void importPhoneticPr( SequenceInputStream& rStrm ); /** Imports phonetic settings from the PHONETICPR record. */ void importPhoneticPr( BiffInputStream& rStrm ); /** Imports phonetic settings from a rich string. */ - void importStringData( RecordInputStream& rStrm ); + void importStringData( SequenceInputStream& rStrm ); /** Imports phonetic settings from a rich string. */ void importStringData( BiffInputStream& rStrm ); @@ -206,7 +206,7 @@ struct PhoneticPortionModel explicit inline PhoneticPortionModel( sal_Int32 nPos, sal_Int32 nBasePos, sal_Int32 nBaseLen ) : mnPos( nPos ), mnBasePos( nBasePos ), mnBaseLen( nBaseLen ) {} - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm ); }; @@ -221,7 +221,7 @@ public: /** Appends a rich-string phonetic portion. */ void appendPortion( const PhoneticPortionModel& rPortion ); /** Reads all phonetic portions from the passed stream. */ - void importPortions( RecordInputStream& rStrm ); + void importPortions( SequenceInputStream& rStrm ); /** Reads phonetic portion data from the passed stream. */ ::rtl::OUString importPortions( BiffInputStream& rStrm, sal_Int32 nPhoneticSize ); }; @@ -244,7 +244,7 @@ public: void importPhoneticPr( const AttributeList& rAttribs ); /** Imports a Unicode rich-string from the passed record stream. */ - void importString( RecordInputStream& rStrm, bool bRich ); + void importString( SequenceInputStream& rStrm, bool bRich ); /** Imports a byte string from the passed BIFF stream. */ void importByteString( BiffInputStream& rStrm, rtl_TextEncoding eDefaultTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT ); diff --git a/oox/inc/oox/xls/scenariobuffer.hxx b/oox/inc/oox/xls/scenariobuffer.hxx index 390844f6a706..ed8d4e919bd2 100644 --- a/oox/inc/oox/xls/scenariobuffer.hxx +++ b/oox/inc/oox/xls/scenariobuffer.hxx @@ -29,7 +29,8 @@ #define OOX_XLS_SCENARIOBUFFER_HXX #include <com/sun/star/table/CellAddress.hpp> -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace oox { @@ -73,9 +74,9 @@ public: void importInputCells( const AttributeList& rAttribs ); /** Imports a scenario definition from a SCENARIO record. */ - void importScenario( RecordInputStream& rStrm ); + void importScenario( SequenceInputStream& rStrm ); /** Imports a new cell for this scenario from a INPUTCELLS record. */ - void importInputCells( RecordInputStream& rStrm ); + void importInputCells( SequenceInputStream& rStrm ); /** Imports a scenario definition from a SCENARIO record. */ void importScenario( BiffInputStream& rStrm ); @@ -111,7 +112,7 @@ public: /** Imports sheet scenario settings from a scenarios element. */ void importScenarios( const AttributeList& rAttribs ); /** Imports sheet scenario settings from a SCENARIOS record. */ - void importScenarios( RecordInputStream& rStrm ); + void importScenarios( SequenceInputStream& rStrm ); /** Imports sheet scenario settings from a SCENARIOS record. */ void importScenarios( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/scenariocontext.hxx b/oox/inc/oox/xls/scenariocontext.hxx index 00570ad23016..3e6ccc5c22d6 100644 --- a/oox/inc/oox/xls/scenariocontext.hxx +++ b/oox/inc/oox/xls/scenariocontext.hxx @@ -47,8 +47,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: Scenario& mrScenario; @@ -65,8 +65,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: SheetScenarios& mrSheetScenarios; diff --git a/oox/inc/oox/xls/sharedformulabuffer.hxx b/oox/inc/oox/xls/sharedformulabuffer.hxx index 455fa781a41d..94b7572dcfd9 100644 --- a/oox/inc/oox/xls/sharedformulabuffer.hxx +++ b/oox/inc/oox/xls/sharedformulabuffer.hxx @@ -66,7 +66,7 @@ public: const ::rtl::OUString& rSharedRange, sal_Int32 nId, const ::com::sun::star::table::CellAddress& rBaseAddr ); /** Imports a shared formula from a SHAREDFORMULA record in the passed stream */ - void importSharedFmla( RecordInputStream& rStrm, + void importSharedFmla( SequenceInputStream& rStrm, const ::com::sun::star::table::CellAddress& rBaseAddr ); /** Imports a shared formula from a SHAREDFMLA record in the passed stream. */ void importSharedFmla( BiffInputStream& rStrm, diff --git a/oox/inc/oox/xls/sharedstringsbuffer.hxx b/oox/inc/oox/xls/sharedstringsbuffer.hxx index d5ec04c956a3..eff8ab4e7738 100644 --- a/oox/inc/oox/xls/sharedstringsbuffer.hxx +++ b/oox/inc/oox/xls/sharedstringsbuffer.hxx @@ -28,7 +28,6 @@ #ifndef OOX_XLS_SHAREDSTRINGSBUFFER_HXX #define OOX_XLS_SHAREDSTRINGSBUFFER_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/xls/richstring.hxx" namespace oox { diff --git a/oox/inc/oox/xls/sharedstringsfragment.hxx b/oox/inc/oox/xls/sharedstringsfragment.hxx index 30b5e341866a..bc3a23122d19 100644 --- a/oox/inc/oox/xls/sharedstringsfragment.hxx +++ b/oox/inc/oox/xls/sharedstringsfragment.hxx @@ -44,7 +44,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx index 6a267db28214..fdbc0ba21231 100644 --- a/oox/inc/oox/xls/sheetdatacontext.hxx +++ b/oox/inc/oox/xls/sheetdatacontext.hxx @@ -55,7 +55,7 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: /** Different types of cell records. */ @@ -69,35 +69,35 @@ private: void importFormula( const AttributeList& rAttribs ); /** Imports a cell address and the following XF identifier. */ - void importCellHeader( RecordInputStream& rStrm, CellType eCellType ); + void importCellHeader( SequenceInputStream& rStrm, CellType eCellType ); /** Imports an empty cell from a CELL_BLANK or MULTCELL_BLANK record. */ - void importCellBlank( RecordInputStream& rStrm, CellType eCellType ); + void importCellBlank( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a boolean cell from a CELL_BOOL, MULTCELL_BOOL, or FORMULA_BOOL record. */ - void importCellBool( RecordInputStream& rStrm, CellType eCellType ); + void importCellBool( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a numeric cell from a CELL_DOUBLE, MULTCELL_DOUBLE, or FORMULA_DOUBLE record. */ - void importCellDouble( RecordInputStream& rStrm, CellType eCellType ); + void importCellDouble( SequenceInputStream& rStrm, CellType eCellType ); /** Imports an error code cell from a CELL_ERROR, MULTCELL_ERROR, or FORMULA_ERROR record. */ - void importCellError( RecordInputStream& rStrm, CellType eCellType ); + void importCellError( SequenceInputStream& rStrm, CellType eCellType ); /** Imports an encoded numeric cell from a CELL_RK or MULTCELL_RK record. */ - void importCellRk( RecordInputStream& rStrm, CellType eCellType ); + void importCellRk( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a rich-string cell from a CELL_RSTRING or MULTCELL_RSTRING record. */ - void importCellRString( RecordInputStream& rStrm, CellType eCellType ); + void importCellRString( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a string cell from a CELL_SI or MULTCELL_SI record. */ - void importCellSi( RecordInputStream& rStrm, CellType eCellType ); + void importCellSi( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a string cell from a CELL_STRING, MULTCELL_STRING, or FORMULA_STRING record. */ - void importCellString( RecordInputStream& rStrm, CellType eCellType ); + void importCellString( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a cell formula for the current cell. */ - void importCellFormula( RecordInputStream& rStrm ); + void importCellFormula( SequenceInputStream& rStrm ); /** Imports row settings from a ROW record. */ - void importRow( RecordInputStream& rStrm ); + void importRow( SequenceInputStream& rStrm ); /** Imports an array formula from an ARRAY record. */ - void importArray( RecordInputStream& rStrm ); + void importArray( SequenceInputStream& rStrm ); /** Imports a shared formula from a SHAREDFORMULA record. */ - void importSharedFmla( RecordInputStream& rStrm ); + void importSharedFmla( SequenceInputStream& rStrm ); /** Imports table operation from a DATATABLE record. */ - void importDataTable( RecordInputStream& rStrm ); + void importDataTable( SequenceInputStream& rStrm ); private: CellModel maCurrCell; /// Position and formatting of current imported cell. diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx index 59279749994f..64a56968aa37 100644 --- a/oox/inc/oox/xls/stylesbuffer.hxx +++ b/oox/inc/oox/xls/stylesbuffer.hxx @@ -35,8 +35,9 @@ #include <com/sun/star/table/TableBorder.hpp> #include <com/sun/star/util/CellProtection.hpp> #include "oox/drawingml/color.hxx" -#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/numberformatsbuffer.hxx" namespace com { namespace sun { namespace star { @@ -111,11 +112,11 @@ public: void importColor( const AttributeList& rAttribs ); /** Imports a 64-bit color from the passed binary stream. */ - void importColor( RecordInputStream& rStrm ); + void importColor( SequenceInputStream& rStrm ); /** Imports a 32-bit palette color identifier from the passed BIFF12 stream. */ - void importColorId( RecordInputStream& rStrm ); + void importColorId( SequenceInputStream& rStrm ); /** Imports a 32-bit RGBA color value from the passed BIFF12 stream. */ - void importColorRgb( RecordInputStream& rStrm ); + void importColorRgb( SequenceInputStream& rStrm ); /** Imports an 8-bit or 16-bit palette color identifier from the passed BIFF stream. */ void importColorId( BiffInputStream& rStrm, bool b16Bit = true ); @@ -128,7 +129,7 @@ public: // ---------------------------------------------------------------------------- -RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor ); +SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ); // ============================================================================ @@ -142,7 +143,7 @@ public: /** Appends a new color from the passed attributes. */ void importPaletteColor( const AttributeList& rAttribs ); /** Appends a new color from the passed RGBCOLOR record. */ - void importPaletteColor( RecordInputStream& rStrm ); + void importPaletteColor( SequenceInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); /** Imports a color palette from a UNO sequence in the passed any. */ @@ -261,23 +262,23 @@ public: void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the FONT record from the passed stream. */ - void importFont( RecordInputStream& rStrm ); + void importFont( SequenceInputStream& rStrm ); /** Imports the font name from a DXF record. */ - void importDxfName( RecordInputStream& rStrm ); + void importDxfName( SequenceInputStream& rStrm ); /** Imports the font color from a DXF record. */ - void importDxfColor( RecordInputStream& rStrm ); + void importDxfColor( SequenceInputStream& rStrm ); /** Imports the font scheme from a DXF record. */ - void importDxfScheme( RecordInputStream& rStrm ); + void importDxfScheme( SequenceInputStream& rStrm ); /** Imports the font height from a DXF record. */ - void importDxfHeight( RecordInputStream& rStrm ); + void importDxfHeight( SequenceInputStream& rStrm ); /** Imports the font weight from a DXF record. */ - void importDxfWeight( RecordInputStream& rStrm ); + void importDxfWeight( SequenceInputStream& rStrm ); /** Imports the font underline style from a DXF record. */ - void importDxfUnderline( RecordInputStream& rStrm ); + void importDxfUnderline( SequenceInputStream& rStrm ); /** Imports the font escapement style from a DXF record. */ - void importDxfEscapement( RecordInputStream& rStrm ); + void importDxfEscapement( SequenceInputStream& rStrm ); /** Imports a font style flag from a DXF record. */ - void importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm ); + void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Imports the FONT record from the passed stream. */ void importFont( BiffInputStream& rStrm ); @@ -550,9 +551,9 @@ public: void importColor( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the BORDER record from the passed stream. */ - void importBorder( RecordInputStream& rStrm ); + void importBorder( SequenceInputStream& rStrm ); /** Imports a border from a DXF record from the passed stream. */ - void importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm ); + void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Sets the border attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); @@ -631,9 +632,9 @@ struct GradientFillModel explicit GradientFillModel(); /** Reads BIFF12 gradient settings from a FILL or DXF record. */ - void readGradient( RecordInputStream& rStrm ); + void readGradient( SequenceInputStream& rStrm ); /** Reads BIFF12 gradient stop settings from a FILL or DXF record. */ - void readGradientStop( RecordInputStream& rStrm, bool bDxf ); + void readGradientStop( SequenceInputStream& rStrm, bool bDxf ); }; // ---------------------------------------------------------------------------- @@ -670,17 +671,17 @@ public: void importColor( const AttributeList& rAttribs, double fPosition ); /** Imports the FILL record from the passed stream. */ - void importFill( RecordInputStream& rStrm ); + void importFill( SequenceInputStream& rStrm ); /** Imports the fill pattern from a DXF record. */ - void importDxfPattern( RecordInputStream& rStrm ); + void importDxfPattern( SequenceInputStream& rStrm ); /** Imports the pattern color from a DXF record. */ - void importDxfFgColor( RecordInputStream& rStrm ); + void importDxfFgColor( SequenceInputStream& rStrm ); /** Imports the background color from a DXF record. */ - void importDxfBgColor( RecordInputStream& rStrm ); + void importDxfBgColor( SequenceInputStream& rStrm ); /** Imports gradient settings from a DXF record. */ - void importDxfGradient( RecordInputStream& rStrm ); + void importDxfGradient( SequenceInputStream& rStrm ); /** Imports gradient stop settings from a DXF record. */ - void importDxfStop( RecordInputStream& rStrm ); + void importDxfStop( SequenceInputStream& rStrm ); /** Sets the fill attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); @@ -764,7 +765,7 @@ public: void importProtection( const AttributeList& rAttribs ); /** Imports the XF record from the passed stream. */ - void importXf( RecordInputStream& rStrm, bool bCellXf ); + void importXf( SequenceInputStream& rStrm, bool bCellXf ); /** Imports the XF record from the passed stream. */ void importXf( BiffInputStream& rStrm ); @@ -825,7 +826,7 @@ public: void importProtection( const AttributeList& rAttribs ); /** Imports the DXF record from the passed stream. */ - void importDxf( RecordInputStream& rStrm ); + void importDxf( SequenceInputStream& rStrm ); /** Imports font, border, and fill settings from the CFRULE record. */ void importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags ); @@ -880,7 +881,7 @@ public: /** Imports passed attributes from the cellStyle element. */ void importCellStyle( const AttributeList& rAttribs ); /** Imports style settings from a CELLSTYLE record. */ - void importCellStyle( RecordInputStream& rStrm ); + void importCellStyle( SequenceInputStream& rStrm ); /** Imports style settings from a STYLE record. */ void importStyle( BiffInputStream& rStrm ); @@ -913,7 +914,7 @@ public: /** Appends and returns a new named cell style object. */ CellStyleRef importCellStyle( const AttributeList& rAttribs ); /** Imports the CELLSTYLE record from the passed stream. */ - CellStyleRef importCellStyle( RecordInputStream& rStrm ); + CellStyleRef importCellStyle( SequenceInputStream& rStrm ); /** Imports the STYLE record from the passed stream. */ CellStyleRef importStyle( BiffInputStream& rStrm ); @@ -994,11 +995,11 @@ public: CellStyleRef importCellStyle( const AttributeList& rAttribs ); /** Appends a new color to the color palette. */ - void importPaletteColor( RecordInputStream& rStrm ); + void importPaletteColor( SequenceInputStream& rStrm ); /** Imports the NUMFMT record from the passed stream. */ - void importNumFmt( RecordInputStream& rStrm ); + void importNumFmt( SequenceInputStream& rStrm ); /** Imports the CELLSTYLE record from the passed stream. */ - void importCellStyle( RecordInputStream& rStrm ); + void importCellStyle( SequenceInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/stylesfragment.hxx b/oox/inc/oox/xls/stylesfragment.hxx index 4ab7ee78ae15..eb1af53d9cdb 100644 --- a/oox/inc/oox/xls/stylesfragment.hxx +++ b/oox/inc/oox/xls/stylesfragment.hxx @@ -43,7 +43,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); }; // ============================================================================ @@ -141,7 +141,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); diff --git a/oox/inc/oox/xls/tablebuffer.hxx b/oox/inc/oox/xls/tablebuffer.hxx index 4e9cb9824df0..d643fbc40728 100644 --- a/oox/inc/oox/xls/tablebuffer.hxx +++ b/oox/inc/oox/xls/tablebuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_TABLEBUFFER_HXX #include <com/sun/star/table/CellRangeAddress.hpp> -#include "oox/helper/containerhelper.hxx" #include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/workbookhelper.hxx" @@ -62,7 +61,7 @@ public: /** Imports a table definition from the passed attributes. */ void importTable( const AttributeList& rAttribs, sal_Int16 nSheet ); /** Imports a table definition from a TABLE record. */ - void importTable( RecordInputStream& rStrm, sal_Int16 nSheet ); + void importTable( SequenceInputStream& rStrm, sal_Int16 nSheet ); /** Creates a new auto filter and stores it internally. */ inline AutoFilter& createAutoFilter() { return maAutoFilters.createAutoFilter(); } diff --git a/oox/inc/oox/xls/tablefragment.hxx b/oox/inc/oox/xls/tablefragment.hxx index 40b9cca3a8fd..9c2678405ee5 100644 --- a/oox/inc/oox/xls/tablefragment.hxx +++ b/oox/inc/oox/xls/tablefragment.hxx @@ -46,7 +46,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx index c9c751b5066b..c5880bf077fe 100644 --- a/oox/inc/oox/xls/viewsettings.hxx +++ b/oox/inc/oox/xls/viewsettings.hxx @@ -30,7 +30,6 @@ #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> -#include "oox/helper/containerhelper.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/worksheethelper.hxx" @@ -119,13 +118,13 @@ public: void importChartSheetView( const AttributeList& rAttribs ); /** Imports the SHEETVIEW record containing sheet view settings. */ - void importSheetView( RecordInputStream& rStrm ); + void importSheetView( SequenceInputStream& rStrm ); /** Imports the PANE record containing sheet pane settings. */ - void importPane( RecordInputStream& rStrm ); + void importPane( SequenceInputStream& rStrm ); /** Imports the SELECTION record containing selection settings for a pane. */ - void importSelection( RecordInputStream& rStrm ); + void importSelection( SequenceInputStream& rStrm ); /** Imports the CHARTSHEETVIEW record containing view settings of a chart sheet. */ - void importChartSheetView( RecordInputStream& rStrm ); + void importChartSheetView( SequenceInputStream& rStrm ); /** Imports the WINDOW2 record containing sheet view settings. */ void importWindow2( BiffInputStream& rStrm ); @@ -185,9 +184,9 @@ public: /** Imports the oleSize element containing the visible size of the workbook. */ void importOleSize( const AttributeList& rAttribs ); /** Imports the WORKBOOKVIEW record containing workbook view settings. */ - void importWorkbookView( RecordInputStream& rStrm ); + void importWorkbookView( SequenceInputStream& rStrm ); /** Imports the OLESIZE record containing the visible size of the workbook. */ - void importOleSize( RecordInputStream& rStrm ); + void importOleSize( SequenceInputStream& rStrm ); /** Imports the WINDOW1 record containing workbook view settings. */ void importWindow1( BiffInputStream& rStrm ); /** Imports the OLESIZE record containing the visible size of the workbook. */ diff --git a/oox/inc/oox/xls/workbookfragment.hxx b/oox/inc/oox/xls/workbookfragment.hxx index 8c354dca1840..d0b0cadd416b 100644 --- a/oox/inc/oox/xls/workbookfragment.hxx +++ b/oox/inc/oox/xls/workbookfragment.hxx @@ -49,7 +49,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); @@ -59,8 +59,8 @@ private: void importDefinedName( const AttributeList& rAttribs ); void importPivotCache( const AttributeList& rAttribs ); - void importExternalRef( RecordInputStream& rStrm ); - void importPivotCache( RecordInputStream& rStrm ); + void importExternalRef( SequenceInputStream& rStrm ); + void importPivotCache( SequenceInputStream& rStrm ); void importExternalLinkFragment( ExternalLink& rExtLink ); void importPivotCacheDefFragment( const ::rtl::OUString& rRelId, sal_Int32 nCacheId ); diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx index ee5b2f12cea5..ecf824076ef5 100644 --- a/oox/inc/oox/xls/workbookhelper.hxx +++ b/oox/inc/oox/xls/workbookhelper.hxx @@ -50,8 +50,8 @@ namespace com { namespace sun { namespace star { namespace oox { class AttributeList; - class RecordInputStream; class SegmentProgressBar; + class SequenceInputStream; } namespace oox { namespace core { diff --git a/oox/inc/oox/xls/workbooksettings.hxx b/oox/inc/oox/xls/workbooksettings.hxx index bbdbefac17ff..858e886df778 100644 --- a/oox/inc/oox/xls/workbooksettings.hxx +++ b/oox/inc/oox/xls/workbooksettings.hxx @@ -101,11 +101,11 @@ public: void importCalcPr( const AttributeList& rAttribs ); /** Imports the FILESHARING record containing write protection settings. */ - void importFileSharing( RecordInputStream& rStrm ); + void importFileSharing( SequenceInputStream& rStrm ); /** Imports the WORKBOOKPR record containing global workbook settings. */ - void importWorkbookPr( RecordInputStream& rStrm ); + void importWorkbookPr( SequenceInputStream& rStrm ); /** Imports the CALCPR record containing workbook calculation settings. */ - void importCalcPr( RecordInputStream& rStrm ); + void importCalcPr( SequenceInputStream& rStrm ); /** Sets the save external linked values flag, e.g. from the WSBOOL record. */ void setSaveExtLinkValues( bool bSaveExtLinks ); diff --git a/oox/inc/oox/xls/worksheetbuffer.hxx b/oox/inc/oox/xls/worksheetbuffer.hxx index d32012c48cff..7c59cce988dd 100644 --- a/oox/inc/oox/xls/worksheetbuffer.hxx +++ b/oox/inc/oox/xls/worksheetbuffer.hxx @@ -29,7 +29,8 @@ #define OOX_XLS_WORKSHEETBUFFER_HXX #include <utility> -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -75,7 +76,7 @@ public: /** Imports the attributes of a sheet element. */ void importSheet( const AttributeList& rAttribs ); /** Imports the SHEET record from the passed BIFF12 stream. */ - void importSheet( RecordInputStream& rStrm ); + void importSheet( SequenceInputStream& rStrm ); /** Imports the SHEET record from the passed BIFF stream. */ void importSheet( BiffInputStream& rStrm ); /** Inserts a new empty sheet into the document. Looks for an unused name. diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx index 96d8f1229f23..4fe3bf4240dd 100644 --- a/oox/inc/oox/xls/worksheetfragment.hxx +++ b/oox/inc/oox/xls/worksheetfragment.hxx @@ -45,13 +45,13 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: /** Imports the dataValidation element containing data validation settings. */ void importDataValidation( const AttributeList& rAttribs ); /** Imports the DATAVALIDATION record containing data validation settings. */ - void importDataValidation( RecordInputStream& rStrm ); + void importDataValidation( SequenceInputStream& rStrm ); private: ::std::auto_ptr< ValidationModel > mxValModel; @@ -73,7 +73,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void initializeImport(); @@ -104,25 +104,25 @@ private: void importControl( const AttributeList& rAttribs ); /** Imports the DIMENSION record containing the used area of the sheet. */ - void importDimension( RecordInputStream& rStrm ); + void importDimension( SequenceInputStream& rStrm ); /** Imports sheet format properties from a SHEETFORMATPR record. */ - void importSheetFormatPr( RecordInputStream& rStrm ); + void importSheetFormatPr( SequenceInputStream& rStrm ); /** Imports column settings from a COL record. */ - void importCol( RecordInputStream& rStrm ); + void importCol( SequenceInputStream& rStrm ); /** Imports a merged cell range from a MERGECELL record. */ - void importMergeCell( RecordInputStream& rStrm ); + void importMergeCell( SequenceInputStream& rStrm ); /** Imports a hyperlink for a cell range from a HYPERLINK record. */ - void importHyperlink( RecordInputStream& rStrm ); + void importHyperlink( SequenceInputStream& rStrm ); /** Imports the BRK record for an individual row or column page break. */ - void importBrk( RecordInputStream& rStrm, bool bRowBreak ); + void importBrk( SequenceInputStream& rStrm, bool bRowBreak ); /** Imports the DRAWING record containing the relation identifier for the DrawingML part. */ - void importDrawing( RecordInputStream& rStrm ); + void importDrawing( SequenceInputStream& rStrm ); /** Imports the LEGACYDRAWING record containing the relation identifier for the VML drawing part. */ - void importLegacyDrawing( RecordInputStream& rStrm ); + void importLegacyDrawing( SequenceInputStream& rStrm ); /** Imports additional data for an OLE object. */ - void importOleObject( RecordInputStream& rStrm ); + void importOleObject( SequenceInputStream& rStrm ); /** Imports additional data for an OCX form control. */ - void importControl( RecordInputStream& rStrm ); + void importControl( SequenceInputStream& rStrm ); /** Imports the binary data of an embedded OLE object from the fragment with the passed ID. */ void importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const ::rtl::OUString& rRelId ); diff --git a/oox/inc/oox/xls/worksheetsettings.hxx b/oox/inc/oox/xls/worksheetsettings.hxx index de58fa3e1355..6d6c8a4912d2 100644 --- a/oox/inc/oox/xls/worksheetsettings.hxx +++ b/oox/inc/oox/xls/worksheetsettings.hxx @@ -98,15 +98,15 @@ public: void importPhoneticPr( const AttributeList& rAttribs ); /** Imports sheet properties from the SHEETPR record. */ - void importSheetPr( RecordInputStream& rStrm ); + void importSheetPr( SequenceInputStream& rStrm ); /** Imports sheet properties from the CHARTSHEETPR record. */ - void importChartSheetPr( RecordInputStream& rStrm ); + void importChartSheetPr( SequenceInputStream& rStrm ); /** Imports sheet protection settings from the SHEETPROTECTION record. */ - void importSheetProtection( RecordInputStream& rStrm ); + void importSheetProtection( SequenceInputStream& rStrm ); /** Imports chart sheet protection settings from the CHARTPROTECTION record. */ - void importChartProtection( RecordInputStream& rStrm ); + void importChartProtection( SequenceInputStream& rStrm ); /** Imports phonetic settings from the PHONETICPR record. */ - void importPhoneticPr( RecordInputStream& rStrm ); + void importPhoneticPr( SequenceInputStream& rStrm ); /** Imports sheet properties from a SHEETEXT record. */ void importSheetExt( BiffInputStream& rStrm ); diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx index c2d6fa928576..8bf2c4eadfeb 100644 --- a/oox/source/core/contexthandler.cxx +++ b/oox/source/core/contexthandler.cxx @@ -133,12 +133,12 @@ void ContextHandler::processingInstruction( const OUString&, const OUString& ) t // record context interface --------------------------------------------------- -ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, RecordInputStream& ) +ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, SequenceInputStream& ) { return 0; } -void ContextHandler::startRecord( sal_Int32, RecordInputStream& ) +void ContextHandler::startRecord( sal_Int32, SequenceInputStream& ) { } diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 8ba5dd65cd9b..48f5718f9149 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -126,12 +126,12 @@ void ContextHandler2Helper::implEndElement( sal_Int32 nElement ) } } -ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { return onCreateRecordContext( nRecId, rStrm ); } -void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { pushElementInfo( nRecId ); onStartRecord( rStrm ); @@ -215,12 +215,12 @@ void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement ) throw( SAXEx // oox.core.RecordContext interface ------------------------------------------- -ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { return implCreateRecordContext( nRecId, rStrm ); } -void ContextHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void ContextHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { implStartRecord( nRecId, rStrm ); } @@ -249,12 +249,12 @@ void ContextHandler2::onEndElement() { } -ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& ) +ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& ) { return 0; } -void ContextHandler2::onStartRecord( RecordInputStream& ) +void ContextHandler2::onStartRecord( SequenceInputStream& ) { } diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx index e01d2af65113..7771b89747b9 100644 --- a/oox/source/core/fragmenthandler2.cxx +++ b/oox/source/core/fragmenthandler2.cxx @@ -87,12 +87,12 @@ void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement ) throw( SAXE // oox.core.ContextHandler interface ------------------------------------------ -ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { return implCreateRecordContext( nRecId, rStrm ); } -void FragmentHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void FragmentHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { implStartRecord( nRecId, rStrm ); } @@ -121,12 +121,12 @@ void FragmentHandler2::onEndElement() { } -ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& ) +ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& ) { return 0; } -void FragmentHandler2::onStartRecord( RecordInputStream& ) +void FragmentHandler2::onStartRecord( SequenceInputStream& ) { } diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx index 1fea7c85a88b..aef73ceed86c 100644 --- a/oox/source/core/recordparser.cxx +++ b/oox/source/core/recordparser.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/xml/sax/XLocator.hpp> #include <cppuhelper/implbase1.hxx> #include "oox/core/fragmenthandler.hxx" -#include "oox/helper/recordinputstream.hxx" namespace oox { namespace core { @@ -274,7 +273,7 @@ void RecordParser::parseStream( const RecordInputSource& rInputSource ) throw( S while( lclReadNextRecord( nRecId, aRecData, *maSource.mxInStream ) ) { // create record stream object from imported record data - RecordInputStream aRecStrm( aRecData ); + SequenceInputStream aRecStrm( aRecData ); // try to leave a context, there may be other incomplete contexts on the stack if( const RecordInfo* pEndRecInfo = getEndRecordInfo( nRecId ) ) { diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index f901506f555c..b9eaee5c01be 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -39,6 +39,7 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" +#include "oox/helper/containerhelper.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx index 1baefdc641e4..fdc4969f7c5e 100644 --- a/oox/source/drawingml/chart/titleconverter.cxx +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -38,6 +38,7 @@ #include "oox/drawingml/textparagraph.hxx" #include "oox/drawingml/chart/datasourceconverter.hxx" #include "oox/drawingml/chart/titlemodel.hxx" +#include "oox/helper/containerhelper.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 6b0975f26260..6c0d3660a670 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -40,6 +40,7 @@ #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/chart/seriesconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" +#include "oox/helper/containerhelper.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index 38b6eb2d82a3..2eb1ef8b4cdf 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/PointSequence.hpp> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> +#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/helper/propertymap.hxx" diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx index bee33566bba8..3dc2974420a6 100644 --- a/oox/source/dump/xlsbdumper.cxx +++ b/oox/source/dump/xlsbdumper.cxx @@ -80,7 +80,7 @@ RecordObjectBase::~RecordObjectBase() void RecordObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) { - mxBiffStrm.reset( new RecordInputStream( getRecordDataSequence() ) ); + mxBiffStrm.reset( new SequenceInputStream( getRecordDataSequence() ) ); SequenceRecordObjectBase::construct( rParent, rxStrm, rSysFileName, mxBiffStrm, "RECORD-NAMES", "SIMPLE-RECORDS" ); if( SequenceRecordObjectBase::implIsValid() ) mxErrCodes = cfg().getNameList( "ERRORCODES" ); @@ -198,7 +198,7 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32 { sal_uInt8 nFlags = bRich ? dumpHex< sal_uInt8 >( "flags", "STRING-FLAGS" ) : 0; - OUString aString = mxBiffStrm->readString( b32BitLen ); + OUString aString = BiffHelper::readString( *mxBiffStrm, b32BitLen ); writeStringItem( rName( "text" ), aString ); // --- formatting --- diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx index 4d41d9924326..e7f322ff10e3 100644 --- a/oox/source/helper/containerhelper.cxx +++ b/oox/source/helper/containerhelper.cxx @@ -160,62 +160,4 @@ OUString ContainerHelper::insertByUnusedName( // ============================================================================ -ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) : - mxFactory( rxFactory ), - maServiceName( rServiceName ), - mnIndex( 0 ) -{ - OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" ); -} - -ObjectContainer::~ObjectContainer() -{ -} - -bool ObjectContainer::hasObject( const OUString& rObjName ) const -{ - createContainer(); - return mxContainer.is() && mxContainer->hasByName( rObjName ); -} - -Any ObjectContainer::getObject( const OUString& rObjName ) const -{ - createContainer(); - if( mxContainer.is() ) try - { - return mxContainer->getByName( rObjName ); - } - catch( Exception& ) - { - } - return Any(); -} - -OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName ) -{ - createContainer(); - if( mxContainer.is() ) - { - if( bInsertByUnusedName ) - return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj ); - if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) ) - return rObjName; - } - return OUString(); -} - -void ObjectContainer::createContainer() const -{ - if( !mxContainer.is() && mxFactory.is() ) try - { - mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW ); - } - catch( Exception& ) - { - } - OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" ); -} - -// ============================================================================ - } // namespace oox diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx index f9b6b066230a..7fdbe4b38134 100644 --- a/oox/source/helper/modelobjecthelper.cxx +++ b/oox/source/helper/modelobjecthelper.cxx @@ -28,9 +28,11 @@ #include "oox/helper/modelobjecthelper.hxx" #include <com/sun/star/awt/Gradient.hpp> +#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/drawing/LineDash.hpp> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" namespace oox { @@ -46,6 +48,64 @@ using ::rtl::OUString; // ============================================================================ +ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) : + mxFactory( rxFactory ), + maServiceName( rServiceName ), + mnIndex( 0 ) +{ + OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" ); +} + +ObjectContainer::~ObjectContainer() +{ +} + +bool ObjectContainer::hasObject( const OUString& rObjName ) const +{ + createContainer(); + return mxContainer.is() && mxContainer->hasByName( rObjName ); +} + +Any ObjectContainer::getObject( const OUString& rObjName ) const +{ + createContainer(); + if( mxContainer.is() ) try + { + return mxContainer->getByName( rObjName ); + } + catch( Exception& ) + { + } + return Any(); +} + +OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName ) +{ + createContainer(); + if( mxContainer.is() ) + { + if( bInsertByUnusedName ) + return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj ); + if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) ) + return rObjName; + } + return OUString(); +} + +void ObjectContainer::createContainer() const +{ + if( !mxContainer.is() && mxFactory.is() ) try + { + mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW ); + } + catch( Exception& ) + { + } + OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" ); +} + +// ============================================================================ + ModelObjectHelper::ModelObjectHelper( const Reference< XMultiServiceFactory >& rxModelFactory ) : maMarkerContainer( rxModelFactory, CREATE_OUSTRING( "com.sun.star.drawing.MarkerTable" ) ), maDashContainer( rxModelFactory, CREATE_OUSTRING( "com.sun.star.drawing.DashTable" ) ), diff --git a/oox/source/helper/recordinputstream.cxx b/oox/source/helper/recordinputstream.cxx deleted file mode 100644 index a746eef47d73..000000000000 --- a/oox/source/helper/recordinputstream.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "oox/helper/recordinputstream.hxx" - -#include <vector> - -namespace oox { - -// ============================================================================ - -using ::rtl::OUString; - -// ============================================================================ - -RecordInputStream::RecordInputStream( const StreamDataSequence& rData ) : - SequenceInputStream( rData ) -{ -} - -OUString RecordInputStream::readString( bool b32BitLen ) -{ - OUString aString; - if( !isEof() ) - { - sal_Int32 nCharCount = b32BitLen ? readValue< sal_Int32 >() : readValue< sal_Int16 >(); - // string length -1 is often used to indicate a missing string - OSL_ENSURE( !isEof() && (nCharCount >= -1), "RecordInputStream::readString - invalid string length" ); - if( !isEof() && (nCharCount > 0) ) - { - ::std::vector< sal_Unicode > aBuffer; - aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) ); - for( sal_Int32 nCharIdx = 0; !isEof() && (nCharIdx < nCharCount); ++nCharIdx ) - { - sal_uInt16 nChar; - readValue( nChar ); - aBuffer.push_back( static_cast< sal_Unicode >( nChar ) ); - } - aBuffer.push_back( 0 ); - aString = OUString( &aBuffer.front() ); - } - } - return aString; -} - -// ============================================================================ - -} // namespace oox diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 105f5deea225..86cc55df3127 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -57,6 +57,7 @@ #include <rtl/tencinfo.h> #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx index e9aa8f6a9ae8..cf55d6463778 100644 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -38,6 +38,7 @@ #include <cppuhelper/implbase2.hxx> #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" namespace oox { diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index dc86c2dd82e5..39deb77576d9 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -38,6 +38,7 @@ #include <xmlscript/xmldlg_imexp.hxx> #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/storagebase.hxx" diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index dcd354ea84ed..a5189269c3c8 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -30,7 +30,6 @@ #include <string.h> #include <rtl/strbuf.hxx> #include <rtl/string.hxx> -#include "oox/helper/containerhelper.hxx" #include "oox/token/tokens.hxx" namespace oox { @@ -89,8 +88,9 @@ TokenMap::~TokenMap() OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const { - const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken ); - return pTokenName ? pTokenName->maUniName : OUString(); + if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) ) + return maTokenNames[ static_cast< size_t >( nToken ) ].maUniName; + return OUString(); } sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const @@ -102,8 +102,9 @@ sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const { - const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken ); - return pTokenName ? pTokenName->maUtf8Name : Sequence< sal_Int8 >(); + if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) ) + return maTokenNames[ static_cast< size_t >( nToken ) ].maUtf8Name; + return Sequence< sal_Int8 >(); } sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) const diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index c53dd2896395..ccf0fe567235 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include "oox/core/xmlfilterbase.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 93301357984f..db12f3d91e0b 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -36,6 +36,7 @@ #include <rtl/math.hxx> #include <rtl/ustrbuf.hxx> #include "oox/core/xmlfilterbase.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" 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 ); } |