]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.C
remove noload/don't typeset
[lyx.git] / src / lyxfind.C
index 4275b085b19372f6ea4f1f13cacfc9fb02456aad..597df35b6a3622b2c8e0695f04b86106ebc66b39 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "lyxtext.h"
 #include "lyxfind.h"
+#include "paragraph.h"
 #include "frontends/LyXView.h"
 #include "frontends/Alert.h"
 #include "support/textutils.h"
@@ -14,6 +15,7 @@
 #include "buffer.h"
 #include "debug.h"
 #include "gettext.h"
+#include "insets/insettext.h"
 
 using lyx::pos_type;
 
@@ -85,7 +87,12 @@ int LyXReplace(BufferView * bv,
        int replace_count = 0;
        do {
                text = bv->getLyXText();
-               if (!bv->theLockingInset() || text != bv->text) {
+               // We have to do this check only because mathed insets don't
+               // return their own LyXText but the LyXText of it's parent!
+               if (!bv->theLockingInset() ||
+                       ((text != bv->text) &&
+                        (text->inset_owner == text->inset_owner->getLockingInset())))
+               {
                        bv->hideCursor();
                        bv->update(text, BufferView::SELECT|BufferView::FITCUR);
                        bv->toggleSelection(false);