fix bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10622 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2005-11-25 14:40:34 +00:00
parent 5451d46794
commit d9e6e32961
23 changed files with 116 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2005-11-25 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* paragraph.C (asString): use new inset->textString method (fix bug 2089)
2005-11-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org> 2005-11-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* CutAndPaste.C (numberOfSelections): new helper function. * CutAndPaste.C (numberOfSelections): new helper function.

View File

@ -1,3 +1,15 @@
2005-11-25 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* insetbase.h:
* insetcharstyle.[Ch]:
* insetcite.[Ch]:
* insetlatexaccent.[Ch]:
* insetquotes.[Ch]:
* insetref.[Ch]:
* insetspace.[Ch]:
* insetspecialchar.[Ch]:
* inseturl.[Ch]: new method textString (fix bug 2089)
2005-11-18 Georg Baum <Georg.Baum@post.rwth-aachen.de> 2005-11-18 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insetbibtex.C (latex): copy .bib files to the master buffer temp dir * insetbibtex.C (latex): copy .bib files to the master buffer temp dir

View File

@ -191,6 +191,9 @@ public:
/// docbook output /// docbook output
virtual int docbook(Buffer const &, std::ostream & os, virtual int docbook(Buffer const &, std::ostream & os,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream &,
OutputParams const &) const { return 0; };
/** This enum indicates by which means the inset can be modified: /** This enum indicates by which means the inset can be modified:
- NOT_EDITABLE: the inset's content can not be modified at all - NOT_EDITABLE: the inset's content can not be modified at all

View File

@ -316,6 +316,13 @@ int InsetCharStyle::plaintext(Buffer const & buf, ostream & os,
} }
int InsetCharStyle::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
void InsetCharStyle::validate(LaTeXFeatures & features) const void InsetCharStyle::validate(LaTeXFeatures & features) const
{ {
// Force inclusion of preamble snippet in layout file // Force inclusion of preamble snippet in layout file

View File

@ -80,6 +80,9 @@ public:
/// ///
int plaintext(Buffer const &, std::ostream &, int plaintext(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
void validate(LaTeXFeatures &) const; void validate(LaTeXFeatures &) const;

View File

@ -353,6 +353,13 @@ int InsetCitation::docbook(Buffer const &, ostream & os, OutputParams const &) c
} }
int InsetCitation::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
// Have to overwrite the default InsetCommand method in order to check that // Have to overwrite the default InsetCommand method in order to check that
// the \cite command is valid. Eg, the user has natbib enabled, inputs some // the \cite command is valid. Eg, the user has natbib enabled, inputs some
// citations and then changes his mind, turning natbib support off. The output // citations and then changes his mind, turning natbib support off. The output

View File

@ -38,6 +38,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
void validate(LaTeXFeatures &) const; void validate(LaTeXFeatures &) const;

View File

@ -601,6 +601,13 @@ int InsetLatexAccent::docbook(Buffer const &, ostream & os,
} }
int InsetLatexAccent::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
bool InsetLatexAccent::directWrite() const bool InsetLatexAccent::directWrite() const
{ {
return true; return true;

View File

@ -57,6 +57,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
bool directWrite() const; bool directWrite() const;
/// ///

View File

@ -330,6 +330,13 @@ int InsetQuotes::docbook(Buffer const &, ostream & os,
} }
int InsetQuotes::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
void InsetQuotes::validate(LaTeXFeatures & features) const void InsetQuotes::validate(LaTeXFeatures & features) const
{ {
bool const use_babel = features.useBabel(); bool const use_babel = features.useBabel();

View File

@ -93,6 +93,11 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
void validate(LaTeXFeatures &) const; void validate(LaTeXFeatures &) const;
/// ///

View File

@ -127,6 +127,13 @@ int InsetRef::docbook(Buffer const & buf, ostream & os,
} }
int InsetRef::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
void InsetRef::validate(LaTeXFeatures & features) const void InsetRef::validate(LaTeXFeatures & features) const
{ {
if (getCmdName() == "vref" || getCmdName() == "vpageref") if (getCmdName() == "vref" || getCmdName() == "vpageref")

View File

@ -55,6 +55,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
void validate(LaTeXFeatures & features) const; void validate(LaTeXFeatures & features) const;
protected: protected:

View File

@ -254,6 +254,13 @@ int InsetSpace::docbook(Buffer const &, ostream & os,
} }
int InsetSpace::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
auto_ptr<InsetBase> InsetSpace::doClone() const auto_ptr<InsetBase> InsetSpace::doClone() const
{ {
return auto_ptr<InsetBase>(new InsetSpace(kind_)); return auto_ptr<InsetBase>(new InsetSpace(kind_));

View File

@ -72,6 +72,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
InsetBase::Code lyxCode() const { return InsetBase::SPACE_CODE; } InsetBase::Code lyxCode() const { return InsetBase::SPACE_CODE; }
/// We don't need \begin_inset and \end_inset /// We don't need \begin_inset and \end_inset

View File

@ -243,6 +243,13 @@ int InsetSpecialChar::docbook(Buffer const &, ostream & os,
} }
int InsetSpecialChar::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
auto_ptr<InsetBase> InsetSpecialChar::doClone() const auto_ptr<InsetBase> InsetSpecialChar::doClone() const
{ {
return auto_ptr<InsetBase>(new InsetSpecialChar(kind_)); return auto_ptr<InsetBase>(new InsetSpecialChar(kind_));

View File

@ -64,6 +64,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// ///
InsetBase::Code lyxCode() const { return InsetBase::SPECIALCHAR_CODE; } InsetBase::Code lyxCode() const { return InsetBase::SPECIALCHAR_CODE; }
/// We don't need \begin_inset and \end_inset /// We don't need \begin_inset and \end_inset

View File

@ -100,6 +100,13 @@ int InsetUrl::docbook(Buffer const &, ostream & os,
} }
int InsetUrl::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}
void InsetUrl::validate(LaTeXFeatures & features) const void InsetUrl::validate(LaTeXFeatures & features) const
{ {
features.require("url"); features.require("url");

View File

@ -46,6 +46,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
private: private:
virtual std::auto_ptr<InsetBase> doClone() const { virtual std::auto_ptr<InsetBase> doClone() const {
return std::auto_ptr<InsetBase>(new InsetUrl(params())); return std::auto_ptr<InsetBase>(new InsetUrl(params()));

View File

@ -1,3 +1,7 @@
2005-11-25 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* math_hullinset.[Ch]: new method textString (fix bug 2089)
2005-11-15 Georg Baum <Georg.Baum@post.rwth-aachen.de> 2005-11-15 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* command_inset.[Ch] (editXY): implement, since MathNestInset::editXY * command_inset.[Ch] (editXY): implement, since MathNestInset::editXY

View File

@ -1473,3 +1473,10 @@ int MathHullInset::docbook(Buffer const & buf, ostream & os,
ms << ETag(name.c_str()); ms << ETag(name.c_str());
return ms.line() + res; return ms.line() + res;
} }
int MathHullInset::textString(Buffer const & buf, ostream & os,
OutputParams const & op) const
{
return plaintext(buf, os, op);
}

View File

@ -108,6 +108,9 @@ public:
/// ///
int docbook(Buffer const &, std::ostream &, int docbook(Buffer const &, std::ostream &,
OutputParams const &) const; OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, std::ostream & os,
OutputParams const &) const;
/// get notification when the cursor leaves this inset /// get notification when the cursor leaves this inset
void notifyCursorLeaves(LCursor & cur); void notifyCursorLeaves(LCursor & cur);

View File

@ -1598,7 +1598,7 @@ string const Paragraph::asString(Buffer const & buffer,
if (IsPrintable(c)) if (IsPrintable(c))
os << c; os << c;
else if (c == META_INSET) else if (c == META_INSET)
getInset(i)->plaintext(buffer, os, runparams); getInset(i)->textString(buffer, os, runparams);
} }
return os.str(); return os.str();