Пример #1
0
void ApplyCharStyle(RichPara::CharFormat& format, const RichPara::CharFormat& f0,
                    const RichPara::CharFormat& newstyle) { 
	if(format.IsBold() == f0.IsBold())
		format.Bold(newstyle.IsBold());
	if(format.IsUnderline() == f0.IsUnderline())
		format.Underline(newstyle.IsUnderline());
	if(format.IsItalic() == f0.IsItalic())
		format.Italic(newstyle.IsItalic());
	if(format.IsStrikeout() == f0.IsStrikeout())
		format.Strikeout(newstyle.IsStrikeout());
	if(format.IsNonAntiAliased() == f0.IsNonAntiAliased())
		format.NonAntiAliased(newstyle.IsNonAntiAliased());
	if(format.capitals == f0.capitals)
		format.capitals = newstyle.capitals;
	if(format.dashed == f0.dashed)
		format.dashed = newstyle.dashed;
	if(format.sscript == f0.sscript)
		format.sscript = newstyle.sscript;
	if(format.GetFace() == f0.GetFace())
		format.Face(newstyle.GetFace());
	if(format.GetHeight() == f0.GetHeight())
		format.Height(newstyle.GetHeight());
	if(format.ink == f0.ink)
		format.ink = newstyle.ink;
	if(format.paper == f0.paper)
		format.paper = newstyle.paper;
}
Пример #2
0
void RichTxt::FormatInfo::ApplyTo(RichPara::CharFormat& fmt) const
{
	if(charvalid & BOLD)
		fmt.Bold(IsBold());
	if(charvalid & ITALIC)
		fmt.Italic(IsItalic());
	if(charvalid & UNDERLINE)
		fmt.Underline(IsUnderline());
	if(charvalid & STRIKEOUT)
		fmt.Strikeout(IsStrikeout());
	if(charvalid & NOAA)
		fmt.NonAntiAliased(IsNonAntiAliased());
	if(charvalid & CAPITALS)
		fmt.capitals = capitals;
	if(charvalid & DASHED)
		fmt.dashed = dashed;
	if(charvalid & SSCRIPT)
		fmt.sscript = sscript;
	if(charvalid & FACE)
		fmt.Face(GetFace());
	if(charvalid & HEIGHT)
		fmt.Height(GetHeight());
	if(charvalid & LANGUAGE)
		fmt.language = language;
	if(charvalid & INK)
		fmt.ink = ink;
	if(charvalid & PAPER)
		fmt.paper = paper;
	if(charvalid & LANG)
		fmt.language = language;
	if(charvalid & LINK)
		fmt.link = link;
	if(charvalid & INDEXENTRY)
		fmt.indexentry = indexentry;
}