]> git.lyx.org Git - features.git/commitdiff
HTML for math spaces.
authorRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 20:47:55 +0000 (20:47 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 20:47:55 +0000 (20:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33986 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathSpace.cpp
src/mathed/InsetMathSpace.h

index bd426008cdab96a9d78ff729a695a5caf4690754..985e93f12784adc0040e311960fdf3df19da5a10 100644 (file)
@@ -207,6 +207,40 @@ void InsetMathSpace::mathmlize(MathStream & ms) const
 }
 
        
+void InsetMathSpace::htmlize(HtmlStream & ms) const
+{
+       SpaceInfo const & si = space_info[space_];
+       switch (si.kind) {
+       case InsetSpaceParams::THIN:
+               ms << from_ascii("&thinsp;");
+               break;
+       case InsetSpaceParams::MEDIUM:
+               ms << from_ascii("&nbsp;");
+               break;
+       case InsetSpaceParams::THICK:
+               ms << from_ascii("&emsp;");
+               break;
+       case InsetSpaceParams::ENSKIP:
+               ms << from_ascii("&ensp;");
+               break;
+       case InsetSpaceParams::QUAD:
+               ms << from_ascii("&emsp;");
+               break;
+       case InsetSpaceParams::QQUAD:
+               ms << from_ascii("&emsp;&emsp;");
+               break;
+       case InsetSpaceParams::CUSTOM: {
+               string l = length_.asHTMLString();
+               ms << MTag("span", "width='" + l + "'") 
+                  << from_ascii("&nbsp;") << ETag("span");
+               break;
+       }
+       default:
+               break;
+       }
+}
+
+       
 void InsetMathSpace::normalize(NormalStream & os) const
 {
        os << "[space " << int(space_) << "] ";
index 381562178ce34703bb51da1b44f94a1ea641b74b..8f633fffa837aae31ec5a9d0ab0261b05a2cac98 100644 (file)
@@ -53,6 +53,8 @@ public:
        ///
        void mathmlize(MathStream & ms) const;
        ///
+       void htmlize(HtmlStream & ms) const;
+       ///
        void write(WriteStream & os) const;
        /// generate something that will be understood by the Dialogs.
        InsetSpaceParams params() const;