From fd5d47d182a70de532225715a04b77fe4155aa18 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 16 Mar 2015 14:47:38 +0100 Subject: [PATCH] More switches and whitespace fixes --- src/insets/InsetPhantom.cpp | 45 ++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/insets/InsetPhantom.cpp b/src/insets/InsetPhantom.cpp index deeb09744a..c1da301957 100644 --- a/src/insets/InsetPhantom.cpp +++ b/src/insets/InsetPhantom.cpp @@ -314,21 +314,21 @@ void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const if (runparams.moving_arg) os << "\\protect"; - switch (params_.type) { - case InsetPhantomParams::Phantom: + switch (params_.type) { + case InsetPhantomParams::Phantom: os << "\\phantom{"; - break; - case InsetPhantomParams::HPhantom: + break; + case InsetPhantomParams::HPhantom: os << "\\hphantom{"; - break; - case InsetPhantomParams::VPhantom: + break; + case InsetPhantomParams::VPhantom: os << "\\vphantom{"; - break; - default: - os << "\\phantom{"; - break; - } - InsetCollapsable::latex(os, runparams); + break; + default: + os << "\\phantom{"; + break; + } + InsetCollapsable::latex(os, runparams); os << "}"; } @@ -336,12 +336,16 @@ void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const int InsetPhantom::plaintext(odocstringstream & os, OutputParams const & runparams, size_t max_length) const { - if (params_.type == InsetPhantomParams::Phantom) + switch (params_.type) { + case InsetPhantomParams::Phantom: os << '[' << buffer().B_("phantom") << ":"; - else if (params_.type == InsetPhantomParams::HPhantom) + case InsetPhantomParams::HPhantom: os << '[' << buffer().B_("hphantom") << ":"; - else if (params_.type == InsetPhantomParams::VPhantom) + case InsetPhantomParams::VPhantom: os << '[' << buffer().B_("vphantom") << ":"; + default: + os << '[' << buffer().B_("phantom") << ":"; + } InsetCollapsable::plaintext(os, runparams, max_length); os << "]"; @@ -352,12 +356,13 @@ int InsetPhantom::plaintext(odocstringstream & os, int InsetPhantom::docbook(odocstream & os, OutputParams const & runparams) const { string cmdname; - if (params_.type == InsetPhantomParams::Phantom) - cmdname = "phantom"; - else if (params_.type == InsetPhantomParams::HPhantom) - cmdname = "phantom"; - else if (params_.type == InsetPhantomParams::VPhantom) + switch (params_.type) { + case InsetPhantomParams::Phantom: + case InsetPhantomParams::HPhantom: + case InsetPhantomParams::VPhantom: + default: cmdname = "phantom"; + } os << "<" + cmdname + ">"; int const i = InsetCollapsable::docbook(os, runparams); os << ""; -- 2.39.2