25 #include <osl/diagnose.h>
31 const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF;
32 const 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 ) );
109 bool 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 )
void readPairProperty(AxPairData &orPairData)
Reads the next pair 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...
Base class for binary stream classes.
bool mbValid
True = stream still valid.
sal_Int64 mnPropFlags
Flags specifying existing properties.
OOX_DLLPUBLIC bool importStdPic(StreamDataSequence &orGraphicData, BinaryInputStream &rInStrm)
Imports an OLE StdPic picture from the current position of the passed binary stream.
void readArrayStringProperty(std::vector< OUString > &rStrings)
Reads ArrayString, an array of fmString ( compressed or uncompressed ) is read from the stream and in...
sal_Int64 mnNextProp
Next property to read.
::std::pair< sal_Int32, sal_Int32 > AxPairData
A pair of integer values as a property.
OOX_DLLPUBLIC OUString importGuid(BinaryInputStream &rInStrm)
Imports a GUID from the passed binary stream and returns its string representation (in uppercase char...
All entries of a font property.
ComplexPropVector maLargeProps
Stores info for all used large properties.
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
bool getFlag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
virtual ~ComplexProperty()
void setFlag(Type &ornBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in ornBitField.
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
css::uno::Sequence< sal_Int8 > StreamDataSequence
container_type::value_type value_type
bool mbEof
End of stream flag.
void readStringProperty(OUString &orValue)
Reads the next string property from the stream, if the respective flag in the property mask is set...
void readPictureProperty(StreamDataSequence &orPicData)
Reads the next picture property from the stream, if the respective flag in the property mask is set...
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
AxAlignedInputStream maInStrm
The input stream to read from.
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
virtual bool readProperty(AxAlignedInputStream &rInStrm) override
void readGuidProperty(OUString &orGuid)
Reads the next GUID property from the stream, if the respective flag in the property mask is set...
ComplexPropVector maStreamProps
Stores info for all used stream data properties.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
bool ensureValid(bool bCondition=true)
bool finalizeImport()
Final processing, reads contents of all complex properties.
sal_Int64 mnPropsEnd
End position of simple/large 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...
bool m_bDetectedRangeSegmentation false
AxBinaryPropertyReader(BinaryInputStream &rInStrm, bool b64BitPropFlags=false)