Kaydet (Commit) 9c5060a6 authored tarafından Noel Grandin's avatar Noel Grandin

attempt to fix tdf#95935 - CRASH on startup in o3tl vcl code

I suspect that the problem is the shift and that converting it
  "1UL <<"
will fix it

Change-Id: I4808b833453a544aeb732192758d323f358c3ab0
üst ab9add5c
......@@ -988,15 +988,15 @@ FontWidth FontSubstConfiguration::getSubstWidth( const css::uno::Reference< XNam
ImplFontAttrs FontSubstConfiguration::getSubstType( const css::uno::Reference< XNameAccess >& rFont,
const OUString& rType ) const
{
unsigned long type = 0;
sal_uLong type = 0;
try
{
Any aAny = rFont->getByName( rType );
if( aAny.getValueTypeClass() == TypeClass_STRING )
{
if( aAny.getValueTypeClass() != TypeClass_STRING )
return ImplFontAttrs::None;
const OUString* pLine = static_cast<const OUString*>(aAny.getValue());
if( !pLine->isEmpty() )
{
if( pLine->isEmpty() )
return ImplFontAttrs::None;
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
......@@ -1004,12 +1004,11 @@ ImplFontAttrs FontSubstConfiguration::getSubstType( const css::uno::Reference< X
for( int k = 0; k < 32; k++ )
if( aToken.equalsIgnoreAsciiCaseAscii( pAttribNames[k] ) )
{
type |= 1 << k;
type |= 1UL << k;
break;
}
}
}
}
assert(((type & ~o3tl::typed_flags<ImplFontAttrs>::mask) == 0) && "invalid font attributes");
}
catch (const NoSuchElementException&)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment