}
}
-static char_type matchquote(char_type in)
-{
- switch (in) {
- case 0x2018:
- case 0x201a:
- case 0x203a:
- case 0x2039:
- return '\''; // ‘ ‚ › ‹
- case 0x00bb:
- case 0x00ab:
- case 0x201e:
- case 0x201c:
- return '"'; // » « „ “
- default:
- return in;
- }
-}
-
int Paragraph::find(docstring const & str, bool cs, bool mw,
pos_type start_pos, bool del) const
{
if (!inset->isLetter() && !inset->isChar())
break;
odocstringstream os;
- inset->toString(os);
+ if (inset->lyxCode() == lyx::QUOTE_CODE) {
+ OutputParams op(0);
+ op.for_searchAdv = OutputParams::SearchQuick;
+ inset->plaintext(os, op);
+ }
+ else {
+ inset->toString(os);
+ }
docstring const insetstring = os.str();
if (!insetstring.empty()) {
int const insetstringsize = insetstring.length();
for (int j = 0; j < insetstringsize && pos < parsize; ++i, ++j) {
- char_type ij = matchquote(insetstring[j]);
- if ((cs && str[i] != ij)
- || (!cs && uppercase(str[i]) != uppercase(ij))) {
+ if ((cs && str[i] != insetstring[j])
+ || (!cs && uppercase(str[i]) != uppercase(insetstring[j]))) {
nonmatch = true;
break;
}
}
if (nonmatch || i == strsize)
break;
- char_type dp = matchquote(d->text_[pos]);
+ char_type dp = d->text_[pos];
if (cs && str[i] != dp)
break;
if (!cs && uppercase(str[i]) != uppercase(dp))