On Mon, Aug 11, 2003 at 09:54:06AM +0100, John Levon wrote:
> On Mon, Aug 11, 2003 at 10:40:08AM +0200, Andre Poenitz wrote:
> 
> >     lyxerr << "BufferView::update()" << endl;
> > +   // fix cursor coordinate cache in case something went wrong
> > +   if (bv_->getLyXText()) {
> > +           // check needed to survive LyX startup
> > +           bv_->getLyXText()->redoCursor();
> > +           fitCursor();
> > +   }
> 
> This looks like a "Don't know what's going on, hack around it" change.

Not exactly. 

> I thought we were getting rid of those :)

Instead of having this kind of hack in 20 places, one place is better.

> 
> > -   for (; i < par.size(); ++i) {
> > +   for (; i < par.size(); ++i)
> >             if (par.isNewline(i))
> >                     return i;
> > -   }
> 
> I *strongly* disagree with a style like this  ...
> 
> > +void LyXText::redoCursor()
> > +{
> > +#warning maybe the same for selections?
> 
> Indeed.
> 
> > +   setCursor(cursor, cursor.par(), cursor.pos(), cursor.boundary());
> 
>   +   TextCursor::clearSelection();
>       
> > -#ifdef WITH_WARNINGS
> > -#warning I believe this code is wrong. (Lgb)
> > -#warning Jürgen, have a look at this. (Lgb)
> > -#warning Hmmm, I guess you are right but we
> > -#warning should verify when this is needed
> > -#endif
> 
> Why are you removing this ? It's still an issue.

The whole chunk looks like:


@@ -1581,32 +1540,6 @@ float LyXText::getCursorX(RowList::itera
 void LyXText::setCursorIntern(ParagraphList::iterator pit,
                              pos_type pos, bool setfont, bool boundary)
 {
-       UpdatableInset * it = pit->inInset();
-       if (it) {
-               if (it != inset_owner) {
-                       lyxerr[Debug::INSETS] << "InsetText   is " << it
-                                             << endl
-                                             << "inset_owner is "
-                                             << inset_owner << endl;
-#ifdef WITH_WARNINGS
-#warning I believe this code is wrong. (Lgb)
-#warning Jürgen, have a look at this. (Lgb)
-#warning Hmmm, I guess you are right but we
-#warning should verify when this is needed
-#endif
-                       // 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)
-                       // I moved the lyxerr stuff in here so we can see if
-                       // this is actually really needed and where!
-                       // (Jug)
-                       // it->getLyXText(bv())->setCursorIntern(bv(), par, pos, 
setfont, boundary);
-                       return;
-               }
-       }
-
        setCursor(cursor, pit, pos, boundary);
        if (setfont)
                setCurrentFont();


Care to explain what's wrong with that?

 
> I got bored here, the patch was way too big to read ...

*shrug*

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to