]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/CommandInset.cpp
Fix formatFPnumber with negative doubles.
[lyx.git] / src / mathed / CommandInset.cpp
index 3ad90d1eb88f49109ce00674f53eb24d82c7a023..0cf041c23ea7e59b2ec9fc62cf30690fca02cda5 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "DispatchResult.h"
-#include "FuncRequest.h"
 
 #include <sstream>
 
@@ -23,8 +22,8 @@ using namespace std;
 namespace lyx {
 
 
-CommandInset::CommandInset(docstring const & name, bool needs_math_mode)
-       : InsetMathNest(2), name_(name), needs_math_mode_(needs_math_mode),
+CommandInset::CommandInset(Buffer * buf, docstring const & name, bool needs_math_mode)
+       : InsetMathNest(buf, 2), name_(name), needs_math_mode_(needs_math_mode),
          set_label_(false)
 {
        lock_ = true;
@@ -65,12 +64,12 @@ void CommandInset::draw(PainterInfo & pi, int x, int y) const
 
 void CommandInset::write(WriteStream & os) const
 {
-       bool brace = ensureMath(os, needs_math_mode_);
-       os << '\\' << name_.c_str();
-       if (cell(1).size())
+       ModeSpecifier specifier(os, currentMode(), lockedMode(), asciiOnly());
+       MathEnsurer ensurer(os, needs_math_mode_);
+       os << '\\' << name_;
+       if (!cell(1).empty())
                os << '[' << cell(1) << ']';
        os << '{' << cell(0) << '}';
-       os.pendingBrace(brace);
 }