From 47e591bbeedffc3860740361242eea2faed4b63d Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 14 Dec 2009 17:15:32 +0000 Subject: [PATCH] Allow use of InsetLayout with InsetCaption. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32533 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetCaption.cpp | 14 +++++++++++++- src/insets/InsetCaption.h | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index 7f96e35433..7eb0889dd7 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -64,6 +64,14 @@ void InsetCaption::write(ostream & os) const } +docstring InsetCaption::name() const +{ + if (type_.empty()) + return from_ascii("Caption"); + return from_utf8("Caption:" + type_); +} + + void InsetCaption::read(Lexer & lex) { #if 0 @@ -256,7 +264,11 @@ docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const { if (rp.html_disable_captions) return docstring(); - xs << StartTag("div", "class='float-caption'"); + string attr = "class='float-caption"; + if (!type_.empty()) + attr += " float-caption-" + type_; + attr += "'"; + xs << StartTag("div", attr); docstring def = getCaptionAsHTML(xs, rp); xs << EndTag("div"); return def; diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index 3686ec2195..81eee6ee12 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -13,6 +13,7 @@ #define INSETCAPTION_H #include "InsetText.h" +#include "support/strfwd.h" namespace lyx { @@ -24,6 +25,8 @@ public: InsetCaption(Buffer *); /// std::string const & type() const { return type_; } + /// + docstring name() const; /// return the mandatory argument (LaTeX format) only int getArgument(odocstream & os, OutputParams const &) const; /// return the optional argument(s) only