mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +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
|
||||
};
|
||||
|
||||
|
|
|
@ -1049,8 +1049,18 @@ void expandTildes( wstring & str, wstring const & tildeReplacement )
|
|||
else
|
||||
if ( str[ x ] == L'~' )
|
||||
{
|
||||
str.replace( x, 1, tildeReplacement );
|
||||
x += tildeReplacement.size();
|
||||
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