mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Handle "^~" combination in dsl dictionaries
This commit is contained in:
parent
cc771ace77
commit
af1403da2d
2
dsl.cc
2
dsl.cc
|
@ -70,7 +70,7 @@ DEF_EX_STR( exCantReadFile, "Can't read file", Dictionary::Ex )
|
|||
enum
|
||||
{
|
||||
Signature = 0x584c5344, // DSLX on little-endian, XLSD on big-endian
|
||||
CurrentFormatVersion = 16 + BtreeIndexing::FormatVersion + Folding::Version,
|
||||
CurrentFormatVersion = 17 + BtreeIndexing::FormatVersion + Folding::Version,
|
||||
CurrentZipSupportVersion = 2
|
||||
};
|
||||
|
||||
|
|
|
@ -1048,10 +1048,20 @@ void expandTildes( wstring & str, wstring const & tildeReplacement )
|
|||
x+=2;
|
||||
else
|
||||
if ( str[ x ] == L'~' )
|
||||
{
|
||||
if( x > 0 && str[ x - 1 ] == '^' && ( x < 2 || str[ x - 2 ] != '\\' ) )
|
||||
{
|
||||
str.replace( x - 1, 2, tildeReplacement );
|
||||
str[ x - 1 ] = QChar( str[ x - 1 ] ).isUpper() ? QChar::toLower( str[ x - 1 ] )
|
||||
: QChar::toUpper( str[ x - 1 ] );
|
||||
x = x - 1 + tildeReplacement.size();
|
||||
}
|
||||
else
|
||||
{
|
||||
str.replace( x, 1, tildeReplacement );
|
||||
x += tildeReplacement.size();
|
||||
}
|
||||
}
|
||||
else
|
||||
++x;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue