49 "XclImpString::Read - unknown flag");
52 switch(
rStrm.GetRoot().GetBiff() )
65 sal_uInt16 nChars = b16BitLen ?
rStrm.ReaduInt16() :
rStrm.ReaduInt8();
68 nFlagField =
rStrm.ReaduInt8();
70 bool b16Bit, bRich, bFarEast;
73 rStrm.ReadUniStringExtHeader( b16Bit, bRich, bFarEast, nRunCount, nExtInf, nFlagField );
84 rStrm.Ignore( nExtInf );
96 OSL_ENSURE( rFormats.empty() || (rFormats.back().mnChar <= nChar),
"XclImpString::AppendFormat - wrong char order" );
97 if( rFormats.empty() || (rFormats.back().mnChar < nChar) )
98 rFormats.emplace_back( nChar, nFontIdx );
100 rFormats.back().mnFontIdx = nFontIdx;
106 sal_uInt16 nRunCount = bBiff8 ?
rStrm.ReaduInt16() :
rStrm.ReaduInt8();
114 size_t nElementSize =
rStrm.GetRoot().GetBiff() ==
EXC_BIFF8 ? 4 : 2;
115 size_t nAvailableBytes =
rStrm.GetRecLeft();
116 size_t nMaxElements = nAvailableBytes / nElementSize;
117 if (nRunCount > nMaxElements)
119 SAL_WARN(
"sc.filter",
"XclImpString::ReadFormats - more formats claimed than stream could contain");
124 rFormats.reserve( nRunCount );
129 for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
131 sal_uInt16 nChar =
rStrm.ReaduInt16();
132 sal_uInt16 nFontIdx =
rStrm.ReaduInt16();
138 for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
150 sal_uInt16 nRunCount = nFormatSize / 8;
152 rFormats.reserve( nRunCount );
153 for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
155 sal_uInt16 nChar =
rStrm.ReaduInt16();
156 sal_uInt16 nFontIdx =
rStrm.ReaduInt16();
165 mrText( rString.GetText() ),
166 mrFormats( rString.GetFormats() ),
This class is used to import record oriented streams.
Iterates over formatted string portions.
XclImpStringIterator & operator++()
Moves iterator to next text portion.
XclImpStringIterator(const XclImpString &rString)
size_t mnFormatsBeg
First character of next portion.
sal_Int32 mnTextBeg
Current text portion.
sal_uInt16 GetPortionFont() const
Returns the font index of the current text portion.
const XclFormatRunVec & mrFormats
The processed string.
size_t mnFormatsEnd
Formatting run index for current portion.
size_t mnPortion
The vector of formatting runs.
OUString GetPortionText() const
Returns the string of the current text portion.
sal_Int32 mnTextEnd
First character of current portion.
bool Is() const
Returns true, if the iterator references a valid text portion.
This class represents an unformatted or formatted string and provides importing from stream.
void ReadObjFormats(XclImpStream &rStrm, sal_uInt16 nFormatSize)
Reads and appends formatting runs from an OBJ or TXO record.
XclFormatRunVec maFormats
The text data of the string.
XclImpString()
Constructs an empty string.
void Read(XclImpStream &rStrm, XclStrFlags nFlags=XclStrFlags::NONE)
Reads a complete string from the passed stream.
static void AppendFormat(XclFormatRunVec &rFormats, sal_uInt16 nChar, sal_uInt16 nFontIdx)
Insert a formatting run to the passed format buffer.
void ReadFormats(XclImpStream &rStrm)
Reads and appends the formatting information (run count and runs) from stream.
#define SVSTREAM_FILEFORMAT_ERROR
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
const XclStrFlags nAllowedFlags
All allowed flags for import.
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
::std::vector< XclFormatRun > XclFormatRunVec
A vector with all formatting runs for a rich-string.
XclStrFlags
Flags used to specify import/export mode of strings.
@ EightBitLength
Always use UCS-2 characters (default: try to compress). BIFF8 only.
@ SeparateFormats
Omit flags on empty string (default: read/write always). BIFF8 only.
@ SmartFlags
8-bit string length field (default: 16-bit).
const sal_uInt16 EXC_FONT_NOTFOUND
Application font index.