small bugfix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8666 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2004-04-18 19:57:58 +00:00
parent 91fdb608a0
commit 7be1d7a717
3 changed files with 19 additions and 17 deletions

View File

@ -15,8 +15,8 @@
#include "math_mathmlstream.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "support/std_sstream.h"
#include "support/std_sstream.h"
using std::string;
using std::auto_ptr;
@ -24,9 +24,7 @@ using std::ostringstream;
CommandInset::CommandInset(string const & name)
: MathNestInset(2),
name_(name),
set_label_(false)
: MathNestInset(2), name_(name), set_label_(false)
{
lock_ = true;
}
@ -45,6 +43,7 @@ void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
button_.update(screenLabel(), true);
}
button_.metrics(mi, dim);
dim_ = dim;
}
@ -66,16 +65,16 @@ void CommandInset::write(WriteStream & os) const
string const CommandInset::screenLabel() const
{
return name_;
return name_;
}
string const CommandInset::createDialogStr(string const & name) const
{
ostringstream data;
data << name << " LatexCommand ";
WriteStream wsdata(data);
write(wsdata);
wsdata << "\n\\end_inset\n\n";
return data.str();
ostringstream os;
os << name << " LatexCommand ";
WriteStream ws(os);
write(ws);
ws << "\n\\end_inset\n\n";
return os.str();
}

View File

@ -37,11 +37,14 @@ public:
virtual std::string const screenLabel() const;
/// generate something that will be understood by the Dialogs.
std::string const createDialogStr(std::string const & name) const;
///
std::string const & commandname() const { return name_; }
private:
///
std::string name_;
///
mutable bool set_label_;
///
mutable RenderButton button_;
};

View File

@ -11,16 +11,16 @@
#include <config.h>
#include "ref_inset.h"
#include "math_data.h"
#include "math_factory.h"
#include "BufferView.h"
#include "LaTeXFeatures.h"
#include "cursor.h"
#include "debug.h"
#include "funcrequest.h"
#include "math_support.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
#include "math_data.h"
#include "math_factory.h"
#include "math_support.h"
#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
@ -69,7 +69,7 @@ void RefInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3) {
lyxerr << "trying to goto ref" << cell(0) << endl;
lyxerr << "trying to goto ref '" << asString(cell(0)) << "'" << endl;
cur.bv().dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
break;
}