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,28 +988,27 @@ FontWidth FontSubstConfiguration::getSubstWidth( const css::uno::Reference< XNam ...@@ -988,28 +988,27 @@ FontWidth FontSubstConfiguration::getSubstWidth( const css::uno::Reference< XNam
ImplFontAttrs FontSubstConfiguration::getSubstType( const css::uno::Reference< XNameAccess >& rFont, ImplFontAttrs FontSubstConfiguration::getSubstType( const css::uno::Reference< XNameAccess >& rFont,
const OUString& rType ) const const OUString& rType ) const
{ {
unsigned long type = 0; sal_uLong type = 0;
try try
{ {
Any aAny = rFont->getByName( rType ); 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() )
return ImplFontAttrs::None;
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{ {
const OUString* pLine = static_cast<const OUString*>(aAny.getValue()); OUString aToken( pLine->getToken( 0, ',', nIndex ) );
if( !pLine->isEmpty() ) for( int k = 0; k < 32; k++ )
{ if( aToken.equalsIgnoreAsciiCaseAscii( pAttribNames[k] ) )
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{ {
OUString aToken( pLine->getToken( 0, ',', nIndex ) ); type |= 1UL << k;
for( int k = 0; k < 32; k++ ) break;
if( aToken.equalsIgnoreAsciiCaseAscii( pAttribNames[k] ) )
{
type |= 1 << k;
break;
}
} }
}
} }
assert(((type & ~o3tl::typed_flags<ImplFontAttrs>::mask) == 0) && "invalid font attributes");
} }
catch (const NoSuchElementException&) 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