* Licence details can be found in the file COPYING.
*
* \author Martin Vermeer
+ * \author Jürgen Spitzmüller
*
* Full author contact details are available in file CREDITS.
*/
#include "InsetList.h"
#include "Layout.h"
#include "Lexer.h"
+#include "OutputParams.h"
#include "ParIterator.h"
#include "support/convert.h"
InsetArgument::InsetArgument(Buffer * buf, string const & name)
- : InsetCollapsable(buf), name_(name), labelstring_(docstring())
+ : InsetCollapsable(buf), name_(name), labelstring_(docstring()),
+ font_(inherit_font), labelfont_(inherit_font), decoration_(string())
{}
support::rsplit(label, striplabel, '|');
labelstring_ = striplabel.empty() ? label: striplabel;
tooltip_ = translateIfPossible((*lait).second.tooltip);
+ font_ = (*lait).second.font;
+ labelfont_ = (*lait).second.labelfont;
+ decoration_ = (*lait).second.decoration;
} else {
labelstring_ = _("Unknown Argument");
tooltip_ = _("Argument not known in this Layout. Will be supressed in the output.");
return "context-argument";
}
+FontInfo InsetArgument::getFont() const
+{
+ if (font_ != inherit_font)
+ return font_;
+ return getLayout().font();
+}
+
+FontInfo InsetArgument::getLabelfont() const
+{
+ if (labelfont_ != inherit_font)
+ return labelfont_;
+ return getLayout().labelfont();
+}
+
+namespace {
+
+InsetLayout::InsetDecoration translateDecoration(std::string const & str)
+{
+ if (support::compare_ascii_no_case(str, "classic") == 0)
+ return InsetLayout::CLASSIC;
+ if (support::compare_ascii_no_case(str, "minimalistic") == 0)
+ return InsetLayout::MINIMALISTIC;
+ if (support::compare_ascii_no_case(str, "conglomerate") == 0)
+ return InsetLayout::CONGLOMERATE;
+ return InsetLayout::DEFAULT;
+}
+
+}// namespace anon
+
+InsetLayout::InsetDecoration InsetArgument::decoration() const
+{
+ InsetLayout::InsetDecoration dec = getLayout().decoration();
+ if (!decoration_.empty())
+ dec = translateDecoration(decoration_);
+ return dec == InsetLayout::DEFAULT ? InsetLayout::CLASSIC : dec;
+}
+
void InsetArgument::latexArgument(otexstream & os,
- OutputParams const & runparams, docstring const & ldelim,
+ OutputParams const & runparams_in, docstring const & ldelim,
docstring const & rdelim) const
{
TexRow texrow;
odocstringstream ss;
otexstream ots(ss, texrow);
+ OutputParams runparams = runparams_in;
+ if (getLayout().isPassThru())
+ runparams.pass_thru = true;
InsetText::latex(ots, runparams);
docstring str = ss.str();
if (ldelim != "{" && support::contains(str, rdelim))