On Thu, Aug 16, 2007 at 01:59:21AM -0000, [EMAIL PROTECTED] wrote:
> Modified: lyx-devel/trunk/src/Biblio.cpp
> URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Biblio.cpp?rev=19598
> ==============================================================================
> --- lyx-devel/trunk/src/Biblio.cpp (original)
> +++ lyx-devel/trunk/src/Biblio.cpp Thu Aug 16 03:59:20 2007
> @@ -48,6 +48,22 @@
>  using support::trim;
>  
>  namespace biblio {
> +
> +     
> +BibTeXInfo::BibTeXInfo(): isBibTeX(true)
> +{}

Spacing before the third colon.

> +BibTeXInfo::BibTeXInfo(bool isBibTeX): isBibTeX(isBibTeX)
> +{};

Spacing, superfluous semicolon.

It's also one of the rare cases where a default argument might make
sense. Also, really trivial code (i.e. 'fits on the line') can go to the
header, less line noise for us and more chances for the optimizer.

> +bool BibTeXInfo::hasKey(docstring const & key) 
> +{
> +     const_iterator it = find(key);
> +     return it == end();
> +}

Method could be const?

Lars receently suggested to use

   return count(key);

or more explicitly

   return count(key) == 1

as idiom.

> -
> +     //FIXME ?? return it->second??
> +     BibTeXInfo & data2 = const_cast<BibTeXInfo &>(data);
> +     return data2[key];
> +}

FIXME??  it->second seems suitable.

> +
> +/// Class to represent information about a BibTeX or
> +/// bibliography entry.
> +/// The keys are BibTeX fields, and the values are the
> +/// associated field values.
> +/// \param isBibTex false if this is from an InsetBibitem
> +/// \param allData the entire BibTeX entry, more or less
> +/// \param entryType the BibTeX entry type
> +class BibTeXInfo : public std::map<docstring, docstring> {
> +     public:
> +             BibTeXInfo();
> +             BibTeXInfo(bool isBibTeX);
> +             bool hasKey(docstring const & key);
> +             bool isBibTeX;
> +             docstring allData;
> +             docstring entryType;
> +};

LyX sources have no indentation before public.

Andre'

Reply via email to