On Wed, Aug 01, 2007 at 12:19:33AM -0400, Richard Heck wrote:
> Andre Poenitz wrote:
> >On Tue, Jul 31, 2007 at 03:00:34PM -0400, Richard Heck wrote:
> >  
> >>Index: src/Buffer.h
> >>===================================================================
> >>--- src/Buffer.h    (revision 19264)
> >>+++ src/Buffer.h    (working copy)
> >>@@ -13,7 +13,11 @@
> >> #define BUFFER_H
> >> 
> >> #include "DocIterator.h"
> >>+#include "ErrorList.h"
> >>+#include "InsetList.h"
> >> 
> >>+#include "frontends/controllers/frontend_helpers.h"
> >>    
> >Why that? Including stuff from frontends/ in src/ is wrong in theory.
> >  
> Yes, I agree. This is needed, IIRC (I did this a while ago), for certain 
> constants, e.g.:
>    static const docstring 
> TheBibliographyRef(from_ascii("TheBibliographyRef"));
> which was in frontends/controllers/frontend_helpers.cpp and which I've 
> moved (in effect) to the header.

So why not move it in the core if it is used there?

> There is a lot of BibTeX-related stuff in frontends/controllers/. I 
> think most of that should be elsewhere. I think the whole biblio 
> namespace should be moved, probably into src/Biblio.{h,cpp}, or 
> something similar. But I guess I thought I should address this first 
> within the existing structure and save the clean-up for later

This does not work. The ugliness just becomes more entrenched.

>  If you think I should just do that now, I can do that.

I would prefer that.

> >>-docstring const parseBibTeX(docstring data, std::string const & findkey);
> >>+docstring const getValueForKey(KeyValMap data, std::string const & 
> >>findkey);
> >>    
> >Passing a  std::map<docstring, docstring>  by value seems wrong.
> 
> Yes. Made it const &. This required a const_cast, but that seems ok.

Not really.

> +     KeyValMap & data2 = const_cast<KeyValMap &>(data);
> +     return data2[key];

        return data.find(key)->second;

Maybe even with ASSERETing on != data.end().

Andre'

Reply via email to