]> git.lyx.org Git - features.git/commitdiff
fix bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section...
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 25 Nov 2005 14:40:34 +0000 (14:40 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 25 Nov 2005 14:40:34 +0000 (14:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10622 a592a061-630c-0410-9148-cb99ea01b6c8

23 files changed:
src/ChangeLog
src/insets/ChangeLog
src/insets/insetbase.h
src/insets/insetcharstyle.C
src/insets/insetcharstyle.h
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetlatexaccent.C
src/insets/insetlatexaccent.h
src/insets/insetquotes.C
src/insets/insetquotes.h
src/insets/insetref.C
src/insets/insetref.h
src/insets/insetspace.C
src/insets/insetspace.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/inseturl.C
src/insets/inseturl.h
src/mathed/ChangeLog
src/mathed/math_hullinset.C
src/mathed/math_hullinset.h
src/paragraph.C

index d04d7171f26231cb0aa56cf4fa663ff18173d40b..00cae0fac5b6085734b2b184b06eb5fca14762fc 100644 (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>
 
        * CutAndPaste.C (numberOfSelections): new helper function.
index 2986041bb1e46c661172de705ebc1218be7092cb..e5da1105962a9159062ffac978895ef793bc3b59 100644 (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>
 
        * insetbibtex.C (latex): copy .bib files to the master buffer temp dir
index 1c0cb2de46ba1a464dc214d1bc1e43a04b90d0e9..6f0a860ba85827add88151ffecbea58cf785a6ed 100644 (file)
@@ -191,6 +191,9 @@ public:
        /// docbook output
        virtual int docbook(Buffer const &, std::ostream & os,
                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:
        - NOT_EDITABLE: the inset's content can not be modified at all 
index 6b2a785fa4cae51a1c6d9b84097ff60803abaf9d..df6efba2dbcfbb2af76576f1600cbae6d22c492e 100644 (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
 {
        // Force inclusion of preamble snippet in layout file
index 079a5c43c6e695c105f097de8eb52fda31ed45f0..84c20cbb588a3b10d3a0afa1f1f4fb8618bad423 100644 (file)
@@ -80,6 +80,9 @@ public:
        ///
        int plaintext(Buffer const &, std::ostream &,
                  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;
 
index 5217f6928904efd906792024837484c358fa8794..75e64fe66933138f07812e542e6922fb1aa420be 100644 (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
 // 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
index 2d232de640185dbe044570a10aa72b8977f8b30b..0733e93486ea60f3271797bf90698991ee2e62bf 100644 (file)
@@ -38,6 +38,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                  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;
 
index f79feb29bd99a97f401e1d44e12d9e3c929258c2..f5a9fac5ec4205695b9827e983f3a935517f100f 100644 (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
 {
        return true;
index 5fd5abee756b3de2a09824c20e72d526cd331502..a44359f77a6e6518cf2f4d40ee5761789c0e9c33 100644 (file)
@@ -57,6 +57,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    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;
        ///
index a5f16116903735157e72750705e38eaa4be22842..7a85306c6d5cff8ca1ce9eb9603e94fcfd3b5630 100644 (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
 {
        bool const use_babel = features.useBabel();
index e67ca8bc8f23990844673c68b49dff4186606dd1..c8e8e8caa14a551a79c330905b856c17c7a2e5df 100644 (file)
@@ -93,6 +93,11 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    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;
        ///
index 0d571611099e82210dde9ca85aaf6cda71b54374..fd7074e5bfc88c51f16e99b6636fc19115042697 100644 (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
 {
        if (getCmdName() == "vref" || getCmdName() == "vpageref")
index 0311730dbcc8832404458d0b55cbde168a92ca0a..be19e7bd8713c9e069925afcc2f652f13e37bdc6 100644 (file)
@@ -55,6 +55,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    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;
 protected:
index 1eed8c05cde9ab67278ee73f5beb4a062291efba..0ca675b1bb77a3b2fd9f1e2e373096c1c40d66fb 100644 (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
 {
        return auto_ptr<InsetBase>(new InsetSpace(kind_));
index 2334633ed32259970e0d1159a1b005931438c5b0..0c594c9bda5672b0daf0245ca2e661edfac49f36 100644 (file)
@@ -72,6 +72,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    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; }
        /// We don't need \begin_inset and \end_inset
index 528abb78bbb92a46cd0812290f3d47359ae84f71..c79eeb735df656a7f111f7cffe100a7e6c3c02c8 100644 (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
 {
        return auto_ptr<InsetBase>(new InsetSpecialChar(kind_));
index fabcf8eaa1f0ca012b3e8af647a8da69c4b76a39..bb88fbe9ab35dbee6570b6502b44b28b8db3478e 100644 (file)
@@ -64,6 +64,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    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; }
        /// We don't need \begin_inset and \end_inset
index 0f052738d8a104ec28abe54120f696a70d771b33..4802f14eedd1f979fe2031c3df6ad4663f6603f9 100644 (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
 {
        features.require("url");
index b80e783eca40a4452bb8bf981d404312403fef35..6536be76e06c064f67165d1a0d598625bc2a493f 100644 (file)
@@ -46,6 +46,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    OutputParams const &) const;
+       /// the string that is passed to the TOC
+       virtual int textString(Buffer const &, std::ostream & os,
+               OutputParams const &) const;
 private:
        virtual std::auto_ptr<InsetBase> doClone() const {
                return std::auto_ptr<InsetBase>(new InsetUrl(params()));
index 205ca8a5e22da923cfef3d728707fb9c280ad9e5..c61c48e73a32eacbd534334ae218be1d234942cd 100644 (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>
 
        * command_inset.[Ch] (editXY): implement, since MathNestInset::editXY
index 12417efb4cb3baba887840b887a1778e6878e17d..ed159c05afd66ca6cead4cbbe6a13b25f16b1ecb 100644 (file)
@@ -1473,3 +1473,10 @@ int MathHullInset::docbook(Buffer const & buf, ostream & os,
        ms << ETag(name.c_str());
        return ms.line() + res;
 }
+
+
+int MathHullInset::textString(Buffer const & buf, ostream & os,
+                      OutputParams const & op) const
+{
+       return plaintext(buf, os, op);
+}
index a9d2387ba6ee7009fa20888e165c064035d51fd9..9767f0f8833bcee7e3d34faef703f04dbf4a235e 100644 (file)
@@ -108,6 +108,9 @@ public:
        ///
        int docbook(Buffer const &, std::ostream &,
                    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
        void notifyCursorLeaves(LCursor & cur);
index 4d679f12c2d2394c0269dbad44b2155e98d5f423..6588be1934a6281c954aae2aefbcceb556008241 100644 (file)
@@ -1598,7 +1598,7 @@ string const Paragraph::asString(Buffer const & buffer,
                if (IsPrintable(c))
                        os << c;
                else if (c == META_INSET)
-                       getInset(i)->plaintext(buffer, os, runparams);
+                       getInset(i)->textString(buffer, os, runparams);
        }
 
        return os.str();