#include "FuncRequest.h"
#include "FuncStatus.h"
#include "LaTeXFeatures.h"
-#include "LyXFunc.h"
+#include "LyX.h"
#include "MathData.h"
#include "MathFactory.h"
#include "MathSupport.h"
#include "OutputParams.h"
+#include "ParIterator.h"
#include "sgml.h"
#include "insets/InsetCommand.h"
}
+void InsetMathRef::updateBuffer(ParIterator const & it, UpdateType /*utype*/)
+{
+ if (!buffer_) {
+ LYXERR0("InsetMathRef::updateBuffer: no buffer_!");
+ return;
+ }
+ // register this inset into the buffer reference cache.
+ buffer().references(getTarget()).push_back(make_pair(this, it));
+}
+
+
string const InsetMathRef::createDialogStr(string const & name) const
{
InsetCommandParams icp(REF_CODE, to_ascii(commandname()));
}
+docstring const InsetMathRef::getTarget() const
+{
+ return asString(cell(0));
+}
+
+
+void InsetMathRef::changeTarget(docstring const & target)
+{
+ InsetCommandParams icp(REF_CODE, to_ascii(commandname()));
+ icp["reference"] = target;
+ if (!cell(1).empty())
+ icp["name"] = asString(cell(1));
+ MathData ar;
+ Buffer & buf = buffer();
+ if (createInsetMath_fromDialogStr(
+ from_utf8(InsetCommand::params2string("ref", icp)), ar)) {
+ *this = *ar[0].nucleus()->asRefInset();
+ // FIXME audit setBuffer/updateBuffer calls
+ setBuffer(buf);
+ }
+}
+
+
InsetMathRef::ref_type_info InsetMathRef::types[] = {
{ from_ascii("ref"), from_ascii(N_("Standard[[mathref]]")), from_ascii(N_("Ref: "))},
{ from_ascii("eqref"), from_ascii(N_("Equation")), from_ascii(N_("EqRef: "))},