Shouldn't this snippet of LyX's output be changed:
-\begin_inset Greyedout
+\begin_inset Note Greyedout
collapsed false
\begin_layout Standard
some important comment
\end_layout
\end_inset
With the corresponding change in factory.C's readInset
- } else if (tmptok == "Note" || tmptok == "Comment"
- || tmptok == "Greyedout") {
+ } else if (tmptok == "Note") {
As it stands, InsetNote has no idea what its type is because
InsetNoteParams::type is not set on read.
Furthermore, I've been triggering a crash with
"dialog-show-new-inset note"
here:
void QNote::update_contents()
{
QRadioButton * rb = 0;
string type(controller().params().type);
if (type == "Note")
rb = dialog_->noteRB;
else if (type == "Comment")
rb = dialog_->commentRB;
else if (type == "Greyedout")
rb = dialog_->greyedoutRB;
rb->setChecked(true);
}
because controller().params().type is empty and so rb is not set. I
propose changing:
struct InsetNoteParams {
std::string type;
};
to
struct InsetNoteParams {
enum Type {
Note,
Comment,
Greyedout
};
Type type;
};
as this seems much safer to me.
--
Angus