The attached works nice for me.
Is that OK to you Jürgen?

        Kornel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index be133b12c5..6e54de970c 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4558,10 +4558,18 @@ void Paragraph::changeCase(BufferParams const & bparams, pos_type pos,
 		}
 		changes.clear();
 	}
 }
 
+static char_type correctquote(char_type in)
+{
+	if (in == 0x2018 || in == 0x201a)	// ‘ ‚
+		return '\'';
+	if (in == 0x201e || in == 0x201c)	// „ “
+		return '"';
+	return in;
+}
 
 int Paragraph::find(docstring const & str, bool cs, bool mw,
 		pos_type start_pos, bool del) const
 {
 	pos_type pos = start_pos;
@@ -4588,24 +4596,26 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
 			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) {
-					if ((cs && str[i] != insetstring[j])
-					    || (!cs && uppercase(str[i]) != uppercase(insetstring[j]))) {
+					char_type ij = correctquote(insetstring[j]);
+					if ((cs && str[i] != ij)
+					    || (!cs && uppercase(str[i]) != uppercase(ij))) {
 						nonmatch = true;
 						break;
 					}
 				}
 			}
 			pos++;
 		}
 		if (nonmatch || i == strsize)
 			break;
-		if (cs && str[i] != d->text_[pos])
+		char_type dp = correctquote(d->text_[pos]);
+		if (cs && str[i] != dp)
 			break;
-		if (!cs && uppercase(str[i]) != uppercase(d->text_[pos]))
+		if (!cs && uppercase(str[i]) != uppercase(dp))
 			break;
 	}
 
 	if (i != strsize)
 		return 0;

Attachment: pgpEpgVX_gYR9.pgp
Description: Digitale Signatur von OpenPGP

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to