On Wed, May 07, 2008 at 02:45:00PM -0000, [EMAIL PROTECTED] wrote:
> Author: sanda
> Date: Wed May  7 16:44:58 2008
> New Revision: 24657
> 
> URL: http://www.lyx.org/trac/changeset/24657
> Log:
> Move code to more appropriate place, cosmetics.
> 
> Modified:
>     lyx-devel/trunk/src/Text3.cpp
>     lyx-devel/trunk/src/insets/InsetGraphics.cpp
>     lyx-devel/trunk/src/insets/InsetGraphics.h
> 
> Modified: lyx-devel/trunk/src/Text3.cpp
> URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Text3.cpp?rev=24657
> ==============================================================================
> --- lyx-devel/trunk/src/Text3.cpp (original)
> +++ lyx-devel/trunk/src/Text3.cpp Wed May  7 16:44:58 2008
> @@ -893,17 +893,14 @@
>       }
>  
>       case LFUN_SET_GRAPHICS_GROUP: {
> -             Inset * instmp = &cur.inset();
> -             if (instmp->lyxCode() != GRAPHICS_CODE) instmp = 
> cur.nextInset();
> -             if (!instmp || instmp->lyxCode() != GRAPHICS_CODE) break;
> +             InsetGraphics * ins = 
> InsetGraphics::getCurrentGraphicsInset(cur);
> +             if (!ins) break;

Please adjust this to LyX standard style. Also applies below.

> +InsetGraphics * InsetGraphics::getCurrentGraphicsInset(Cursor const & cur)
> +{
> +     Inset * instmp = &cur.inset();
> +     if (instmp->lyxCode() != GRAPHICS_CODE) instmp = cur.nextInset();
> +     if (!instmp || instmp->lyxCode() != GRAPHICS_CODE) return 0;

How can instmp possibly be 0?
> +
> +     InsetGraphics & ins = static_cast<InsetGraphics &>(*instmp);
> +     return &ins;

Why not   

   return static_cast<InsetGraphics *>(instmp);

?

Andre'

Reply via email to