+2001-12-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * undo_funcs.C (textHandleUndo): undo undo leak fix below, as per
+ Juergen's request
2001-12-13 André Pönitz <poenitz@gmx.net>
2001-12-13 André Pönitz <poenitz@gmx.net>
+2001-12-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * FormToc.C: fix crash when no entries, and
+ update types properly
+
2001-12-11 Ben Stanley <bds02@uow.edu.au>
* Menubar_pimpl.C: Fixed a crashing bug when document has more
2001-12-11 Ben Stanley <bds02@uow.edu.au>
* Menubar_pimpl.C: Fixed a crashing bug when document has more
-ButtonPolicy::SMInput FormToc::input(FL_OBJECT *, long)
+ButtonPolicy::SMInput FormToc::input(FL_OBJECT * ob, long)
+ if (ob != dialog_->choice_toc_type) {
+ updateType();
+ }
+
updateContents();
unsigned int const choice = fl_get_browser( dialog_->browser_toc );
updateContents();
unsigned int const choice = fl_get_browser( dialog_->browser_toc );
// Update the choice list from scratch
fl_clear_choice(dialog_->choice_toc_type);
string const choice = getStringFromVector(controller().getTypes(), "|");
// Update the choice list from scratch
fl_clear_choice(dialog_->choice_toc_type);
string const choice = getStringFromVector(controller().getTypes(), "|");
+ lyxerr << "choice " << choice << endl;
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
// And select the correct one
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
// And select the correct one
void FormToc::updateContents()
{
void FormToc::updateContents()
{
- string const type =
- frontStrip(strip(fl_get_choice_text(dialog_->choice_toc_type)));
+ char const * tmp = fl_get_choice_text(dialog_->choice_toc_type);
+
+ if (!tmp) {
+ fl_clear_browser(dialog_->browser_toc);
+ fl_add_browser_line(dialog_->browser_toc,
+ _("*** No Lists ***"));
+ return;
+ }
+
+ string const type = frontStrip(strip(tmp));
Buffer::SingleList const contents = controller().getContents(type);
Buffer::SingleList const contents = controller().getContents(type);
// the text informations.
if (undo->kind == Undo::EDIT) {
tmppar2->setContentsFromPar(tmppar);
// the text informations.
if (undo->kind == Undo::EDIT) {
tmppar2->setContentsFromPar(tmppar);
+ tmppar->clearContents();
tmppar2 = tmppar2->next();
}
tmppar2 = tmppar2->next();
}
if (before)
before->next(tmppar3);
else
if (before)
before->next(tmppar3);
else
-#warning Juergen, why is this needed?? (JMarc)
-// since tmppar3 is not yet inserted in the document, I do not see why
-// the getParFromID which is done by the function below makes sense.
-// OTOH, since you wrote the method just for this instance, I guess you
-// have something in mind
-#if 1
bv->text->ownerParagraph(tmppar3->id(),
tmppar3);
bv->text->ownerParagraph(tmppar3->id(),
tmppar3);
-#else
-// in this case, since getParFromID is not called, the program does
-// not crash on trying to access buffer()->paragraph, which does not
-// exist anymore if we undid the first par f the document. (JMarc)
- bv->text->ownerParagraph(tmppar3);
-#endif
tmppar3->previous(before);
} else {
tmppar3->previous(before);
} else {