Skip to content

Commit

Permalink
Fixed a git merge master issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jan 2, 2019
1 parent 4d1b2a0 commit c25660c
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions textengines/mathml/qwt_mml_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3855,79 +3855,6 @@ static int attributeIndex( const QString &name )
return -1;
}

static QString decodeEntityValue( QString literal )
{
QString result;

while ( !literal.isEmpty() )
{

if ( !literal.startsWith( "&#" ) )
{
qWarning() << "decodeEntityValue(): bad entity literal: \"" + literal + "\"";
return QString();
}

literal = literal.right( literal.length() - 2 );

int i = literal.indexOf( ';' );
if ( i == -1 )
{
qWarning() << "decodeEntityValue(): bad entity literal: \"" + literal + "\"";
return QString();
}

QString char_code = literal.left( i );
literal = literal.right( literal.length() - i - 1 );

if ( char_code.isEmpty() )
{
qWarning() << "decodeEntityValue(): bad entity literal: \"" + literal + "\"";
return QString();
}

if ( char_code.at( 0 ) == 'x' )
{
char_code = char_code.right( char_code.length() - 1 );
bool ok;
unsigned c = char_code.toUInt( &ok, 16 );
if ( !ok )
{
qWarning() << "decodeEntityValue(): bad entity literal: \"" + literal + "\"";
return QString();
}
result += QChar( c );
}
else
{
bool ok;
unsigned c = char_code.toUInt( &ok, 10 );
if ( !ok )
{
qWarning() << "decodeEntityValue(): bad entity literal: \"" + literal + "\"";
return QString();
}
result += QChar( c );
}
}

return result;
}

static const QwtMmlEntitySpec *searchEntitySpecData( const QString &value, const QwtMmlEntitySpec *from = 0 )
{
const QwtMmlEntitySpec *ent = from;
if ( ent == 0 )
ent = g_xml_entity_data;
for ( ; ent->name != 0; ++ent )
{
QString ent_value = decodeEntityValue( ent->value );
if ( value == ent_value )
return ent;
}
return 0;
}

struct OperSpecSearchResult
{
OperSpecSearchResult() { prefix_form = infix_form = postfix_form = 0; }
Expand Down

0 comments on commit c25660c

Please sign in to comment.