Skip to content

Commit fdfbaf1

Browse files
committed
No need for extra checks of colors in TG classes
parGC and parFont has default value
1 parent 0dfe749 commit fdfbaf1

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

gui/gui/src/TGButton.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ void TGTextButton::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
19151915
parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
19161916
parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());
19171917

1918-
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC) || (GetOptions() != (kRaisedFrame | kDoubleBorder))) {
1918+
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
19191919
TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
19201920
if (ufont) {
19211921
ufont->SavePrimitive(out, option);

gui/gui/src/TGButtonGroup.cxx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,7 @@ void TGButtonGroup::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
628628
// coverity[dereference]
629629
parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());
630630

631-
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC) ||
632-
(fBackground != GetDefaultFrameBackground())) {
631+
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
633632
TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
634633
if (ufont) {
635634
ufont->SavePrimitive(out, option);
@@ -720,8 +719,7 @@ void TGHButtonGroup::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
720719
parFont.Form("%s::GetDefaultFontStruct()", IsA()->GetName());
721720
parGC.Form("%s::GetDefaultGC()()", IsA()->GetName());
722721

723-
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC) ||
724-
(fBackground != GetDefaultFrameBackground())) {
722+
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
725723
TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
726724
if (ufont) {
727725
ufont->SavePrimitive(out, option);
@@ -802,8 +800,7 @@ void TGVButtonGroup::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
802800
parFont.Form("%s::GetDefaultFontStruct()", IsA()->GetName());
803801
parGC.Form("%s::GetDefaultGC()()", IsA()->GetName());
804802

805-
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC) ||
806-
(fBackground != GetDefaultFrameBackground())) {
803+
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
807804
TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
808805
if (ufont) {
809806
ufont->SavePrimitive(out, option);

gui/gui/src/TGFrame.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3183,8 +3183,7 @@ void TGGroupFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
31833183
// coverity[dereference]
31843184
parGC.Form("%s::GetDefaultGC()()", IsA()->GetName());
31853185

3186-
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC) ||
3187-
(fBackground != GetDefaultFrameBackground())) {
3186+
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
31883187
TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
31893188
if (ufont) {
31903189
ufont->SavePrimitive(out, option);

gui/gui/src/TGTextEntry.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ void TGTextEntry::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
18361836
// coverity[dereference]
18371837
parGC.Form("%s::GetDefaultGC()()", IsA()->GetName());
18381838

1839-
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC.GetGC()) || (fBackground != GetWhitePixel())) {
1839+
if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC.GetGC())) {
18401840
TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
18411841
if (ufont) {
18421842
ufont->SavePrimitive(out, option);

0 commit comments

Comments
 (0)