#include <map>
+using namespace lyx::support;
+
using std::ostream;
using std::vector;
using std::map;
dispatch_result InsetCitation::localDispatch(FuncRequest const & cmd)
{
switch (cmd.action) {
- case LFUN_INSET_EDIT:
- // A call to edit indicates that we're no longer loading the
- // buffer but doing some real work.
- setLoadingBuffer(cmd.view()->buffer(), false);
- InsetCommandMailer("citation", *this).showDialog(cmd.view());
- break;
-
- default:
- return UNDISPATCHED;
+ case LFUN_INSET_EDIT:
+ // A call to edit indicates that we're no longer loading the
+ // buffer but doing some real work.
+ setLoadingBuffer(cmd.view()->buffer(), false);
+ InsetCommandMailer("citation", *this).showDialog(cmd.view());
+ return DISPATCHED;
+
+ default:
+ return InsetCommand::localDispatch(cmd);
}
- return DISPATCHED;
}
int InsetCitation::ascii(Buffer const * buffer, ostream & os, int) const
{
- string label;
-
if (cache.params == params() && cache.style == getStyle(buffer))
- label = cache.generated_label;
+ os << cache.generated_label;
else
- label = generateLabel(buffer);
-
- os << label;
+ os << generateLabel(buffer);
return 0;
}