FontOverrideInfo GetFontOverrideInfo(string source, int wsTreeCombo)
{
using (BinaryReader reader = new BinaryReader(StringUtils.MakeStreamFromString(source)))
{
try
{
// read until the end of stream
while (reader.BaseStream.Position < reader.BaseStream.Length)
{
FontOverrideInfo overrideInfo =
BaseStyleInfo.ReadOneFontOverride(reader);
if (overrideInfo.m_ws == wsTreeCombo)
return overrideInfo;
}
}
catch (EndOfStreamException)
{
}
finally
{
reader.Close();
}
}
return null;
}