mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
44cd0fc9a1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7862 a592a061-630c-0410-9148-cb99ea01b6c8
60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
/**
|
|
* \file math_macrotable.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author André Pönitz
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "math_macrotable.h"
|
|
#include "math_macrotemplate.h"
|
|
#include "debug.h"
|
|
|
|
|
|
using std::string;
|
|
using std::endl;
|
|
|
|
|
|
MathMacroTable::table_type MathMacroTable::macro_table;
|
|
|
|
|
|
void MathMacroTable::dump()
|
|
{
|
|
/*
|
|
lyxerr << "\n------------------------------------------" << endl;
|
|
table_type::const_iterator it;
|
|
for (it = macro_table.begin(); it != macro_table.end(); ++it)
|
|
lyxerr << it->first
|
|
<< " [" << it->second->asMacroTemplate()->nargs() << "] : "
|
|
<< it->second->cell(0) << endl;
|
|
lyxerr << "------------------------------------------" << endl;
|
|
*/
|
|
}
|
|
|
|
|
|
MathAtom & MathMacroTable::provide(string const & name)
|
|
{
|
|
table_type::iterator pos = macro_table.find(name);
|
|
if (pos == macro_table.end()) {
|
|
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
|
|
<< name << "' available." << endl;
|
|
}
|
|
return pos->second;
|
|
}
|
|
|
|
|
|
void MathMacroTable::create(MathAtom const & at)
|
|
{
|
|
macro_table[at->asMacroTemplate()->name()] = at;
|
|
}
|
|
|
|
|
|
bool MathMacroTable::has(string const & name)
|
|
{
|
|
return macro_table.find(name) != macro_table.end();
|
|
}
|