On Saturday 31 March 2001 12:06, Lars Gullik Bjønnes wrote:
> vector<string> const ControlToc::getTypes() const
> {
>         vector<string> types;
>  
>         Buffer::Lists const tmp = lv_.view()->buffer()->getLists();
>  
>         Buffer::Lists::const_iterator cit = tmp.begin();
>         Buffer::Lists::const_iterator end = tmp.end();
>  
>         for (; cit != end; ++cit) {
>                 types.push_back(cit->first.c_str());
>                                           ^^^^^^^^^^
>                                 This looks strange. Just use cit->first.
>         }
>  
>         return types;
> }

The dangers of cut-and-paste. Thank you.

> I do not get why getType() is needed.

Because the inset does not store "TOC", "algorithm", "figure" or "table" but 
rather stores "tableofcontents", "listofalgorithms", "listoffigures" or 
"listoftables". The inset is inserted as a specific TOC, algorithm, figure 
inset, so when the popup is launched it should display the appropriate info.

I know this is sub-optimal, but it's meant to be a start not a finish.

A

Reply via email to