On Thursday 15 August 2002 11:57 am, Martin Vermeer wrote:
> Finally I got it working! Patch attached.

Oh, well done. I was actually reading your post from yesterday when this one 
arrived ;-)

Looking at the code:

+InsetList::iterator Paragraph::shortTitleInset() const
+{
+       // Find the entry.
+       InsetList::iterator it = insetlist.begin();
+       InsetList::iterator end = insetlist.end();
+       for (; it != end; ++it) {
+               if (it.getInset()->lyxCode() == Inset::SHORTTITLE_CODE) {
+                       return it;
+               }
+       }
+       return 0;
+}

shouldn't this be
        InsetShortTitle * Paragraph::shortTitleInset() const
ie, I'm not interested in where it is, just in it itself.

Semanticly, (InsetList::iterator it == 0) is BAD.
        
> Problems still:
>
> - Can be inserted anywhere, not only in sectioning headers. Will give
>   latexing error then.

Well, you should ultimately remove your LFUN (or hide it from public view and 
just use it privately). Then the Section, Caption etc environment code (I'm 
ignorant here) will use it and nothing else.

Something like:
* Choose Title-d environment
        code inserts an InsertShortTitle at the start of the paragraph.
* Revert to Standard
        "export" the contents of the InsetShortTitle to the paragraph.

"Title-d environment" means Section, Subsection and probably Caption also? It 
looks to me like it should just work.

This is really, really the time where you could do with some help from 
someone who understands how this stuff works. Scream louder !

> - No user interface yet, just M-x shorttitle-insert <RET>.
>
> - Captions???
>
> but IT WORKS!
>
> Martin
>
> PS I'm going off-line now because of power cuts. Dunno when back.

Well if you will live in a 3rd world country with a fantastic standard of 
living...

Incidentally, why do the Scandanavian countries have such high suicide rates? 
They are fantastic places to live. I can't square that circle. No daylight in 
winter?

Angus

Reply via email to