On Fri, Aug 17, 2007 at 02:08:17PM +0200, Abdelrazak Younes wrote: > Martin Vermeer wrote: > > On Fri, Aug 17, 2007 at 11:00:07AM +0200, Abdelrazak Younes wrote: > >> Martin Vermeer wrote: > >>> On Fri, Aug 17, 2007 at 09:22:16AM +0200, Abdelrazak Younes wrote: > >>>> Martin, > >>>> > >>>> This is for you I guess: > >>>> > >>>> src\insets\insetcollapsable.cpp(71) : warning C4715: > >>>> 'lyx::InsetCollapsable::geometry' : not all control paths return a value > >>>> > >>>> Abdel. > >>> Yes, I am getting that too: control reaches end of non-void > >>> function. But if you manually trace the function, you see that it cannot > >>> really happen ;-) Is the compiler being over-careful? I suppose we could > >>> shut up this warning. But should we? > >> No, just put a dummy warning at the end: > > > > That's what I meant by shutting up. > > Ah... I thought you meant disabling it at compiler level. > > > > >>> Actually the breaks are unnecessary too. > >> Indeed. See patch. > > > > I would comment this (the break thing) a bit. > > What do you want comment? > > > Otherwise > > I am OK with the patch. > > OK, I'll commit and I'll let you put the relevant comment then.
What about the attached? -- Enrico
Index: src/insets/InsetCollapsable.cpp =================================================================== --- src/insets/InsetCollapsable.cpp (revision 19614) +++ src/insets/InsetCollapsable.cpp (working copy) @@ -51,23 +51,27 @@ InsetCollapsable::CollapseStatus InsetCo InsetCollapsable::Geometry InsetCollapsable::geometry() const { + Geometry retVal; + switch (decoration()) { case Classic: if (status_ == Open || autoOpen_) { if (openinlined_) - return LeftButton; + retVal = LeftButton; else - return TopButton; + retVal = TopButton; } else - return ButtonOnly; + retVal = ButtonOnly; break; case Minimalistic: - return NoButton; + retVal = NoButton; break; case Conglomerate: - return ( status_ == Open ? SubLabel : Corners ); + retVal = ( status_ == Open ? SubLabel : Corners ); break; } + + return retVal; }