25#include <osl/diagnose.h>
31const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF;
32const sal_uInt32 AX_STRING_COMPRESSED = 0x80000000;
40 mnStrmSize( rInStrm.getRemaining() )
70 sal_Int32 nReadSize = 0;
82 sal_Int32 nReadSize = 0;
104 skip(
static_cast< sal_Int32
>( (nSize - (
mnStrmPos % nSize)) % nSize ) );
109bool lclReadString(
AxAlignedInputStream& rInStrm, OUString& rValue, sal_uInt32 nSize,
bool bArrayString )
111 bool bCompressed =
getFlag( nSize, AX_STRING_COMPRESSED );
112 sal_uInt32 nBufSize = nSize & AX_STRING_SIZEMASK;
114 sal_Int32 nChars =
static_cast< sal_Int32
>( nBufSize / ((bCompressed || bArrayString) ? 1 : 2) );
115 bool bValidChars = nChars <= 65536;
116 OSL_ENSURE( bValidChars,
"lclReadString - string too long" );
117 sal_Int64 nEndPos = rInStrm.
tell() + nChars * (bCompressed ? 1 : 2);
118 nChars = ::std::min< sal_Int32 >( nChars, 65536 );
120 rInStrm.
seek( nEndPos );
139 return lclReadString( rInStrm, mrValue,
mnSize,
false );
145 while( rInStrm.
tell() < nEndPos )
148 if( !lclReadString( rInStrm, aString, rInStrm.
readuInt32(),
true ) )
150 mrArray.push_back( aString );
165 return mrFontData.importGuidAndFont( rInStrm );
182 if( b64BitPropFlags )
Base class for binary stream classes.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
bool mbEof
End of stream flag.
container_type::value_type value_type
ComplexPropVector maLargeProps
Stores info for all used large properties.
bool finalizeImport()
Final processing, reads contents of all complex properties.
AxBinaryPropertyReader(BinaryInputStream &rInStrm, bool b64BitPropFlags=false)
bool ensureValid(bool bCondition=true)
void readGuidProperty(OUString &orGuid)
Reads the next GUID property from the stream, if the respective flag in the property mask is set.
void readFontProperty(AxFontData &orFontData)
Reads the next font property from the stream, if the respective flag in the property mask is set.
void readStringProperty(OUString &orValue)
Reads the next string property from the stream, if the respective flag in the property mask is set.
void readPairProperty(AxPairData &orPairData)
Reads the next pair property from the stream, if the respective flag in the property mask is set.
sal_Int64 mnPropsEnd
End position of simple/large properties.
sal_Int64 mnPropFlags
Flags specifying existing properties.
bool mbValid
True = stream still valid.
void readArrayStringProperty(std::vector< OUString > &rStrings)
Reads ArrayString, an array of fmString ( compressed or uncompressed ) is read from the stream and in...
ComplexPropVector maStreamProps
Stores info for all used stream data properties.
void readBoolProperty(bool &orbValue, bool bReverse=false)
Reads the next boolean property value from the stream, if the respective flag in the property mask is...
AxAlignedInputStream maInStrm
The input stream to read from.
void readPictureProperty(StreamDataSequence &orPicData)
Reads the next picture property from the stream, if the respective flag in the property mask is set.
sal_Int64 mnNextProp
Next property to read.
OOX_DLLPUBLIC OUString importGuid(BinaryInputStream &rInStrm)
Imports a GUID from the passed binary stream and returns its string representation (in uppercase char...
OOX_DLLPUBLIC bool importStdPic(StreamDataSequence &orGraphicData, BinaryInputStream &rInStrm)
Imports an OLE StdPic picture from the current position of the passed binary stream.
::std::pair< sal_Int32, sal_Int32 > AxPairData
A pair of integer values as a property.
void setFlag(Type &ornBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in ornBitField.
css::uno::Sequence< sal_Int8 > StreamDataSequence
bool getFlag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual ~ComplexProperty()
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
All entries of a font property.