mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-19 15:43:08 +08:00
fix bug #69780
This commit is contained in:
@ -34,23 +34,31 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
BorderCode::BorderCode(): cv(0), dptLineWidth(0), brcType(0), ico( Global::ColorIdentifier[0] ), dptSpace(0), fShadow(false), fFrame(false), fNil(false)
|
||||
BorderCode::BorderCode(): dptLineWidth(0), brcType(0), ico( Global::ColorIdentifier[0] ), dptSpace(0), fShadow(false), fFrame(false), fNil(false)
|
||||
{
|
||||
}
|
||||
|
||||
/// Parses the unsigned char for a BRC
|
||||
BorderCode::BorderCode( unsigned char* bytes, int size ):
|
||||
cv(0), dptLineWidth(0), brcType(0), ico( Global::ColorIdentifier[0] ), dptSpace(0), fShadow(false), fFrame(false), fNil(false)
|
||||
dptLineWidth(0), brcType(0), ico( Global::ColorIdentifier[0] ), dptSpace(0), fShadow(false), fFrame(false), fNil(false)
|
||||
{
|
||||
if ( FormatUtils::ArraySum( bytes, size ) == ( size * 255 ) )
|
||||
{
|
||||
fNil = true;
|
||||
}
|
||||
else if ( size == 8 )
|
||||
{
|
||||
//it's a border code of Word 2000/2003
|
||||
{ //it's a border code of Word 2000/2003
|
||||
cv = FormatUtils::BytesToInt32( bytes, 0, size );
|
||||
cv = cv & 0x00ffffff;
|
||||
BYTE auto_ = GETBITS(*cv, 24, 31);
|
||||
|
||||
if (auto_ == 0)
|
||||
{
|
||||
BYTE B = GETBITS(*cv, 0, 7);
|
||||
BYTE G = GETBITS(*cv, 8, 15);
|
||||
BYTE R = GETBITS(*cv, 16, 23);
|
||||
cv = (B << 16) + (G << 8) + (R);
|
||||
}
|
||||
else cv = boost::none;
|
||||
|
||||
ico = std::wstring( Global::ColorIdentifier[0] );
|
||||
|
||||
@ -104,9 +112,9 @@ namespace DocFileFormat
|
||||
}
|
||||
std::wstring BorderCode::getColor()
|
||||
{
|
||||
if (cv != 0)
|
||||
if (cv)
|
||||
{
|
||||
return FormatUtils::IntToFormattedWideString(cv, L"#%06x");
|
||||
return FormatUtils::IntToFormattedWideString(*cv, L"#%06x");
|
||||
}
|
||||
else if (false == ico.empty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user