]> git.lyx.org Git - features.git/commitdiff
We should have a default tag for InsetLayout, too, I think. So here it is.
authorRichard Heck <rgheck@comcast.net>
Tue, 27 Oct 2009 19:46:47 +0000 (19:46 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 27 Oct 2009 19:46:47 +0000 (19:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31777 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdinsets.inc
src/insets/InsetLayout.cpp
src/insets/InsetLayout.h

index 417f0f93558053dd8ccb14777388b92298e5caef..bd384cdfec454b708e88d7c46b487273e6b06a9a 100644 (file)
@@ -327,6 +327,7 @@ InsetLayout URL
          Color               urllabel
          Size                Small
        EndFont
+       HTMLIsBlock           false
 End
 
 InsetLayout OptArg
@@ -340,8 +341,6 @@ End
 
 InsetLayout Info
        Decoration            conglomerate
-       HTMLTag           span
-       HTMLAttr          class='info'
        HTMLStyle
                span.info { font-family: sans-serif; }
        EndHTMLStyle
index c8ea237be147fb8a42ae902d4cf1ec480cda2c26..b48a0625f51a7846f1e9472b5a07053f5b913a93 100644 (file)
@@ -351,6 +351,14 @@ InsetLayout::InsetLyXType translateLyXType(std::string const & str)
 }
 
 
+string const & InsetLayout::htmltag() const
+{
+       if (htmltag_.empty())
+               htmltag_ = "span";
+       return htmltag_; 
+}
+
+
 string const & InsetLayout::htmlattr() const
 {
        if (htmlattr_.empty())
@@ -393,13 +401,11 @@ void InsetLayout::makeDefaultCSS() const
 {
        if (!htmldefaultstyle_.empty()) 
                return;
-       if (!htmltag_.empty()) {
-               docstring const mainfontCSS = font_.asCSS();
-               if (!mainfontCSS.empty())
-                       htmldefaultstyle_ = 
-                                       from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
-                                       mainfontCSS + from_ascii("\n}\n");
-       }
+       docstring const mainfontCSS = font_.asCSS();
+       if (!mainfontCSS.empty())
+               htmldefaultstyle_ = 
+                               from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
+                               mainfontCSS + from_ascii("\n}\n");
        /* 
        At present, we do not have default tags, etc, for the label.
        if (labelfont_ == font_)
@@ -407,20 +413,21 @@ void InsetLayout::makeDefaultCSS() const
        docstring const labelfontCSS = labelfont_.asCSS();
        if (!labelfontCSS.empty())
                htmldefaultstyle_ +=
-.                              from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
-                               labelfontCSS + from_ascii("\n}\n");
+                       from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
+                       labelfontCSS + from_ascii("\n}\n");
        */
 }
 
+
 docstring InsetLayout::htmlstyle() const 
 { 
        if (!htmlstyle_.empty() && !htmlforcecss_)
                return htmlstyle_;
-       if (htmldefaultstyle_.empty()) 
+       if (htmldefaultstyle_.empty())
                makeDefaultCSS();
        docstring retval = htmldefaultstyle_;
        if (!htmlstyle_.empty())
-               retval += '\n' + htmlstyle_;
+               retval += '\n' + htmlstyle_ + '\n';
        return retval;
 }
 
index 6edbb331fd13b383f19f491e0c82328cdd99d517..3c790d99e23d6f0742ec8e4bdeea72b40ced9317 100644 (file)
@@ -84,7 +84,7 @@ public:
        ///
        docstring counter() const { return counter_; }
        ///
-       std::string const & htmltag() const { return htmltag_; }
+       std::string const & htmltag() const;
        /// 
        std::string const & htmlattr() const;
        /// 
@@ -160,8 +160,8 @@ private:
        docstring counter_;
        ///
        docstring preamble_;
-       /// The tag enclosing all the material in this inset. Default is none.
-       std::string htmltag_;
+       /// The tag enclosing all the material in this inset. Default is "span".
+       mutable std::string htmltag_;
        /// Additional attributes for inclusion with the start tag. Default (if
        /// a tag is provided) is: class="name".
        mutable std::string htmlattr_;