From 7a32a8489afcdb60e0e93ed97984a16bf3a87035 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 21 Jan 2010 21:06:29 +0000 Subject: [PATCH] Allow MTag to take attributes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33148 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathStream.cpp | 5 ++++- src/mathed/MathStream.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index 793da37ec5..9c8ebeb2a2 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -315,7 +315,10 @@ MathStream & operator<<(MathStream & ms, MTag const & t) { ++ms.tab(); ms.cr(); - ms.os() << '<' << from_ascii(t.tag_) << '>'; + ms.os() << '<' << from_ascii(t.tag_); + if (!t.attr_.empty()) + ms.os() << " " << from_ascii(t.attr_); + ms << '>'; return ms; } diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h index 99900c3c11..78b77b780a 100644 --- a/src/mathed/MathStream.h +++ b/src/mathed/MathStream.h @@ -229,9 +229,12 @@ private: class MTag { public: /// - MTag(char const * const tag) : tag_(tag) {} + MTag(char const * const tag, std::string attr = "") + : tag_(tag), attr_(attr) {} /// char const * const tag_; + /// + std::string attr_; }; class ETag {