commit ab1e642ef1fe5cc95041d3ca98c5f4ab47bfcdfb
Author: Jean-Marc <[email protected]>
Date:   Sat Sep 12 19:01:18 2015 +0200

    Fix logic of method
    
    The last return statement was unreachable
    
    Coverity issue 102063.

diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index c5bd4ee..2d0cf53 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -204,21 +204,21 @@ ColorCode InsetBox::backgroundColor(PainterInfo const &) 
const
        // we only support background color for 3 types
        if (params_.type != "Shaded" && params_.type != "Frameless" && 
params_.type != "Boxed")
                return getLayout().bgcolor();
+
        if (params_.type == "Shaded") {
                // FIXME: This hardcoded color is a hack!
                if (buffer().params().boxbgcolor == 
lyx::rgbFromHexName("#ff0000"))
                        return getLayout().bgcolor();
-               
+
                ColorCode c = lcolor.getFromLyXName("boxbgcolor");
                if (c == Color_none)
                        return getLayout().bgcolor();
                return c;
-       } else {
-               if (params_.backgroundcolor == "none")
-                       return getLayout().bgcolor();
-               ColorCode boxbackground = 
lcolor.getFromLaTeXName(params_.backgroundcolor);
-               return boxbackground;
        }
+
+       if (params_.backgroundcolor != "none")
+               return lcolor.getFromLaTeXName(params_.backgroundcolor);
+
        return getLayout().bgcolor();
 }
 

Reply via email to