Ozgur Ugras BARAN wrote:
This small patch prevents LOF, LOT always selects the last entry.
LOT/LOF still does not follow the cursor, yet, but for this, we need
serious update in TocBackend.

Not that much work IMO. The problem is the way we search for the toc item is very crude. Look at the comment in TocBackend::item():

// A good solution for Items inside insets would be to do:
//
//if (std::distance(it->par_it_, current) <= 0)
//      return it;
//
// But for an unknown reason, std::distance(current, it->par_it_) always
// returns  a positive value and std::distance(it->par_it_, current)
// takes forever...
// So for now, we do:
if (it->par_it_.pit() <= par_it_text.pit())
        return it;

This is not correct and will work only for top-level items. So if someone could implement an <= operator for ParConstIterator, that would solve our problem. Jean-Marc, Andre, your the experts in this field, could you implement this:

bool operator<=(ParConstIterator const &, ParConstIterator const &);


Do you think this solves bug 3183?

I think yes.


Hopefully, last patch for toc stuff.

here is svn log message:

* src/frontends/qt4/TocWidget.cpp:
   -Do not allow select ModelItem from the code for non-TOC types

I'll take care of that one. Thanks.

Abdel.




------------------------------------------------------------------------

Index: frontends/qt4/TocWidget.cpp
===================================================================
--- frontends/qt4/TocWidget.cpp (revision 18311)
+++ frontends/qt4/TocWidget.cpp (working copy)
@@ -204,6 +204,8 @@
                        << "TocWidget::select(): QModelIndex is invalid!" << 
endl;
                return;
        }
+       if(!form_->canOutline(typeCO->currentIndex()))
+               return;
tocTV->selectionModel()->blockSignals(true);
        tocTV->selectionModel()->clear();

Reply via email to