Re: [patch] loadLyXFile

2003-06-20 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: | | > Looks good. | | Updated patch below for if someone else wants to test it (would be nice). | Tell me when you want me to commit. I think you can do that right away. -- Lgb

Re: [patch] loadLyXFile

2003-06-20 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote: > Looks good. Updated patch below for if someone else wants to test it (would be nice). Tell me when you want me to commit. Regards, Alfredo Index: BufferView.C === RCS file: /usr/local/lyx/cvsroot/lyx-de

Re: [patch] loadLyXFile

2003-06-20 Thread Alfredo Braunstein
Angus Leeming wrote: > Alfredo Braunstein wrote: > >> +bool readFile(Buffer * b, string const & s) >> +{ >> + string ts(s); >> + string e = OnlyPath(s); >> + string a = e; >> + // File information about normal file >> + FileInfo fileInfo2(s); >> + > > Being pedantic

Re: [patch] loadLyXFile

2003-06-20 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | +/* \file buffer_funcs.h | +/** | + * Loads a LyX file \param filename into \param Buffer | + * and \return success status. | + */ | +bool loadLyXFile(Buffer *, string const & filename); | | Apparently these comments should be \c filename rather than

Re: [patch] loadLyXFile

2003-06-20 Thread Angus Leeming
Alfredo Braunstein wrote: > +bool readFile(Buffer * b, string const & s) > +{ > + string ts(s); > + string e = OnlyPath(s); > + string a = e; > + // File information about normal file > + FileInfo fileInfo2(s); > + Being pedantic, why do you call it fileInfo2 and not

Re: [patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote: > Alfredo Braunstein <[EMAIL PROTECTED]> writes: > > | +Buffer * newFile(string const & name, string tname, bool isNamed) > > This should take "string const &" not just "string" ok. > > | +/// Make a new file (buffer) using a template > | +Buffer * newFile(string co

Re: [patch] loadLyXFile

2003-06-19 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes: | +Buffer * newFile(string const & name, string tname, bool isNamed) This should take "string const &" not just "string" | +/// Make a new file (buffer) using a template | +Buffer * newFile(string const &, string, bool isNamed = false); and here. A

Re: [patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote: > Please do it now. Here it is. Regards, Alfredo Index: BufferView.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v retrieving revision 1.160 diff -u -p -u -r1.160 BufferView.C --- Buff

Re: [patch] loadLyXFile

2003-06-19 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: | | > Things are looking good, some more testing now. | | I'm at it... (no surprises for now) | | > I wonder... should newFile also be moved out? | | Should be easy... it would call BufferList::newBuffer anyway. If y

Re: [patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote: > Things are looking good, some more testing now. I'm at it... (no surprises for now) > I wonder... should newFile also be moved out? Should be easy... it would call BufferList::newBuffer anyway. If you want I can do it now, or else we leave it for a second patch. A

Re: [patch] loadLyXFile

2003-06-19 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes: Things are looking good, some more testing now. | @@ -52,11 +41,9 @@ public: | /// Close all open buffers. | void closeAll(); | | - /// read the given file | - Buffer * readFile(string const &, bool ro); | - | //

Re: [patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote: > Now move those functions out of BufferList, and your are almost there. This would be it. It seems to work as expected, but I'll do some more testing. (I'm afraid of -x and RCS mainly) Regards, Alfredo Index: BufferView.C =

Re: [patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
Angus Leeming wrote: > Well conceptually they fill a buffer, so why not add them as > standalone functions in a new buffer_funcs.[Ch] ? Lots and lots of Yep. Done that. Thanks Angus > Buffer's member functions could probably be moved there too. At least > they could last time I looked. (Some tim

Re: [patch] loadLyXFile

2003-06-19 Thread Angus Leeming
Alfredo Braunstein wrote: >> I also think that BufferList::loadLyXFile should be moved out of >> BufferList. > > Right. A standalone function? Where should we put it? Also > BufferList::readFile is on the same status maybe (as it doesn't > create the buffer anymore). Well conceptually they fill

Re: [patch] loadLyXFile

2003-06-19 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes: | > I also think that BufferList::loadLyXFile should be moved out of | > BufferList. | | Right. A standalone function? Where should we put it? Also | BufferList::readFile is on the same status maybe (as it doesn't | create the buffer anymore). Yes.

Re: [patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote: > Alfredo Braunstein <[EMAIL PROTECTED]> writes: > > | The following patch is in the lines of what I would need to > | gracefully catch > | buffer load parse errors (the last inseterror user). > > You are pretty close, but drop all the changes to CutAndPaste and > upda

Re: [patch] loadLyXFile

2003-06-19 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes: | The following patch is in the lines of what I would need to | gracefully catch | buffer load parse errors (the last inseterror user). You are pretty close, but drop all the changes to CutAndPaste and update from cvs. I also think that BufferList:

[patch] loadLyXFile

2003-06-19 Thread Alfredo Braunstein
The following patch is in the lines of what I would need to gracefully catch buffer load parse errors (the last inseterror user). The problem with the present code IMO is that BufferList::loadLyXFile [and BufferList::readFile] does too many tasks at once: it looks for existence of this buffer on t