]> git.lyx.org Git - features.git/commitdiff
some debug stuff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 5 Aug 2001 22:12:27 +0000 (22:12 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 5 Aug 2001 22:12:27 +0000 (22:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2421 a592a061-630c-0410-9148-cb99ea01b6c8

src/bufferview_funcs.C
src/insets/insetcollapsable.C
src/insets/insettext.C
src/lyxfunc.C
src/text2.C

index c65b91173560184c7e5d362bffce3c08d7625e62..7239dbd0e268ba547154d8a0289a0b2a22445b62 100644 (file)
@@ -194,6 +194,9 @@ string const currentState(BufferView * bv)
                                break;
                        }
                }
+#if 1
+               state << _(", Paragraph: ") << text->cursor.par()->id();
+#endif
        }
        return state.str().c_str();
 }
index 20801418a6bbfd40febbab5cde6ee3d402c23748..beb5728367899f973eae4977e676edc6fef5faef 100644 (file)
@@ -550,6 +550,7 @@ int InsetCollapsable::scroll(bool recursive) const
 
 Paragraph * InsetCollapsable::getParFromID(int id) const
 {
+       lyxerr[Debug::INFO] << "Looking for paragraph " << id << endl;
        return inset.getParFromID(id);
 }
 
index 8049dbdbd1d369395bc0eaa7db50a04da0727ed2..74f8d7ebd73cb05fd8cb7dc490195be749b6fcd0 100644 (file)
@@ -1998,6 +1998,7 @@ void InsetText::clearInset(Painter & pain, int baseline, bool & cleared) const
 
 Paragraph * InsetText::getParFromID(int id) const
 {
+#if 0
        Paragraph * result = par;
        Paragraph * ires = 0;
        while (result && result->id() != id) {
@@ -2006,6 +2007,22 @@ Paragraph * InsetText::getParFromID(int id) const
                result = result->next();
        }
        return result;
+#else
+       Paragraph * tmp = par;
+       while (tmp) {
+               int tmp_id = tmp->id();
+               lyxerr << "Looking at paragraph: " << tmp_id << endl;
+               if (tmp->id() == id) {
+                       return tmp;
+               }
+               Paragraph * tmp2 = tmp->getParFromID(id);
+               if (tmp2 != 0) {
+                       return tmp2;
+               }
+               tmp = tmp->next();
+       }
+       return 0;
+#endif
 }
 
 
index 2bfadf470c924862d127f111dbc4234e9980e0ae..a95050cc8befdcd394011bd0edb4f156fdb36f7a 100644 (file)
@@ -1393,10 +1393,13 @@ string const LyXFunc::dispatch(int ac,
                        lyxerr[Debug::INFO] << "No matching paragraph found! ["
                                            << id << "]" << std::endl;
                        break;
+               } else {
+                       lyxerr << "Paragraph " << par->id()
+                              << " found." << endl;
                }
 
                // Set the cursor
-               TEXT()->setCursor(owner->view(), par, 0);
+               owner->view()->text->setCursor(owner->view(), par, 0);
                owner->view()->setState();
                owner->showState();
 
index fa5220ac46b665123bb1bbff2e5e669de233ef43..179b5dacb1d62c787171c371d9e2a7c268fda946 100644 (file)
@@ -2137,14 +2137,26 @@ void LyXText::setCursorIntern(BufferView * bview, Paragraph * par,
                              bool setfont, bool boundary) const
 {
        InsetText * it = static_cast<InsetText *>(par->inInset());
-       if (it && (it != inset_owner)) {
-               it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
-                                                      boundary);
-       } else {
-               setCursor(bview, cursor, par, pos, boundary);
-               if (setfont)
-                       setCurrentFont(bview);
+       if (it) {
+               lyxerr << "InsetText   is " << it << endl;
+               lyxerr << "inset_owner is " << inset_owner << endl;
+               if (it != inset_owner) {
+#warning I belive this code is wrong. (Lgb)
+#warning Jürgen, have a look at this. (Lgb)
+                       // Jürgen, would you like to have a look?
+                       // I guess we need to move the outer cursor
+                       // and open and lock the inset (bla bla bla)
+                       // stuff I don't know... so can you have a look?
+                       // (Lgb)
+                       it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
+                                                              boundary);
+                       return;
+               }
        }
+       
+       setCursor(bview, cursor, par, pos, boundary);
+       if (setfont)
+               setCurrentFont(bview);
 }