On Deep Background
by Remy Porter
in CodeSOD
on 2025-02-10
Andrew worked with Stuart. Stuart was one of those developers who didn't talk to anyone except to complain about how stupid management was, or how stupid the other developers were. Stuart was also the kind of person who would suddenly go on a tear, write three thousand lines of code in an evening, and then submit an pull request. He wouldn't respond to PR comments, however, and just wait until management needed the feature merged badly enough that someone said, "just approve it so we can move on."
int iDisplayFlags = objectProps.DisplayInfo.BackgroundPrintFlags;
bool bForceBackgroundOn = false;
bool bForceBackgroundOff = false;
if (_fileTypeID == 11)
{
if ((iDisplayFlags & 0x1008) != 0)
{
bForceBackgroundOn = true;
}
else if ((iDisplayFlags & 0x1001) != 0)
{
bForceBackgroundOff = true;
}
}
else if (_displayTypeID == 21)
{
if ((iDisplayFlags & 0x1200) != 0)
{
bForceBackgroundOn = true;
}
else if ((iDisplayFlags & 0x1040) != 0)
{
bForceBackgroundOff = true;
}
}
bool useBackground = bForceBackgroundOn;
if (!useBackground && objectProps.DisplayInfo.Background)
{
useBackground = Convert.ToBoolean(BackgroundShown);
}
if (bForceBackgroundOff)
{
useBackground = false;
}