mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
XDXF: Fix indexing of the dictionaries with empty "abbreviation" field (issue #1132)
This commit is contained in:
parent
7ef50ba50f
commit
247a076371
9
xdxf.cc
9
xdxf.cc
|
@ -1323,13 +1323,13 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
list < wstring > keys;
|
list < wstring > keys;
|
||||||
while( !( stream.isEndElement() && stream.name() == "abbreviations" ) && !stream.atEnd() )
|
while( !( stream.isEndElement() && stream.name() == "abbreviations" ) && !stream.atEnd() )
|
||||||
{
|
{
|
||||||
stream.readNext();
|
if( !stream.readNextStartElement() )
|
||||||
// abbreviations tag set switch at format revision = 30
|
break;
|
||||||
|
// abbreviations tag set switch at format revision = 30
|
||||||
if( idxHeader.revisionNumber >= 30 )
|
if( idxHeader.revisionNumber >= 30 )
|
||||||
{
|
{
|
||||||
while ( !( stream.isEndElement() && stream.name() == "abbr_def" ) || !stream.atEnd() )
|
while ( !( stream.isEndElement() && stream.name() == "abbr_def" ) || !stream.atEnd() )
|
||||||
{
|
{
|
||||||
stream.readNext();
|
|
||||||
if ( stream.isStartElement() && stream.name() == "abbr_k" )
|
if ( stream.isStartElement() && stream.name() == "abbr_k" )
|
||||||
{
|
{
|
||||||
s = readElementText( stream );
|
s = readElementText( stream );
|
||||||
|
@ -1347,13 +1347,13 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
}
|
}
|
||||||
else if ( stream.isEndElement() && stream.name() == "abbreviations" )
|
else if ( stream.isEndElement() && stream.name() == "abbreviations" )
|
||||||
break;
|
break;
|
||||||
|
stream.readNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while ( !( stream.isEndElement() && stream.name() == "abr_def" ) || !stream.atEnd() )
|
while ( !( stream.isEndElement() && stream.name() == "abr_def" ) || !stream.atEnd() )
|
||||||
{
|
{
|
||||||
stream.readNext();
|
|
||||||
if ( stream.isStartElement() && stream.name() == "k" )
|
if ( stream.isStartElement() && stream.name() == "k" )
|
||||||
{
|
{
|
||||||
s = readElementText( stream );
|
s = readElementText( stream );
|
||||||
|
@ -1371,6 +1371,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
}
|
}
|
||||||
else if ( stream.isEndElement() && stream.name() == "abbreviations" )
|
else if ( stream.isEndElement() && stream.name() == "abbreviations" )
|
||||||
break;
|
break;
|
||||||
|
stream.readNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue