* 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.
*/
#include "InsetMathNest.h"
#include "Buffer.h"
+#include "BufferList.h"
#include "DocIterator.h"
#include "InsetList.h"
#include "Text.h"
#include "support/debug.h"
-
-#include "support/assert.h"
+#include "support/FileName.h"
+#include "support/lassert.h"
#include <sstream>
using namespace std;
+using namespace lyx::support;
namespace lyx {
{
updateData();
- InsetMathSqrt inset; // Hack. Any inset with a cell would do.
+ // Hack. Any inset with a cell would do.
+ static Buffer * buffer = 0;
+ if (!buffer) {
+ buffer = theBufferList().newBuffer(
+ FileName::tempName().absFilename() + "_macrodata.internal");
+ buffer->setUnnamed(true);
+ }
+ static InsetMathSqrt inset;
+
// FIXME UNICODE
asArray(display_.empty() ? definition_ : display_, inset.cell(0));
//lyxerr << "MathData::expand: args: " << args << endl;
//lyxerr << "MathData::expand: ar: " << inset.cell(0) << endl;
- for (DocIterator it = doc_iterator_begin(inset); it; it.forwardChar()) {
+ for (DocIterator it = doc_iterator_begin(buffer, &inset); it; it.forwardChar()) {
if (!it.nextInset())
continue;
if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
}
// output template
- MathMacroTemplate const & tmpl
- = static_cast<MathMacroTemplate const &>(*inset);
- WriteStream wi(os, false, true);
+ MathMacroTemplate const & tmpl =
+ static_cast<MathMacroTemplate const &>(*inset);
+ WriteStream wi(os, false, true, false);
tmpl.write(wi, overwriteRedefinition);
}