]> git.lyx.org Git - features.git/commitdiff
InsetPhantom::latex(): use a switch
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 16 Mar 2015 13:22:03 +0000 (14:22 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 16 Mar 2015 13:22:03 +0000 (14:22 +0100)
src/insets/InsetPhantom.cpp

index c2309bc07003ed16f6118910b4707f1453596537..deeb09744a3297cab3b008e325c4e2fbbf31510e 100644 (file)
@@ -313,13 +313,22 @@ void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const
 {
        if (runparams.moving_arg)
                os << "\\protect";
-       if (params_.type == InsetPhantomParams::Phantom)
+
+    switch (params_.type) {
+    case InsetPhantomParams::Phantom:
                os << "\\phantom{";
-       else if (params_.type == InsetPhantomParams::HPhantom)
+        break;
+    case InsetPhantomParams::HPhantom:
                os << "\\hphantom{";
-       else if (params_.type == InsetPhantomParams::VPhantom)
+        break;
+    case InsetPhantomParams::VPhantom:
                os << "\\vphantom{";
-       InsetCollapsable::latex(os, runparams);
+        break;
+    default:
+        os << "\\phantom{";
+        break;
+    }
+    InsetCollapsable::latex(os, runparams);
        os << "}";
 }