1 /*
2     SPDX-FileCopyrightText: 1997, 1998 Lars Doelle <lars.doelle@on-line.de>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "CharacterFormat.h"
8 
9 using namespace Konsole;
10 
equalsFormat(const CharacterFormat & other) const11 bool CharacterFormat::equalsFormat(const CharacterFormat &other) const
12 {
13     return (other.rendition & ~RE_EXTENDED_CHAR) == (rendition & ~RE_EXTENDED_CHAR) && other.fgColor == fgColor && other.bgColor == bgColor;
14 }
15 
equalsFormat(const Character & c) const16 bool CharacterFormat::equalsFormat(const Character &c) const
17 {
18     return (c.rendition & ~RE_EXTENDED_CHAR) == (rendition & ~RE_EXTENDED_CHAR) && c.foregroundColor == fgColor && c.backgroundColor == bgColor;
19 }
20 
setFormat(const Character & c)21 void CharacterFormat::setFormat(const Character &c)
22 {
23     rendition = c.rendition;
24     fgColor = c.foregroundColor;
25     bgColor = c.backgroundColor;
26     isRealCharacter = c.isRealCharacter;
27 }
28