]> git.lyx.org Git - lyx.git/commitdiff
use bald pointers in clone()
authorAndré Pönitz <poenitz@gmx.net>
Thu, 30 Aug 2007 18:03:17 +0000 (18:03 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 30 Aug 2007 18:03:17 +0000 (18:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19920 a592a061-630c-0410-9148-cb99ea01b6c8

207 files changed:
src/Paragraph.cpp
src/insets/ExternalTemplate.cpp
src/insets/Inset.cpp
src/insets/Inset.h
src/insets/InsetBibitem.cpp
src/insets/InsetBibitem.h
src/insets/InsetBibtex.cpp
src/insets/InsetBibtex.h
src/insets/InsetBox.cpp
src/insets/InsetBox.h
src/insets/InsetBranch.cpp
src/insets/InsetBranch.h
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h
src/insets/InsetCharStyle.cpp
src/insets/InsetCharStyle.h
src/insets/InsetCitation.cpp
src/insets/InsetCitation.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCommand.cpp
src/insets/InsetERT.cpp
src/insets/InsetERT.h
src/insets/InsetEnvironment.cpp
src/insets/InsetEnvironment.h
src/insets/InsetExternal.cpp
src/insets/InsetExternal.h
src/insets/InsetFloat.cpp
src/insets/InsetFloat.h
src/insets/InsetFloatList.h
src/insets/InsetFoot.cpp
src/insets/InsetFoot.h
src/insets/InsetFootlike.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetGraphics.h
src/insets/InsetGraphicsParams.cpp
src/insets/InsetHFill.cpp
src/insets/InsetHFill.h
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h
src/insets/InsetIndex.cpp
src/insets/InsetIndex.h
src/insets/InsetLabel.cpp
src/insets/InsetLabel.h
src/insets/InsetLine.cpp
src/insets/InsetLine.h
src/insets/InsetListings.cpp
src/insets/InsetListings.h
src/insets/InsetListingsParams.cpp
src/insets/InsetMarginal.cpp
src/insets/InsetMarginal.h
src/insets/InsetNewline.h
src/insets/InsetNomencl.h
src/insets/InsetNote.cpp
src/insets/InsetNote.h
src/insets/InsetOptArg.cpp
src/insets/InsetOptArg.h
src/insets/InsetPagebreak.cpp
src/insets/InsetPagebreak.h
src/insets/InsetQuotes.cpp
src/insets/InsetQuotes.h
src/insets/InsetRef.h
src/insets/InsetSpace.cpp
src/insets/InsetSpace.h
src/insets/InsetSpecialChar.cpp
src/insets/InsetSpecialChar.h
src/insets/InsetTOC.cpp
src/insets/InsetTOC.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.cpp
src/insets/InsetText.h
src/insets/InsetTheorem.cpp
src/insets/InsetTheorem.h
src/insets/InsetUrl.h
src/insets/InsetVSpace.cpp
src/insets/InsetVSpace.h
src/insets/InsetWrap.cpp
src/insets/InsetWrap.h
src/insets/RenderBase.h
src/insets/RenderButton.cpp
src/insets/RenderButton.h
src/insets/RenderGraphic.cpp
src/insets/RenderGraphic.h
src/insets/RenderPreview.cpp
src/insets/RenderPreview.h
src/mathed/CommandInset.cpp
src/mathed/CommandInset.h
src/mathed/InsetFormulaMacro.cpp
src/mathed/InsetFormulaMacro.h
src/mathed/InsetMathAMSArray.cpp
src/mathed/InsetMathAMSArray.h
src/mathed/InsetMathArray.cpp
src/mathed/InsetMathArray.h
src/mathed/InsetMathBig.cpp
src/mathed/InsetMathBig.h
src/mathed/InsetMathBinom.cpp
src/mathed/InsetMathBinom.h
src/mathed/InsetMathBoldSymbol.cpp
src/mathed/InsetMathBoldSymbol.h
src/mathed/InsetMathBox.cpp
src/mathed/InsetMathBox.h
src/mathed/InsetMathBoxed.cpp
src/mathed/InsetMathBoxed.h
src/mathed/InsetMathBrace.cpp
src/mathed/InsetMathBrace.h
src/mathed/InsetMathCases.cpp
src/mathed/InsetMathCases.h
src/mathed/InsetMathChar.cpp
src/mathed/InsetMathChar.h
src/mathed/InsetMathColor.cpp
src/mathed/InsetMathColor.h
src/mathed/InsetMathComment.cpp
src/mathed/InsetMathComment.h
src/mathed/InsetMathDFrac.cpp
src/mathed/InsetMathDFrac.h
src/mathed/InsetMathDecoration.cpp
src/mathed/InsetMathDecoration.h
src/mathed/InsetMathDelim.cpp
src/mathed/InsetMathDelim.h
src/mathed/InsetMathDiff.cpp
src/mathed/InsetMathDiff.h
src/mathed/InsetMathDots.cpp
src/mathed/InsetMathDots.h
src/mathed/InsetMathEnv.cpp
src/mathed/InsetMathEnv.h
src/mathed/InsetMathExFunc.cpp
src/mathed/InsetMathExFunc.h
src/mathed/InsetMathExInt.cpp
src/mathed/InsetMathExInt.h
src/mathed/InsetMathFBox.cpp
src/mathed/InsetMathFBox.h
src/mathed/InsetMathFont.cpp
src/mathed/InsetMathFont.h
src/mathed/InsetMathFontOld.cpp
src/mathed/InsetMathFontOld.h
src/mathed/InsetMathFrac.cpp
src/mathed/InsetMathFrac.h
src/mathed/InsetMathFrameBox.cpp
src/mathed/InsetMathFrameBox.h
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathHull.h
src/mathed/InsetMathKern.cpp
src/mathed/InsetMathKern.h
src/mathed/InsetMathLefteqn.cpp
src/mathed/InsetMathLefteqn.h
src/mathed/InsetMathLim.cpp
src/mathed/InsetMathLim.h
src/mathed/InsetMathMBox.cpp
src/mathed/InsetMathMBox.h
src/mathed/InsetMathMakebox.cpp
src/mathed/InsetMathMakebox.h
src/mathed/InsetMathMatrix.cpp
src/mathed/InsetMathMatrix.h
src/mathed/InsetMathNumber.cpp
src/mathed/InsetMathNumber.h
src/mathed/InsetMathOverset.cpp
src/mathed/InsetMathOverset.h
src/mathed/InsetMathPar.cpp
src/mathed/InsetMathPar.h
src/mathed/InsetMathPhantom.cpp
src/mathed/InsetMathPhantom.h
src/mathed/InsetMathRef.cpp
src/mathed/InsetMathRef.h
src/mathed/InsetMathRoot.cpp
src/mathed/InsetMathRoot.h
src/mathed/InsetMathScript.cpp
src/mathed/InsetMathScript.h
src/mathed/InsetMathSize.cpp
src/mathed/InsetMathSize.h
src/mathed/InsetMathSpace.cpp
src/mathed/InsetMathSpace.h
src/mathed/InsetMathSplit.cpp
src/mathed/InsetMathSplit.h
src/mathed/InsetMathSqrt.cpp
src/mathed/InsetMathSqrt.h
src/mathed/InsetMathStackrel.cpp
src/mathed/InsetMathStackrel.h
src/mathed/InsetMathString.cpp
src/mathed/InsetMathString.h
src/mathed/InsetMathSubstack.cpp
src/mathed/InsetMathSubstack.h
src/mathed/InsetMathSymbol.cpp
src/mathed/InsetMathSymbol.h
src/mathed/InsetMathTFrac.cpp
src/mathed/InsetMathTFrac.h
src/mathed/InsetMathTabular.cpp
src/mathed/InsetMathTabular.h
src/mathed/InsetMathUnderset.cpp
src/mathed/InsetMathUnderset.h
src/mathed/InsetMathUnknown.cpp
src/mathed/InsetMathUnknown.h
src/mathed/InsetMathXArrow.cpp
src/mathed/InsetMathXArrow.h
src/mathed/InsetMathXYArrow.cpp
src/mathed/InsetMathXYArrow.h
src/mathed/InsetMathXYMatrix.cpp
src/mathed/InsetMathXYMatrix.h
src/mathed/MathAtom.cpp
src/mathed/MathExtern.cpp
src/mathed/MathMacro.cpp
src/mathed/MathMacro.h
src/mathed/MathMacroArgument.cpp
src/mathed/MathMacroArgument.h
src/mathed/MathMacroTemplate.cpp
src/mathed/MathMacroTemplate.h

index d27e1ef987106b20ca18c8051d0fa91632fa8cf9..7a56557750b931d0d445913423755c788c3a894e 100644 (file)
@@ -1083,7 +1083,7 @@ Paragraph::Paragraph(Paragraph const & par)
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it)
-               it->inset = it->inset->clone().release();
+               it->inset = it->inset->clone();
 }
 
 
@@ -1097,7 +1097,7 @@ Paragraph & Paragraph::operator=(Paragraph const & par)
                InsetList::iterator it = insetlist.begin();
                InsetList::iterator end = insetlist.end();
                for (; it != end; ++it)
-                       it->inset = it->inset->clone().release();
+                       it->inset = it->inset->clone();
 
                layout_ = par.layout();
                text_ = par.text_;
index d72209afc59afb5b30ae81cd6036acb79e038667..d56f27a627a6f01e7aac08156f01c3f677b7d943 100644 (file)
@@ -565,3 +565,6 @@ void Template::Format::readFormat(Lexer & lex)
 
 } // namespace external
 } // namespace lyx
+
+
+
index 472c00daa2c615bcb64761832a7ae74d4bfe876d..033764b307f055b44b962cf6f0da6fefe664492a 100644 (file)
@@ -123,14 +123,6 @@ Inset::Inset()
 {}
 
 
-std::auto_ptr<Inset> Inset::clone() const
-{
-       std::auto_ptr<Inset> b = doClone();
-       BOOST_ASSERT(typeid(*b) == typeid(*this));
-       return b;
-}
-
-
 Inset::Code Inset::translate(std::string const & name)
 {
        static TranslatorMap const translator = build_translator();
index 850b1b1dc16d7ecfbc6c18e424a427d6e95a9881..03999ec2adbdf0e470ebfe1590f2096713ffa8a2 100644 (file)
@@ -15,8 +15,6 @@
 #ifndef INSETBASE_H
 #define INSETBASE_H
 
-//#include "BiblioInfo.h"
-#include "Changes.h"
 #include "Dimension.h"
 
 #include "support/docstream.h"
@@ -30,24 +28,26 @@ class BiblioInfo;
 class Buffer;
 class BufferParams;
 class BufferView;
-class ParIterator;
-class ParConstIterator;
+class Change;
+class Color_color;
+class Cursor;
 class CursorSlice;
-class InsetIterator;
 class FuncRequest;
 class FuncStatus;
+class InsetIterator;
 class InsetLayout;
 class InsetMath;
 class InsetText;
 class LaTeXFeatures;
-class Color_color;
-class Cursor;
 class Lexer;
-class Text;
+class MathAtom;
 class MetricsInfo;
-class Dimension;
-class PainterInfo;
 class OutputParams;
+class PainterInfo;
+class Paragraph;
+class ParConstIterator;
+class ParIterator;
+class Text;
 class TocList;
 
 
@@ -77,8 +77,6 @@ public:
 
        /// virtual base class destructor
        virtual ~Inset() {}
-       /// replicate ourselves
-       std::auto_ptr<Inset> clone() const;
 
        /// identification as math inset
        virtual InsetMath * asInsetMath() { return 0; }
@@ -499,6 +497,11 @@ public:
 protected:
        Inset();
 
+       /// replicate ourselves
+       friend class Paragraph;
+       friend class MathAtom;
+       virtual Inset * clone() const = 0;
+
        /** The real dispatcher.
         *  Gets normally called from Cursor::dispatch(). Cursor::dispatch()
         *  assumes the common case of 'LFUN handled, need update'.
@@ -514,8 +517,6 @@ protected:
 
        /// Cached dimensions of the inset.
        mutable Dimension dim_;
-private:
-       virtual std::auto_ptr<Inset> doClone() const = 0;
 };
 
 
index b0beb594acd78a32df3b74d7ec54869e081f057e..924b931d82825a9794cf2cc9d0a7cf591fc5fb8f 100644 (file)
 
 namespace lyx {
 
-using support::prefixIs;
-
-using std::max;
-using std::string;
-using std::auto_ptr;
-using std::ostream;
 
 int InsetBibitem::key_counter = 0;
+
+
 docstring const key_prefix = from_ascii("key-");
 
+
 InsetBibitem::InsetBibitem(InsetCommandParams const & p)
        : InsetCommand(p, "bibitem")
 {
@@ -49,11 +46,11 @@ InsetBibitem::InsetBibitem(InsetCommandParams const & p)
 }
 
 
-auto_ptr<Inset> InsetBibitem::doClone() const
+Inset * InsetBibitem::clone() const
 {
-       auto_ptr<InsetBibitem> b(new InsetBibitem(params()));
+       InsetBibitem * b = new InsetBibitem(params());
        b->autolabel_ = autolabel_;
-       return auto_ptr<Inset>(b);
+       return b;
 }
 
 
@@ -85,9 +82,9 @@ void InsetBibitem::read(Buffer const & buf, Lexer & lex)
 {
        InsetCommand::read(buf, lex);
 
-       if (prefixIs(getParam("key"), key_prefix)) {
+       if (support::prefixIs(getParam("key"), key_prefix)) {
                int const key = convert<int>(getParam("key").substr(key_prefix.length()));
-               key_counter = max(key_counter, key);
+               key_counter = std::max(key_counter, key);
        }
 }
 
index d039eb04b050ee9c6f3f18d09dac17245b5ca6db..22da0eaf9c2f61b9bb67d479de2fa638b0e1d45b 100644 (file)
@@ -50,7 +50,7 @@ protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// The label that is set by updateLabels
        docstring autolabel_;
index 020c08afb3eff1d3be03acbd44b3eb1f497f7d06..2d3e05f37379911430b9f4bac92ebf83970e25fd 100644 (file)
@@ -78,9 +78,9 @@ InsetBibtex::InsetBibtex(InsetCommandParams const & p)
 {}
 
 
-std::auto_ptr<Inset> InsetBibtex::doClone() const
+Inset * InsetBibtex::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetBibtex(*this));
+       return new InsetBibtex(*this);
 }
 
 
index a3ce2c6f288b7782c2577344672e09b551ce16e1..4e2b98849f8f3be75eafaad111f28524008a2948 100644 (file)
@@ -51,7 +51,7 @@ public:
 protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
 };
 
index 9d7ebac301273cc4c544ee5c63d8471918dc48ed..893946372701d2fad019c50110c54de28695709c 100644 (file)
@@ -34,7 +34,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
 using std::string;
 using std::istringstream;
 using std::ostream;
@@ -113,9 +112,9 @@ InsetBox::~InsetBox()
 }
 
 
-auto_ptr<Inset> InsetBox::doClone() const
+Inset * InsetBox::clone() const
 {
-       return auto_ptr<Inset>(new InsetBox(*this));
+       return new InsetBox(*this);
 }
 
 
index 79a471215412a715505fd53654837ef8c43c6dbf..7f3ea8465786814c998aa1f3f86b577baf3eb3cc 100644 (file)
@@ -114,7 +114,7 @@ protected:
 private:
        friend class InsetBoxParams;
 
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// used by the constructors
        void init();
index ce05c362c749d4608bdb801e62f530ebc44f0dcf..5174f6c7a0705d641893b24031803efb105853c2 100644 (file)
@@ -31,7 +31,6 @@
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -64,9 +63,9 @@ InsetBranch::~InsetBranch()
 }
 
 
-auto_ptr<Inset> InsetBranch::doClone() const
+Inset * InsetBranch::clone() const
 {
-       return auto_ptr<Inset>(new InsetBranch(*this));
+       return new InsetBranch(*this);
 }
 
 
index 586176b9b6e958d8ef8278d2f6a1c6da5069362e..4ae2f191242df11578a7b0078336405afacb765c 100644 (file)
@@ -92,7 +92,7 @@ protected:
 private:
        friend class InsetBranchParams;
 
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// used by the constructors
        void init();
index fc632a10d21b34458f22741c789441198503f681..3f64b4e3091d87ce384714a1690a733d2b12ec03 100644 (file)
@@ -40,7 +40,6 @@
 #include <sstream>
 
 
-using std::auto_ptr;
 using std::endl;
 using std::string;
 using std::ostream;
@@ -48,7 +47,6 @@ using std::ostream;
 
 namespace lyx {
 
-using support::bformat;
 
 InsetCaption::InsetCaption(InsetCaption const & ic)
        : InsetText(ic), textclass_(ic.textclass_)
@@ -288,6 +286,7 @@ int InsetCaption::getOptArg(Buffer const & buf, odocstream & os,
 
 void InsetCaption::updateLabels(Buffer const & buf, ParIterator const & it)
 {
+       using support::bformat;
        TextClass const & tclass = buf.params().getTextClass();
        Counters & cnts = tclass.counters();
        string const & type = cnts.current_float();
@@ -315,9 +314,9 @@ void InsetCaption::updateLabels(Buffer const & buf, ParIterator const & it)
 }
 
 
-auto_ptr<Inset> InsetCaption::doClone() const
+Inset * InsetCaption::clone() const
 {
-       return auto_ptr<Inset>(new InsetCaption(*this));
+       return new InsetCaption(*this);
 }
 
 
index 9a95c9f378473d501af9a74b7c423150cf582df0..23d0102a6add7c2aeb2d3c1e8072cea423cc9e2c 100644 (file)
@@ -88,7 +88,7 @@ public:
 
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        mutable docstring full_label_;
        ///
index 22af220ef810cad33388fce89204421bcaf4de22..079d872299e85d07855392320456a3bd208f2d10 100644 (file)
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
-using std::istringstream;
-using std::max;
 using std::ostream;
-using std::ostringstream;
-
 
 
 InsetCharStyle::InsetCharStyle(BufferParams const & bp, string const s)
@@ -70,9 +65,9 @@ InsetCharStyle::InsetCharStyle(InsetCharStyle const & in)
 {}
 
 
-auto_ptr<Inset> InsetCharStyle::doClone() const
+Inset * InsetCharStyle::clone() const
 {
-       return auto_ptr<Inset>(new InsetCharStyle(*this));
+       return new InsetCharStyle(*this);
 }
 
 
index ebedf135c5634a4de0acca5d122be0cf971aa041..7364593c8f677bd24a0a0d28568e9a8e9b9ab4fe 100644 (file)
@@ -88,7 +88,7 @@ protected:
 private:
        friend class InsetCharStyleParams;
 
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        ///
        InsetCharStyleParams params_;
index 5a007cf46f666a36ca1c8d6052ddb8798cefce0e..1cd5c8e4b0620831b55c690eb9fbb69bbdbe3185 100644 (file)
@@ -33,8 +33,6 @@
 
 namespace lyx {
 
-using support::ascii_lowercase;
-using support::contains;
 using support::FileName;
 using support::getStringFromVector;
 using support::getVectorFromString;
@@ -45,11 +43,8 @@ using support::split;
 using support::tokenPos;
 
 using std::endl;
-using std::replace;
 using std::string;
-using std::ostream;
 using std::vector;
-using std::map;
 
 namespace fs = boost::filesystem;
 
@@ -371,6 +366,8 @@ docstring const getNatbibLabel(Buffer const & buffer,
 
 docstring const getBasicLabel(docstring const & keyList, docstring const & after)
 {
+       using support::contains;
+
        docstring keys(keyList);
        docstring label;
 
@@ -548,7 +545,7 @@ void InsetCitation::replaceContents(string const & from, string const & to)
 {
        if (tokenPos(getContents(), ',', from) != -1) {
                vector<string> items = getVectorFromString(getContents());
-               replace(items.begin(), items.end(), from, to);
+               std::replace(items.begin(), items.end(), from, to);
                setContents(getStringFromVector(items));
        }
 }
index 2c89a5bd0f0c5148309ffb7d66eaa61f23851a37..873c71c72de7ed8223a539ef20ad9ade21e6e067 100644 (file)
@@ -52,9 +52,9 @@ public:
        void replaceContents(std::string const & from, std::string const & to);
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetCitation(params()));
+               return new InsetCitation(params());
        }
 
        /// This function does the donkey work of creating the pretty label
index 4dcdfc19b7ba5d434c6d9a15ef5e3d70b22c5dca..9d77079bfb2d2fd9f0a5241a7d115d3aff49650c 100644 (file)
 
 namespace lyx {
 
-using graphics::PreviewLoader;
-
 using std::endl;
 using std::string;
-using std::max;
-using std::min;
 using std::ostream;
 
 
@@ -176,6 +172,8 @@ Dimension InsetCollapsable::dimensionCollapsed() const
 
 bool InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       using std::max;
+
        autoOpen_ = mi.base.bv->cursor().isInside(this);
        mi.base.textwidth -= (int) (1.5 * TEXT_TO_INSET_OFFSET);
 
@@ -423,7 +421,7 @@ docstring const InsetCollapsable::getNewLabel(docstring const & l) const
        docstring label;
        pos_type const max_length = 15;
        pos_type const p_siz = paragraphs().begin()->size();
-       pos_type const n = min(max_length, p_siz);
+       pos_type const n = std::min(max_length, p_siz);
        pos_type i = 0;
        pos_type j = 0;
        for (; i < n && j < p_siz; ++j) {
index 61afc712be2cc43de679f63fecafa372b7ef0e2c..c98ea20a872cc2981a9d38548b1f9e527c6f9142 100644 (file)
@@ -29,7 +29,6 @@ namespace lyx {
 
 using std::string;
 using std::istringstream;
-using std::ostream;
 using std::ostringstream;
 
 
index 05c950231f4af281aa2cc03775b4b7d39e652edd..252cefb75ec76efa4468a1301bf682e46d4a708c 100644 (file)
@@ -43,7 +43,6 @@ using support::token;
 using std::endl;
 using std::min;
 
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -74,9 +73,9 @@ InsetERT::InsetERT(InsetERT const & in)
 }
 
 
-auto_ptr<Inset> InsetERT::doClone() const
+Inset * InsetERT::clone() const
 {
-       return auto_ptr<Inset>(new InsetERT(*this));
+       return new InsetERT(*this);
 }
 
 
index ba448b9aa8ebb8ce7ce3cbdab0fba4e69569aae5..ca186e93368fefb5f1f89766b2c0a8897de66449 100644 (file)
@@ -83,7 +83,7 @@ protected:
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        void init();
        ///
index ed28bc65ffeb70ca2db428a789f094974994e316..f7e380d4d5c60c86a9afde496a211038834b90a5 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
 
 InsetEnvironment::InsetEnvironment
                (BufferParams const & bp, docstring const & name)
@@ -40,13 +36,13 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
 {}
 
 
-auto_ptr<Inset> InsetEnvironment::doClone() const
+Inset * InsetEnvironment::clone() const
 {
-       return auto_ptr<Inset>(new InsetEnvironment(*this));
+       return new InsetEnvironment(*this);
 }
 
 
-void InsetEnvironment::write(Buffer const & buf, ostream & os) const
+void InsetEnvironment::write(Buffer const & buf, std::ostream & os) const
 {
        os << "Environment " << to_utf8(name()) << "\n";
        InsetText::write(buf, os);
index 55e9bf0a4ecbdcc380a409a15eee426585849c66..b71543f2c5f0c1bb17f2b396bb5966fdafffb792 100644 (file)
@@ -49,7 +49,7 @@ public:
 protected:
        InsetEnvironment(InsetEnvironment const &);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// the layout
        LayoutPtr layout_;
        ///
index 2ac08de09f534b756ea8459107756efa805689ab..9b51d7b23277fe900152e0c403cd0928f6474dc8 100644 (file)
@@ -44,9 +44,7 @@
 
 #include <sstream>
 
-using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -413,9 +411,9 @@ InsetExternal::InsetExternal(InsetExternal const & other)
 {}
 
 
-auto_ptr<Inset> InsetExternal::doClone() const
+Inset * InsetExternal::clone() const
 {
-       return auto_ptr<Inset>(new InsetExternal(*this));
+       return new InsetExternal(*this);
 }
 
 
index 31af0458a18b0e7f40d9b5504126b2bbcea7b82f..3c300e4f3a1760518aae13c1f78bb3b323d10c99 100644 (file)
@@ -153,7 +153,7 @@ protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /** This method is connected to the graphics loader, so we are
         *  informed when the image has been loaded.
index 9a91f0c6cfd8958f8d9c0c5106bf7544b4df7acf..56d57a8de80b505a93282f6d93eb5c3ce2b2ba05 100644 (file)
 
 namespace lyx {
 
-using support::contains;
-
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -267,7 +264,7 @@ void InsetFloat::read(Buffer const & buf, Lexer & lex)
 
 void InsetFloat::validate(LaTeXFeatures & features) const
 {
-       if (contains(params_.placement, 'H')) {
+       if (support::contains(params_.placement, 'H')) {
                features.require("float");
        }
 
@@ -279,9 +276,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<Inset> InsetFloat::doClone() const
+Inset * InsetFloat::clone() const
 {
-       return auto_ptr<Inset>(new InsetFloat(*this));
+       return new InsetFloat(*this);
 }
 
 
index ca18156b77c914c435d130e62f194f1c0cc821cc..841e1d7fc96f0161108839b82fa06490dcd23ec9 100644 (file)
@@ -91,7 +91,7 @@ protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        InsetFloatParams params_;
        ///
index e837889221e679fd9813365107af196148b54039..ec63bdc0c45438192342c7a21afa1f8d8d83ec2c 100644 (file)
@@ -50,9 +50,9 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetFloatList(to_ascii(getParam("type"))));
+               return new InsetFloatList(to_ascii(getParam("type")));
        }
 };
 
index f29c86e3d5a66336f67e5a79cc56913371e1174a..11d4b6e144aa5a9e613cbe6501482779be5e0b80 100644 (file)
@@ -45,9 +45,9 @@ InsetFoot::InsetFoot(InsetFoot const & in)
 {}
 
 
-auto_ptr<Inset> InsetFoot::doClone() const
+Inset * InsetFoot::clone() const
 {
-       return auto_ptr<Inset>(new InsetFoot(*this));
+       return new InsetFoot(*this);
 }
 
 
@@ -74,6 +74,7 @@ void InsetFoot::updateLabels(Buffer const & buf, ParIterator const & it)
        InsetCollapsable::updateLabels(buf, it);
 }
 
+
 int InsetFoot::latex(Buffer const & buf, odocstream & os,
                     OutputParams const & runparams_in) const
 {
index 1c7b74810101c0d3dcaab8c6c08448b31d69b946..0544246ad3a906afbfa023e3ac896e59fee0726b 100644 (file)
@@ -46,7 +46,7 @@ public:
 protected:
        InsetFoot(InsetFoot const &);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index c42ee1dba28856f1c6758800fece9b45ed8e58bf..4bb185d60586dceca678758213f2b59a28e43eb5 100644 (file)
 #include "BufferParams.h"
 #include "MetricsInfo.h"
 
+
 namespace lyx {
 
+
 InsetFootlike::InsetFootlike(BufferParams const & bp)
        : InsetCollapsable(bp)
 {}
index 318bd55708e11437c9bd1dd120b328efa881dfc1..cbfd9ddd56e2ff213fb03711adcdfd5e4a42d7d4 100644 (file)
@@ -112,7 +112,6 @@ using support::unzippedFileName;
 
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -165,9 +164,9 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig)
 }
 
 
-auto_ptr<Inset> InsetGraphics::doClone() const
+Inset * InsetGraphics::clone() const
 {
-       return auto_ptr<Inset>(new InsetGraphics(*this));
+       return new InsetGraphics(*this);
 }
 
 
index f1fcc617da9dfaebb3e346964e1df18b74781c25..454b1a8e08ca4825cabd9135f045d14614942a1d 100644 (file)
@@ -85,7 +85,7 @@ protected:
 private:
        friend class InsetGraphicsMailer;
 
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// Read the inset native format
        void readInsetGraphics(Lexer & lex, std::string const & bufpath);
index 6478228bd5022d91cec49e0a11e6f4460506c1cb..b80e10fbf0d89d46fce21175e1dab095de4221ea 100644 (file)
@@ -289,7 +289,7 @@ graphics::Params InsetGraphicsParams::as_grfxParams() const
                        unsigned int const bb_orig_yb = convert<int>(token(tmp, ' ', 1));
 
                        // new pars.bb values must be >= zero
-                       if  (pars.bb.xl > bb_orig_xl)
+                       if (pars.bb.xl > bb_orig_xl)
                                pars.bb.xl -= bb_orig_xl;
                        else
                                pars.bb.xl = 0;
index 2c071f659fd2de70ade8e3183f408a65815d5620..9369f09735d2a03ce424f697d7bfaf77fba7b6e1 100644 (file)
 
 namespace lyx {
 
-using std::ostream;
-
 
 InsetHFill::InsetHFill()
        : InsetCommand(InsetCommandParams("hfill"), std::string())
 {}
 
 
-std::auto_ptr<Inset> InsetHFill::doClone() const
+Inset * InsetHFill::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetHFill);
+       return new InsetHFill;
 }
 
 
@@ -65,7 +63,7 @@ int InsetHFill::docbook(Buffer const &, odocstream & os,
 }
 
 
-void InsetHFill::write(Buffer const &, ostream & os) const
+void InsetHFill::write(Buffer const &, std::ostream & os) const
 {
        os << "\n\\hfill\n";
 }
index 6461e8a3cff5f795b9eaee6f393276ae66138204..a72b66cf7b2a8c9b625bde8556d754908f27b415 100644 (file)
@@ -42,7 +42,7 @@ public:
        // a line separator)?
        bool isSpace() const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index b693079bf124953303eba69254d93bfee8995b9a..5be47172d4840d686d6315936e4c49262147240b 100644 (file)
@@ -81,7 +81,6 @@ using support::sum;
 
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -279,9 +278,9 @@ void InsetInclude::set(InsetCommandParams const & p, Buffer const & buffer)
 }
 
 
-auto_ptr<Inset> InsetInclude::doClone() const
+Inset * InsetInclude::clone() const
 {
-       return auto_ptr<Inset>(new InsetInclude(*this));
+       return new InsetInclude(*this);
 }
 
 
index 9200fda6afff5292099c69521d99551db7bef944..fe21dba0f5a464dea7682b2ab571c5ed4047928c 100644 (file)
@@ -108,7 +108,7 @@ protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /** Slot receiving a signal that the external file has changed
         *  and the preview should be regenerated.
index 35508a8e9f4d2cc73e822e747958e2fe9d134724..f4088a0518176fb23c83f784577df710b7acd2b4 100644 (file)
@@ -32,11 +32,6 @@ InsetIndex::InsetIndex(InsetCommandParams const & p)
 {}
 
 
-// InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
-//     : InsetCommand(p, false)
-// {}
-
-
 docstring const InsetIndex::getScreenLabel(Buffer const &) const
 {
        return _("Idx");
@@ -65,11 +60,6 @@ InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
 {}
 
 
-// InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
-//     : InsetCommand(p, false)
-// {}
-
-
 docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
 {
        return _("Index");
index cca959a106612e9df34f219f8ed18cade68140ce..7ecd3eda423a0df8df0730e4f60802b4db1d410e 100644 (file)
@@ -36,8 +36,8 @@ public:
        int docbook(Buffer const &, odocstream &,
                    OutputParams const &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetIndex(params()));
+       virtual Inset * clone() const {
+               return new InsetIndex(params());
        }
 };
 
@@ -57,8 +57,8 @@ public:
        ///
        docstring const getScreenLabel(Buffer const &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetPrintIndex(params()));
+       virtual Inset * clone() const {
+               return new InsetPrintIndex(params());
        }
 };
 
index d1d582b7c09f5f4b70850d62ecb2864b14ffebcb..b1adabbf7937a21b0e802a5ef015f7713e919472 100644 (file)
 
 namespace lyx {
 
-using support::escape;
-
-using std::string;
-using std::vector;
-
 
 InsetLabel::InsetLabel(InsetCommandParams const & p)
        : InsetCommand(p, "label")
 {}
 
 
-std::auto_ptr<Inset> InsetLabel::doClone() const
+Inset * InsetLabel::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetLabel(params()));
+       return new InsetLabel(params());
 }
 
 
@@ -83,7 +78,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
 int InsetLabel::latex(Buffer const &, odocstream & os,
                      OutputParams const &) const
 {
-       os << escape(getCommand());
+       os << support::escape(getCommand());
        return 0;
 }
 
index b5df459e1b076361131bfcc83efdafecf6e5d405..53d52ad442ea9eeb0a6b1d9a12a07e8523ee321e 100644 (file)
@@ -38,7 +38,7 @@ public:
 protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index bf90bad2cbd74c7cc9046e0dc05102a22a3e31d1..4ff27b12c9b1d4fae5c3be53f02f140365cd89f1 100644 (file)
@@ -26,7 +26,6 @@ namespace lyx {
 
 using frontend::Painter;
 
-using std::endl;
 using std::ostream;
 
 
index 89802d2a305606676842a3282d93b6e4bacc7861..f6c54c86d17c20e555261bb1391d7fe167be7e7c 100644 (file)
@@ -48,9 +48,9 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetLine);
+               return new InsetLine;
        }
 };
 
index e756d4fb7b5c462890aad16e0fa9709ca1a6d929..5a15bbb54c210fe56f494789e7b370f0493f27c1 100644 (file)
@@ -34,13 +34,13 @@ using support::token;
 using support::contains;
 using support::subst;
 
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
 using std::string;
 
-char const lstinline_delimiters[] = "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
+char const lstinline_delimiters[] =
+       "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
 
 void InsetListings::init()
 {
@@ -69,9 +69,9 @@ InsetListings::InsetListings(InsetListings const & in)
 }
 
 
-auto_ptr<Inset> InsetListings::doClone() const
+Inset * InsetListings::clone() const
 {
-       return auto_ptr<Inset>(new InsetListings(*this));
+       return new InsetListings(*this);
 }
 
 
index 8fb21957d0f26323cec47c860460144f13a6c3ed..ded899fa0ff1110c9b0e97252f4a82f160cf6598 100644 (file)
@@ -67,7 +67,7 @@ protected:
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        void init();
        ///
index ce5042e7a30b4348b7e8cda65369ffa258fc300b..984bab1a601fd8c36911ce3a61fdf01366b89676 100644 (file)
@@ -30,8 +30,7 @@ using std::ostream;
 using std::string;
 using std::exception;
 
-namespace lyx
-{
+namespace lyx {
 
 using support::bformat;
 using support::trim;
index 27e9a0a1a06c48cc85d31d35402786320255ab47..be75e9e671dab0c38cc8b4b65ac527e2d84fdbe6 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
 
 InsetMarginal::InsetMarginal(BufferParams const & bp)
        : InsetFootlike(bp)
@@ -39,9 +35,9 @@ InsetMarginal::InsetMarginal(InsetMarginal const & in)
 {}
 
 
-auto_ptr<Inset> InsetMarginal::doClone() const
+Inset * InsetMarginal::clone() const
 {
-       return auto_ptr<Inset>(new InsetMarginal(*this));
+       new InsetMarginal(*this);
 }
 
 
index e261f7d9f6728a8f52b439f481839d864695176b..40d4e5d4c3ec77af306acc8a1bf5491e7b36b6a7 100644 (file)
@@ -44,7 +44,7 @@ public:
 protected:
        InsetMarginal(InsetMarginal const &);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 54ca6699df5fce9efc2fe0d4bebf370457070451..94f291c9510749094c826b96e6f639c1559a2129 100644 (file)
@@ -44,9 +44,9 @@ public:
        // a line separator)?
        bool isSpace() const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetNewline);
+               return new InsetNewline;
        }
 };
 
index a031188983093780816c43cbac3daa0b2b56adc3..499f5950e3db92860396aa3cbc2e388da35f68c4 100644 (file)
@@ -41,8 +41,8 @@ public:
        ///
        int docbookGlossary(odocstream &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetNomencl(params()));
+       virtual Inset * clone() const {
+               return new InsetNomencl(params());
        }
        /// unique id for this nomenclature entry for docbook export
        docstring nomenclature_entry_id;
@@ -71,8 +71,8 @@ public:
        ///
        docstring const getScreenLabel(Buffer const &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetPrintNomencl(params()));
+       virtual Inset * clone() const {
+               return new InsetPrintNomencl(params());
        }
 };
 
index 99cf71a4918649f5161e1193400973426068b4e5..50382349bdb20fffcdb944bbcec2e41a440a0777 100644 (file)
@@ -40,7 +40,6 @@
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -134,9 +133,9 @@ InsetNote::~InsetNote()
 }
 
 
-auto_ptr<Inset> InsetNote::doClone() const
+Inset * InsetNote::clone() const
 {
-       return auto_ptr<Inset>(new InsetNote(*this));
+       return new InsetNote(*this);
 }
 
 
index e585701993253a727b550c6288d986489af96339..0cb7313305276614e6f2b4880847b0b8b3be5551 100644 (file)
@@ -84,7 +84,7 @@ protected:
 private:
        friend class InsetNoteParams;
 
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// used by the constructors
        void init();
index 30d15d6900d437f757d83c1d6cedd185a7a24fdf..6150bc8bdbc4dfcdd9220a98a83004ad281b422e 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
 
 InsetOptArg::InsetOptArg(BufferParams const & ins)
        : InsetCollapsable(ins)
@@ -43,9 +39,9 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in)
 }
 
 
-auto_ptr<Inset> InsetOptArg::doClone() const
+Inset * InsetOptArg::clone() const
 {
-       return auto_ptr<Inset>(new InsetOptArg(*this));
+       return new InsetOptArg(*this);
 }
 
 
@@ -55,7 +51,7 @@ docstring const InsetOptArg::editMessage() const
 }
 
 
-void InsetOptArg::write(Buffer const & buf, ostream & os) const
+void InsetOptArg::write(Buffer const & buf, std::ostream & os) const
 {
        os << "OptArg" << "\n";
        InsetCollapsable::write(buf, os);
index 2a289120d54aab6c40e343e859688922206f69d8..0e8452f16c2d62271f23a54213e1ac8c58ff813e 100644 (file)
@@ -53,7 +53,7 @@ public:
 protected:
        InsetOptArg(InsetOptArg const &);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index f6d2987eb1fcc3b4eb083db194dff87b1bbca474..e75b08ffa6943f49f6a2e77042813014eddce7b7 100644 (file)
@@ -28,9 +28,6 @@ namespace lyx {
 
 using frontend::Painter;
 
-using std::endl;
-using std::ostream;
-
 
 void InsetPagebreak::read(Buffer const &, Lexer &)
 {
@@ -38,7 +35,7 @@ void InsetPagebreak::read(Buffer const &, Lexer &)
 }
 
 
-void InsetPagebreak::write(Buffer const &, ostream & os) const
+void InsetPagebreak::write(Buffer const &, std::ostream & os) const
 {
        os << "\n" << getCmdName() << '\n';
 }
index 83515a180a5ca18ef49c5d461ed045216fef86c1..d361039d2d463a7488e0c7c9e085bb82d63f22f2 100644 (file)
@@ -51,9 +51,9 @@ public:
        virtual std::string getCmdName() const { return "\\newpage"; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetPagebreak);
+               return new InsetPagebreak;
        }
 };
 
@@ -67,9 +67,9 @@ public:
        std::string getCmdName() const { return "\\clearpage"; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetClearPage);
+               return new InsetClearPage;
        }
 };
 
@@ -83,9 +83,9 @@ public:
        std::string getCmdName() const { return "\\cleardoublepage"; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const
+       virtual Inset * clone() const
        {
-               return std::auto_ptr<Inset>(new InsetClearDoublePage);
+               return new InsetClearDoublePage;
        }
 };
 
index e0083f771edeacb89c7c6cf1666ee9a80924df9d..994d0436ec63d6093be176cb38f3bffe7618adcb 100644 (file)
@@ -34,7 +34,6 @@ using support::prefixIs;
 
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::ostream;
 
 
@@ -384,9 +383,9 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<Inset> InsetQuotes::doClone() const
+Inset * InsetQuotes::clone() const
 {
-       return auto_ptr<Inset>(new InsetQuotes(language_, side_, times_));
+       return new InsetQuotes(language_, side_, times_);
 }
 
 
index 9d6dbc9731db5c8ce134fb6346f40e339373dc6d..82f194d12d8e15106a8594b965b6fc7f198089ce 100644 (file)
@@ -105,7 +105,7 @@ public:
        bool isChar() const { return true; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        ///
        quote_language language_;
index 5b91ceaa122fd62578089bf2f4015d1b4b489d48..2ee6e83c2d30b5a023cb0b71f01946cf5854f3ea 100644 (file)
@@ -63,8 +63,8 @@ protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetRef(*this));
+       virtual Inset * clone() const {
+               return new InsetRef(*this);
        }
        ///
        bool isLatex;
index 168862236bed9f734759b6be9da07870a47cb002..26ab1b370f5888862573665355218a7b3e753371 100644 (file)
@@ -29,7 +29,6 @@ namespace lyx {
 
 using std::string;
 using std::max;
-using std::auto_ptr;
 using std::ostream;
 
 
@@ -235,9 +234,9 @@ int InsetSpace::textString(Buffer const & buf, odocstream & os,
 }
 
 
-auto_ptr<Inset> InsetSpace::doClone() const
+Inset * InsetSpace::clone() const
 {
-       return auto_ptr<Inset>(new InsetSpace(kind_));
+       return new InsetSpace(kind_);
 }
 
 
index e285117b11143faa188d35a6be6afc614a7ba132..8f17dc61663f38d57616ade106afb92e65bff741 100644 (file)
@@ -88,7 +88,7 @@ public:
        // a line separator)?
        bool isSpace() const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// And which kind is this?
        Kind kind_;
index 178034136d3bd5819e5c39d2910608bda1aa0ea0..3d0129e88b8658cb8cee02090c4af5437f6e126f 100644 (file)
@@ -27,7 +27,6 @@
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
 using std::ostream;
 
 
@@ -240,17 +239,16 @@ int InsetSpecialChar::textString(Buffer const & buf, odocstream & os,
 }
 
 
-auto_ptr<Inset> InsetSpecialChar::doClone() const
+Inset * InsetSpecialChar::clone() const
 {
-       return auto_ptr<Inset>(new InsetSpecialChar(kind_));
+       return new InsetSpecialChar(kind_);
 }
 
 
 void InsetSpecialChar::validate(LaTeXFeatures & features) const
 {
-       if (kind_ == MENU_SEPARATOR) {
+       if (kind_ == MENU_SEPARATOR)
                features.require("lyxarrow");
-       }
 }
 
 
index d54e993d10fa30cb35fb57180808f29c04b6ecb6..bd93bce1c3c41e0def76aa41d55c64e1f44e88fa 100644 (file)
@@ -81,7 +81,7 @@ public:
        // should we break lines after this inset?
        bool isLineSeparator() const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        /// And which kind is this?
        Kind kind_;
index 51234af7cd27c2e47c914fa0c0a82c6c7293707c..bc4b6201d70f59720dcdd2edf06f62e411c1a9f4 100644 (file)
@@ -34,9 +34,9 @@ InsetTOC::InsetTOC(InsetCommandParams const & p)
 {}
 
 
-std::auto_ptr<Inset> InsetTOC::doClone() const
+Inset * InsetTOC::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetTOC(*this));
+       return new InsetTOC(*this);
 }
 
 
index c4a6f8d99ff58311d44492edfd20b841b9ed78b7..b020f0b9abd0fc098b0a85012376adde78ad0668 100644 (file)
@@ -38,7 +38,7 @@ public:
        int docbook(Buffer const &, odocstream &,
                    OutputParams const &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 6aed3dd880ab65dc9b6bc1612cd565256e5124cf..735de8d4446c97d3cd458c54d2693d61aabdf714 100644 (file)
@@ -59,7 +59,6 @@
 #include <limits>
 
 using std::abs;
-using std::auto_ptr;
 using std::endl;
 using std::getline;
 using std::istream;
@@ -515,20 +514,18 @@ Tabular::cellstruct::cellstruct(cellstruct const & cs)
          rotate(cs.rotate),
          align_special(cs.align_special),
          p_width(cs.p_width),
-         inset(dynamic_cast<InsetText*>(cs.inset->clone().release()))
+         inset(dynamic_cast<InsetText*>(cs.inset->clone()))
 {}
 
 
-Tabular::cellstruct &
-Tabular::cellstruct::operator=(cellstruct cs)
+Tabular::cellstruct & Tabular::cellstruct::operator=(cellstruct cs)
 {
        swap(cs);
        return *this;
 }
 
 
-void
-Tabular::cellstruct::swap(cellstruct & rhs)
+void Tabular::cellstruct::swap(cellstruct & rhs)
 {
        std::swap(cellno, rhs.cellno);
        std::swap(width_of_cell, rhs.width_of_cell);
@@ -2902,9 +2899,9 @@ InsetTabular::~InsetTabular()
 }
 
 
-auto_ptr<Inset> InsetTabular::doClone() const
+Inset * InsetTabular::clone() const
 {
-       return auto_ptr<Inset>(new InsetTabular(*this));
+       return new InsetTabular(*this);
 }
 
 
index 16a469afd71142a7b91b5404de69cc904384761e..dc0edf82ecdab549a28310415c5c22eedcbfaaee 100644 (file)
@@ -777,7 +777,7 @@ protected:
        int scroll() const { return scx_; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        ///
        void drawCellLines(frontend::Painter &, int x, int y, row_type row,
index dafdef6db2902f9f0332258f5bde436705a745a1..64daa1918f9764777d0e132cb2dc021b87fe0115 100644 (file)
@@ -70,7 +70,6 @@ using std::endl;
 using std::for_each;
 using std::max;
 using std::string;
-using std::auto_ptr;
 using std::ostream;
 using std::vector;
 
@@ -130,9 +129,9 @@ void InsetText::clear()
 }
 
 
-auto_ptr<Inset> InsetText::doClone() const
+Inset * InsetText::clone() const
 {
-       return auto_ptr<Inset>(new InsetText(*this));
+       return new InsetText(*this);
 }
 
 
index e99c2d56dab52a0b5343bb1a5306f9643e73462c..275695d028b1c45c380e12240c6412f67f15a0bd 100644 (file)
@@ -30,6 +30,7 @@ class CursorSlice;
 class Dimension;
 class Color_color;
 class ParagraphList;
+class InsetTabular;
 
 
 /**
@@ -135,14 +136,14 @@ public:
 
        // Update the counters of this inset and of its contents
        virtual void updateLabels(Buffer const &, ParIterator const &);
+       ///
+       virtual Inset * clone() const;
 
 protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 
 private:
-       ///
-       virtual std::auto_ptr<Inset> doClone() const;
        ///
        void init();
 
index 7927d2ce3deddeceeb9570ced33a6ac10bf0088f..6ff0e99c9017b20d5161687824f986dfdbff116a 100644 (file)
@@ -58,15 +58,15 @@ void Inset.heorem::write(Buffer const * buf, ostream & os) const
 }
 
 
-auto_ptr<Inset> Inset.heorem::doClone() const
+Inset * InsetTheorem::clone() const
 {
        // FIXME: Is this inset used? If YES this is WRONG!!! (Jug)
-       auto_ptr<Inset.heorem> result(new InsetTheorem);
+       InsetTheorem * result = new InsetTheorem;
        result->setCollapsed(!isOpen());
-
        return result;
 }
 
+
 bool Inset.heorem::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        InsetCollapsable::metrics(mi, dim);
index 0b337323cb6b67913815427b0f5b5c7dc1fecb58..6607d5f7f81a14fa1f1dcefeeaa66c29828a9c15 100644 (file)
@@ -39,7 +39,7 @@ public:
        ///
        virtual docstring const editMessage() const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        ///
        mutable unsigned int center_indent_;
index af991154415e3c4fa24363dbc5aa1686f3ce9dc9..a07d72592fde4fdd0c2ba6340a83ac00575bbc10 100644 (file)
@@ -50,8 +50,8 @@ public:
        virtual int textString(Buffer const &, odocstream &,
                OutputParams const &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetUrl(params()));
+       virtual Inset * clone() const {
+               return new InsetUrl(params());
        }
 };
 
index e4be4510145f9cafd19aea76a64692bb5c99e743..4138a66195fcb7b0859f1341122a754925ae4234 100644 (file)
@@ -57,9 +57,9 @@ InsetVSpace::~InsetVSpace()
 }
 
 
-std::auto_ptr<Inset> InsetVSpace::doClone() const
+Inset * InsetVSpace::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetVSpace(*this));
+       return new InsetVSpace(*this);
 }
 
 
index 97b53f529d511e4e929c8765d56293b49798a0a9..10d853b681a5916182b66c4a670388112f8e250f 100644 (file)
@@ -55,7 +55,7 @@ protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring const label() const;
 
index bdfd1ff50dbe39e7d70f1b57cc4090801d9a723a..8c72fc8571dee743455cec2c6e336601457d8f33 100644 (file)
@@ -37,7 +37,6 @@ namespace lyx {
 
 using std::string;
 using std::endl;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -181,9 +180,9 @@ void InsetWrap::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<Inset> InsetWrap::doClone() const
+Inset * InsetWrap::clone() const
 {
-       return auto_ptr<Inset>(new InsetWrap(*this));
+       return new InsetWrap(*this);
 }
 
 
index 05da26566e7d6ab06fd57eb5d52e7bee70687f7c..f56bbf19878cca2879f8b0a7dda5292602be74fc 100644 (file)
@@ -79,7 +79,7 @@ protected:
        ///
        virtual docstring name() const { return name_; }
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        ///
        InsetWrapParams params_;
index d56a4ffc1216fb3fcfbbcef2fe2b7e8bde1cf264..ce9d753f51ab704ae82e0ed537a9654ad5a150b7 100644 (file)
@@ -32,7 +32,7 @@ class RenderBase {
 public:
        virtual ~RenderBase() {}
 
-       virtual std::auto_ptr<RenderBase> clone(Inset const *) const = 0;
+       virtual RenderBase * clone(Inset const *) const = 0;
 
        /// compute the size of the object returned in dim.
        /// \retval true if the metrics has changed.
index 6a8372f77c64d1b712232da4a6d20dd43fb67cbd..f1ae80043005ca11a6110647fa4bf51169a912a3 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-
 
 RenderButton::RenderButton()
        : editable_(false)
 {}
 
 
-auto_ptr<RenderBase> RenderButton::clone(Inset const *) const
+RenderBase * RenderButton::clone(Inset const *) const
 {
-       return auto_ptr<RenderBase>(new RenderButton(*this));
+       return new RenderButton(*this);
 }
 
 
index 82a474e6c62e496d9499550d5f84766cb26a6ba2..5666f09b32661276a5882a270ea8c2e91f86a7b8 100644 (file)
@@ -25,7 +25,7 @@ class RenderButton : public RenderBase
 public:
        RenderButton();
 
-       std::auto_ptr<RenderBase> clone(Inset const *) const;
+       RenderBase * clone(Inset const *) const;
 
        /// compute the size of the object returned in dim
        virtual bool metrics(MetricsInfo & mi, Dimension & dim) const;
index 3e9232edf23c14320727eb95e300184edc375c10..ec0789957b1737e8d3e83bca262ae7ca75438380 100644 (file)
@@ -35,7 +35,6 @@ namespace lyx {
 using support::onlyFilename;
 
 using std::string;
-using std::auto_ptr;
 
 
 RenderGraphic::RenderGraphic(Inset const * inset)
@@ -56,9 +55,9 @@ RenderGraphic::RenderGraphic(RenderGraphic const & other,
 }
 
 
-auto_ptr<RenderBase> RenderGraphic::clone(Inset const * inset) const
+RenderBase * RenderGraphic::clone(Inset const * inset) const
 {
-       return auto_ptr<RenderBase>(new RenderGraphic(*this, inset));
+       return new RenderGraphic(*this, inset);
 }
 
 
index 49db0e2c1f8d6b227f599b408e50beb7c5129ed0..e27f5f192f25ad46c42a76568ac5532b1406bfc8 100644 (file)
@@ -26,7 +26,7 @@ class RenderGraphic : public RenderBase
 public:
        RenderGraphic(Inset const *);
        RenderGraphic(RenderGraphic const &, Inset const *);
-       std::auto_ptr<RenderBase> clone(Inset const *) const;
+       RenderBase * clone(Inset const *) const;
 
        /// compute the size of the object returned in dim
        bool metrics(MetricsInfo & mi, Dimension & dim) const;
index 4afbe8d5009c15aeec191fd235c18de8d97e3bcb..cba453df10b22872421260e7a02878bc58a68262 100644 (file)
@@ -39,7 +39,6 @@ namespace lyx {
 using support::FileName;
 
 using std::string;
-using std::auto_ptr;
 
 
 LyXRC_PreviewStatus RenderPreview::status()
@@ -69,9 +68,9 @@ RenderPreview::~RenderPreview()
 }
 
 
-auto_ptr<RenderBase> RenderPreview::clone(Inset const * inset) const
+RenderBase * RenderPreview::clone(Inset const * inset) const
 {
-       return auto_ptr<RenderBase>(new RenderPreview(*this, inset));
+       return new RenderPreview(*this, inset);
 }
 
 
index e331ea319b1cc872871acbb16009fe70637f11f2..255075fd356435e46de2bf3c6fe8520d2ac7f0b3 100644 (file)
@@ -50,7 +50,7 @@ public:
        RenderPreview(Inset const *);
        RenderPreview(RenderPreview const &, Inset const *);
        ~RenderPreview();
-       std::auto_ptr<RenderBase> clone(Inset const *) const;
+       RenderBase * clone(Inset const *) const;
 
        /// Compute the size of the object, returned in dim
        bool metrics(MetricsInfo &, Dimension & dim) const;
index a53a23355599044cef561fd85621b32b598cd46d..67b56f506e688f2b707242250ccdb0cfbc145dd3 100644 (file)
@@ -21,7 +21,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
 using std::string;
 
 CommandInset::CommandInset(docstring const & name)
@@ -31,9 +30,9 @@ CommandInset::CommandInset(docstring const & name)
 }
 
 
-auto_ptr<Inset> CommandInset::doClone() const
+Inset * CommandInset::clone() const
 {
-       return auto_ptr<Inset>(new CommandInset(*this));
+       return new CommandInset(*this);
 }
 
 
index 28d46bce94736b0c7985d5981a3ae189706217b3..75b6f887b2b99c894523948c0b2eb32b1e6fadea 100644 (file)
@@ -44,7 +44,7 @@ public:
        bool isActive() const { return false; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 
        ///
        docstring name_;
index c0148fcac2bce8fb5c0310800444a611328cc05b..0f3661c1596c251608c0101f7db3680fda876e5b 100644 (file)
@@ -31,7 +31,6 @@
 #include <sstream>
 
 using std::string;
-using std::auto_ptr;
 using std::ostream;
 using std::endl;
 
@@ -61,9 +60,9 @@ InsetFormulaMacro::InsetFormulaMacro(string const & s)
 }
 
 
-auto_ptr<Inset> InsetFormulaMacro::clone() const
+Inset * InsetFormulaMacro::clone() const
 {
-       return auto_ptr<Inset>(new InsetFormulaMacro(*this));
+       return new InsetFormulaMacro(*this);
 }
 
 
index db33b839dc81d959ae27eb06b02abc5ea814c31f..dc98225bce0bdc676afb33c0edb6456235ee8b59 100644 (file)
@@ -53,8 +53,6 @@ public:
        int docbook(Buffer const &, odocstream &,
                    OutputParams const &) const;
 
-       ///
-       std::auto_ptr<Inset> clone() const;
        ///
        Inset::Code lyxCode() const { return MATHMACRO_CODE; }
        ///
@@ -70,6 +68,8 @@ private:
        docstring prefix() const;
        ///
        docstring name_;
+       ///
+       Inset * clone() const;
 };
 
 
index d74ed1db30926034674045c3738d94b5bb164a7e..39ea68881e366b72bb8b95389b47397004fa89b1 100644 (file)
@@ -24,7 +24,6 @@
 #include "support/lstrings.h"
 #include "support/std_ostream.h"
 
-using std::auto_ptr;
 
 namespace lyx {
 
@@ -41,9 +40,9 @@ InsetMathAMSArray::InsetMathAMSArray(docstring const & name)
 {}
 
 
-auto_ptr<Inset> InsetMathAMSArray::doClone() const
+Inset * InsetMathAMSArray::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathAMSArray(*this));
+       return new InsetMathAMSArray(*this);
 }
 
 
index c4e59b4ff6585155c3d98340385dc07736f71f32..2d57a2fd721542783764b19a7765adc2cffda4bf 100644 (file)
@@ -45,7 +45,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        char const * name_left() const;
        ///
index 544d6a47d1846dc64fa600129477e2caffd70f04..ba85d8d55a3e78d544340cd0c63fafa7159f5fff 100644 (file)
@@ -25,7 +25,6 @@
 namespace lyx {
 
 using std::getline;
-using std::auto_ptr;
 using std::istringstream;
 using std::istream_iterator;
 using std::vector;
@@ -73,9 +72,9 @@ InsetMathArray::InsetMathArray(docstring const & name, docstring const & str)
 }
 
 
-auto_ptr<Inset> InsetMathArray::doClone() const
+Inset * InsetMathArray::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathArray(*this));
+       return new InsetMathArray(*this);
 }
 
 
index 7387b6ae4cd56707879f1b728747123f7e174a94..265f1ffa360970bc77de6fff7d5b78f93a2e8402 100644 (file)
@@ -50,7 +50,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring name_;
 };
index 3c5950b69ced2c96e2a306d2e301df0aba9f4f5b..634d5f3ce9d76a426ecdd8faa47630b26437d975 100644 (file)
@@ -22,8 +22,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
-
 
 InsetMathBig::InsetMathBig(docstring const & name, docstring const & delim)
        : name_(name), delim_(delim)
@@ -36,9 +34,9 @@ docstring InsetMathBig::name() const
 }
 
 
-auto_ptr<Inset> InsetMathBig::doClone() const
+Inset * InsetMathBig::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathBig(*this));
+       return new InsetMathBig(*this);
 }
 
 
index 80a2199f85aabe7a305642fa07234b9715d09d3c..9a47c6580affc33041991121e33c055ba22bd432 100644 (file)
@@ -40,7 +40,7 @@ public:
        static bool isBigInsetDelim(docstring const &);
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        size_type size() const;
        ///
index 7d0aa7b27f4a46d0b28f00ff9246574e37ef3771..e44fa7e444d03583e6d1e507301ed198453a7916 100644 (file)
 
 namespace lyx {
 
-
-using std::max;
-using std::auto_ptr;
-
-
 InsetMathBinom::InsetMathBinom(bool choose)
        : choose_(choose)
 {}
 
 
-auto_ptr<Inset> InsetMathBinom::doClone() const
+Inset * InsetMathBinom::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathBinom(*this));
+       return new InsetMathBinom(*this);
 }
 
 
@@ -52,7 +47,7 @@ bool InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
        cell(1).metrics(mi);
        dim.asc = cell(0).height() + 4 + 5;
        dim.des = cell(1).height() + 4 - 5;
-       dim.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
        metricsMarkers2(dim);
        bool const changed = dim_ != dim;
        dim_ = dim;
index d3dd51a289285ab364649c4b1447d7c583638895..c51ff6cbcd87af527c83ab6640b6d3ec5377deac 100644 (file)
@@ -37,7 +37,7 @@ public:
        ///
        bool extraBraces() const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        int dw() const;
        ///
index 7e2ba27a518ebe256f03325429ab29cb5a9ffe64..675afe50a830d8e4705e941e387ff2a4feb8f26b 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathBoldSymbol::InsetMathBoldSymbol()
        : InsetMathNest(1)
 {}
 
 
-auto_ptr<Inset> InsetMathBoldSymbol::doClone() const
+Inset * InsetMathBoldSymbol::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathBoldSymbol(*this));
+       return new InsetMathBoldSymbol(*this);
 }
 
 
index 229f28c9855825e12aa786b78d3fe56b0efaceba..12c2afd2972f4df097e33acbc13e54f418cebdf4 100644 (file)
@@ -38,7 +38,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 0872973dbfc2bae6748e0a0315f5abd19c85af2f..2ae756a520913b6214d71f6f1089c4df9fc6876e 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathBox::InsetMathBox(docstring const & name)
        : InsetMathNest(1), name_(name)
 {}
 
 
-auto_ptr<Inset> InsetMathBox::doClone() const
+Inset * InsetMathBox::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathBox(*this));
+       return new InsetMathBox(*this);
 }
 
 
index b217dc57fa288778d1ad8c64b783082510cf0181..89774c457a4fe5f01983becee733bd75839e162e 100644 (file)
@@ -42,7 +42,7 @@ public:
        void infoize(odocstream & os) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring name_;
 };
index 60835be301dd7da6800eae1424fc9ad6108e1ee9..415738dcf28e2d0a03eba67023e959b61f21eb86 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathBoxed::InsetMathBoxed()
        : InsetMathNest(1)
 {}
 
 
-auto_ptr<Inset> InsetMathBoxed::doClone() const
+Inset * InsetMathBoxed::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathBoxed(*this));
+       return new InsetMathBoxed(*this);
 }
 
 
index 078a32a8774707abeaa390d8d116e489fe9c3e39..fab1b00032c11ddedb0e0a91da65c7cf551efad1 100644 (file)
@@ -36,7 +36,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 3f88fc52edb94ccfdf2dbfc13bbb6aba5985cd5d..d74136b4844e5d4f75ec6ff03b7e1ed5617674f3 100644 (file)
 
 namespace lyx {
 
-using std::max;
-using std::auto_ptr;
-
-
 InsetMathBrace::InsetMathBrace()
        : InsetMathNest(1)
 {}
@@ -39,9 +35,9 @@ InsetMathBrace::InsetMathBrace(MathData const & ar)
 }
 
 
-auto_ptr<Inset> InsetMathBrace::doClone() const
+Inset * InsetMathBrace::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathBrace(*this));
+       return new InsetMathBrace(*this);
 }
 
 
@@ -49,8 +45,8 @@ bool InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        cell(0).metrics(mi);
        Dimension t = theFontMetrics(mi.base.font).dimension('{');
-       dim.asc = max(cell(0).ascent(), t.asc);
-       dim.des = max(cell(0).descent(), t.des);
+       dim.asc = std::max(cell(0).ascent(), t.asc);
+       dim.des = std::max(cell(0).descent(), t.des);
        dim.wid = cell(0).width() + 2 * t.wid;
        metricsMarkers(dim);
        if (dim_ == dim)
index c4481bae393ef915c809230ee971e5a60defaec2..bcdbd9f428922196b0ccb328fa39087e88488227 100644 (file)
@@ -48,7 +48,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index d044d1291a6a08f0688dc7c230064633f804d338..b098729b78a44d7924915e8bdf6e50df04cbf9f4 100644 (file)
@@ -30,10 +30,6 @@ namespace lyx {
 using support::bformat;
 
 using std::endl;
-using std::max;
-using std::min;
-using std::swap;
-using std::auto_ptr;
 
 
 InsetMathCases::InsetMathCases(row_type n)
@@ -41,9 +37,9 @@ InsetMathCases::InsetMathCases(row_type n)
 {}
 
 
-auto_ptr<Inset> InsetMathCases::doClone() const
+Inset * InsetMathCases::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathCases(*this));
+       return new InsetMathCases(*this);
 }
 
 
index 41616b93e36464f05b09367718f19943c0f30288..7128f19936614ed8c21ad36d7d1e37b31d219155 100644 (file)
@@ -45,7 +45,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 14060f37ac53094d270fa4a8927475f1100eaa25..1b305ac38542477a52fe6898c3a99883c647ffae 100644 (file)
@@ -26,8 +26,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
-
 extern bool has_math_fonts;
 
 namespace {
@@ -52,9 +50,9 @@ InsetMathChar::InsetMathChar(char_type c)
 
 
 
-auto_ptr<Inset> InsetMathChar::doClone() const
+Inset * InsetMathChar::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathChar(*this));
+       return new InsetMathChar(*this);
 }
 
 
index 994185e33800fdf632053e442d547d8337576d0e..a9b1db3b6dcf0bbfe3a6d79ad3b68a1d841128e1 100644 (file)
@@ -50,7 +50,7 @@ public:
        bool isRelOp() const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// the character
        char_type char_;
        /// cached kerning for superscript
index 08959b98b2b8cb407e51b3528eaf9b52800f5ded..ed63d12c19df59160edfe94315891c914813979b 100644 (file)
@@ -21,9 +21,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
-using std::string;
-
 InsetMathColor::InsetMathColor(bool oldstyle, Color_color const & color)
        : InsetMathNest(1), oldstyle_(oldstyle),
          color_(from_utf8(lcolor.getLaTeXName(color)))
@@ -35,9 +32,9 @@ InsetMathColor::InsetMathColor(bool oldstyle, docstring const & color)
 {}
 
 
-auto_ptr<Inset> InsetMathColor::doClone() const
+Inset * InsetMathColor::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathColor(*this));
+       return new InsetMathColor(*this);
 }
 
 
index 01f53298bf3480c08298656c14206ea813a5d307..513f4443bae5b8eb3745b72b11f92f8e7790a0ae 100644 (file)
@@ -44,7 +44,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// width of '[' in current font
        mutable int w_;
        ///
index 57d74a9499f748fee2b5f575c4b3bc2e779e663b..e3c385abb3d88b3815733690df2cd6d46b776e78 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathComment::InsetMathComment()
        : InsetMathNest(1)
 {}
@@ -36,9 +32,9 @@ InsetMathComment::InsetMathComment(docstring const & str)
 }
 
 
-auto_ptr<Inset> InsetMathComment::doClone() const
+Inset * InsetMathComment::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathComment(*this));
+       return new InsetMathComment(*this);
 }
 
 
index f084bb52b76acd465fd738956a19d52e645a7bc9..9f0b494301de12c742c95cdbf2cb98e1c0f55dab 100644 (file)
@@ -48,7 +48,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 } // namespace lyx
index 43abab93c6d39fdb523418abb063f98ae072ac62..857bca5b1f8b7baa59a15c9c959f36bd0762fd22 100644 (file)
 
 namespace lyx {
 
-
-using std::string;
-using std::max;
-using std::auto_ptr;
-
-
 InsetMathDFrac::InsetMathDFrac()
        : InsetMathFrac()
 {}
 
 
-auto_ptr<Inset> InsetMathDFrac::doClone() const
+Inset * InsetMathDFrac::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathDFrac(*this));
+       return new InsetMathDFrac(*this);
 }
 
 
@@ -41,7 +35,7 @@ bool InsetMathDFrac::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        cell(0).metrics(mi);
        cell(1).metrics(mi);
-       dim.wid = max(cell(0).width(), cell(1).width()) + 2;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 2;
        dim.asc = cell(0).height() + 2 + 5;
        dim.des = cell(1).height() + 2 - 5;
        if (dim_ == dim)
index 0ef6791c54f6f3e82b73b870d9e334e6b219a833..25eda012add3d14715d0fe3d0c2dd3c90a5c878e 100644 (file)
@@ -34,7 +34,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 7409a28ca7dae1b0b764b4170b9a65d525efb08d..9879d558ba35a8bb8a9527a0c419c26b3405aa4b 100644 (file)
@@ -33,9 +33,9 @@ InsetMathDecoration::InsetMathDecoration(latexkeys const * key)
 }
 
 
-std::auto_ptr<Inset> InsetMathDecoration::doClone() const
+Inset * InsetMathDecoration::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetMathDecoration(*this));
+       return new InsetMathDecoration(*this);
 }
 
 
index b755a1635f2bcdd5166203be69a7c80337470c10..58131e94723fb66e9ee962b482922f3a6dd912dd 100644 (file)
@@ -41,7 +41,7 @@ public:
        void validate(LaTeXFeatures & features) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        bool upper() const;
        ///
index af612d5e9fbbf8b3e658a7acb1b9b7d726fcd3cf..1fa6ef66b150bc4f12f4c94384e2620c28cdd0b6 100644 (file)
 
 #include "frontends/FontMetrics.h"
 
-namespace lyx {
-
-
-using std::string;
-using std::max;
-using std::auto_ptr;
 
+namespace lyx {
 
 static docstring convertDelimToLatexName(docstring const & name)
 {
@@ -52,9 +47,9 @@ InsetMathDelim::InsetMathDelim
 }
 
 
-auto_ptr<Inset> InsetMathDelim::doClone() const
+Inset * InsetMathDelim::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathDelim(*this));
+       return new InsetMathDelim(*this);
 }
 
 
@@ -74,6 +69,7 @@ void InsetMathDelim::normalize(NormalStream & os) const
 
 bool InsetMathDelim::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       using std::max;
        cell(0).metrics(mi);
        Dimension t = theFontMetrics(mi.base.font).dimension('I');
        int h0 = (t.asc + t.des) / 2;
index abb7db609743899cb9135fd9360f7cbf1eb6d65e..bfe98aef3492994f82fa60cc4b1734225e889310 100644 (file)
@@ -63,7 +63,7 @@ public:
        ///
        docstring right_;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        mutable int dw_;
 };
index 3ec1160bdf5bace93eebad3f8da2caa760e53282..607e43e010e989559e15b41a6b784b4db92c4103 100644 (file)
@@ -18,7 +18,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
 using std::endl;
 
 
@@ -27,9 +26,9 @@ InsetMathDiff::InsetMathDiff()
 {}
 
 
-auto_ptr<Inset> InsetMathDiff::doClone() const
+Inset * InsetMathDiff::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathDiff(*this));
+       return new InsetMathDiff(*this);
 }
 
 
index 8d0785769940fcd0ff5aeda8ee5cd315664d1d45..63d92814ebe39c8f201fc507ddff28dd1b43eb66 100644 (file)
@@ -45,7 +45,7 @@ public:
        ///
        void write(WriteStream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index a8dcec6aa085b42703967cb25b2b26a70a18df5f..e949df8fdddd4947654edf7b7422e33d3c51276d 100644 (file)
 
 #include "frontends/FontMetrics.h"
 
-namespace lyx {
-
-
-using std::string;
-using std::auto_ptr;
 
+namespace lyx {
 
 InsetMathDots::InsetMathDots(latexkeys const * key)
        : key_(key)
 {}
 
 
-auto_ptr<Inset> InsetMathDots::doClone() const
+Inset * InsetMathDots::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathDots(*this));
+       return new InsetMathDots(*this);
 }
 
 
index af3d26bd97bdac7bc579fcc308f28f810b95766b..c519cad57922cdc453036c4c606ac50aa0eb0365 100644 (file)
@@ -36,7 +36,7 @@ protected:
        ///
        latexkeys const * key_;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 } // namespace lyx
index e70b09cb1fb50f6ebffd4bd1ef9c336cae38db75..a0051ade0a003c470cfa0280b37b900bc356836f 100644 (file)
 
 namespace lyx {
 
-
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathEnv::InsetMathEnv(docstring const & name)
        : InsetMathNest(1), name_(name)
 {}
 
 
-auto_ptr<Inset> InsetMathEnv::doClone() const
+Inset * InsetMathEnv::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathEnv(*this));
+       return new InsetMathEnv(*this);
 }
 
 
index 7d73a875d52edd735e93de9b1b462397c506776f..80072dbd97a2d1ec7c3d609671eaddec3f77d374 100644 (file)
@@ -37,7 +37,7 @@ public:
        void infoize(odocstream & os) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// name of that environment
        docstring name_;
 };
index 1b097e928e03b31957f0c793cad6d118c86f1dd0..1ab74b0eddc9b9ae591028618fdd8901d9a73787 100644 (file)
@@ -19,8 +19,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
-using std::vector;
 using std::string;
 
 
@@ -36,9 +34,9 @@ InsetMathExFunc::InsetMathExFunc(docstring const & name, MathData const & ar)
 }
 
 
-auto_ptr<Inset> InsetMathExFunc::doClone() const
+Inset * InsetMathExFunc::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathExFunc(*this));
+       return new InsetMathExFunc(*this);
 }
 
 
index 9c03873cb1bcbda5031305233dc67f147215ab99..ecd5c0a2f286d06639cb34512fb9c19e87bc1675 100644 (file)
@@ -48,7 +48,7 @@ public:
        void octave(OctaveStream &) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring const name_;
 };
index 543daa89e5cafc4d56e96a587f7ca34aaf1b7c08..5c495b83e3df730f9a3a034ac5e4399abdbb537f 100644 (file)
@@ -22,9 +22,6 @@
 
 namespace lyx {
 
-
-using std::string;
-using std::auto_ptr;
 using std::endl;
 
 
@@ -38,9 +35,9 @@ InsetMathExInt::InsetMathExInt(docstring const & name)
 // 3 - upper
 
 
-auto_ptr<Inset> InsetMathExInt::doClone() const
+Inset * InsetMathExInt::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathExInt(*this));
+       return new InsetMathExInt(*this);
 }
 
 
index 5ed5a4ca8790a9a117de745bfbe474d0401a8718..5b5b67211cebbe53af719d60c5a1192d66d53722 100644 (file)
@@ -46,7 +46,7 @@ public:
        ///
        void write(WriteStream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        bool hasScripts() const;
 
index de0e3559f1450ce10d0ad67a1ac623880160e08d..af85c4c0e0ec20f48e54f3f49f63241d3856578a 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathFBox::InsetMathFBox()
        : InsetMathNest(1)
 {}
 
 
-auto_ptr<Inset> InsetMathFBox::doClone() const
+Inset * InsetMathFBox::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathFBox(*this));
+       return new InsetMathFBox(*this);
 }
 
 
index e7273b9608918fd09b155d5709f8eb87b315fba8..cfd26369114645f0bf2600921fbf1f61be6e9432 100644 (file)
@@ -36,7 +36,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index bfeeeff3977120bc30636c6f8b59481b614047aa..a4675bf0d4d08f8703ba78388c01afd952f9966f 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathFont::InsetMathFont(latexkeys const * key)
        : InsetMathNest(1), key_(key)
 {}
 
 
-auto_ptr<Inset> InsetMathFont::doClone() const
+Inset * InsetMathFont::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathFont(*this));
+       return new InsetMathFont(*this);
 }
 
 
index bfa380d19113aadc17490553c6761d25ced400a6..c556d91c4821fde69b61c42df12821af5bd82748 100644 (file)
@@ -49,7 +49,7 @@ public:
        int kerning() const { return cell(0).kerning(); }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// the font to be used on screen
        latexkeys const * key_;
 };
index c68a75c6d13f813468b24a68135e3df3b881c946..fed99c788f8fa9b4b76ce67c8c93b54b2f6b9d2c 100644 (file)
@@ -20,9 +20,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathFontOld::InsetMathFontOld(latexkeys const * key)
        : InsetMathNest(1), key_(key)
 {
@@ -30,9 +27,9 @@ InsetMathFontOld::InsetMathFontOld(latexkeys const * key)
 }
 
 
-auto_ptr<Inset> InsetMathFontOld::doClone() const
+Inset * InsetMathFontOld::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathFontOld(*this));
+       return new InsetMathFontOld(*this);
 }
 
 
index f0d9d79f57a617e68fa54be848d8e5ec51788b56..a2b16bd56e5c80a95d05fd092aa739e93d3d91de 100644 (file)
@@ -47,7 +47,7 @@ public:
        int kerning() const { return cell(0).kerning(); }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// the font to be used on screen
        latexkeys const * key_;
 };
index f1663aea79d50aa6fa9f12c712d85f04fd6dd5ee..b77dc0f5084ccdd03669cb4508cc91fc442dbe6f 100644 (file)
 
 namespace lyx {
 
-
-using std::string;
-using std::max;
-using std::auto_ptr;
-
-
 InsetMathFrac::InsetMathFrac(Kind kind)
        : kind_(kind)
 {}
 
 
-auto_ptr<Inset> InsetMathFrac::doClone() const
+Inset * InsetMathFrac::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathFrac(*this));
+       return new InsetMathFrac(*this);
 }
 
 
@@ -61,7 +55,7 @@ bool InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
                dim.asc = cell(0).height() + 5;
                dim.des = cell(1).height() - 5;
        } else {
-               dim.wid = max(cell(0).width(), cell(1).width()) + 2;
+               dim.wid = std::max(cell(0).width(), cell(1).width()) + 2;
                dim.asc = cell(0).height() + 2 + 5;
                dim.des = cell(1).height() + 2 - 5;
        }
@@ -104,7 +98,7 @@ void InsetMathFrac::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
 {
        cell(0).metricsT(mi, dim);
        cell(1).metricsT(mi, dim);
-       dim.wid = max(cell(0).width(), cell(1).width());
+       dim.wid = std::max(cell(0).width(), cell(1).width());
        dim.asc = cell(0).height() + 1;
        dim.des = cell(1).height();
        //dim = dim_;
index e80389281b4860468c71c512b4f72c0f7f93956d..c03157bdaacbbee2cc674e7fee838d902a2bc428 100644 (file)
@@ -62,7 +62,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 public:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        Kind kind_;
 };
index 2e7508fe30660530082b9542d47421638a3571ce..04c7a04e99e007cbac727817eb8d4b1b28bd5b1a 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathFrameBox::InsetMathFrameBox()
        : InsetMathNest(3)
 {}
 
 
-auto_ptr<Inset> InsetMathFrameBox::doClone() const
+Inset * InsetMathFrameBox::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathFrameBox(*this));
+       return new InsetMathFrameBox(*this);
 }
 
 
index fc38c0bd262f811ade9daae2f64320369b30e25f..b04a99832c7f7d5b85a972fc819094dfc39ca774 100644 (file)
@@ -34,7 +34,7 @@ public:
        ///
        mode_type currentMode() const { return TEXT_MODE; }
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// width of '[' in current font
        mutable int w_;
 };
index 0a62b19cab391f0b270c789c361fa571c3a7d5b6..0454cc388e4783b3e32af69d459a4d5c06f35fc5 100644 (file)
@@ -43,7 +43,6 @@ using std::min;
 using std::swap;
 
 using std::string;
-using std::auto_ptr;
 using std::istream;
 using std::istringstream;
 using std::vector;
@@ -157,9 +156,9 @@ InsetMathGrid::InsetMathGrid(col_type m, row_type n, char v, docstring const & h
 }
 
 
-auto_ptr<Inset> InsetMathGrid::doClone() const
+Inset * InsetMathGrid::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathGrid(*this));
+       return new InsetMathGrid(*this);
 }
 
 
index 6d80ad6a4e4260cb3c540f978a69f2f67d224a68..b600c71904fd9c28b8d2ac9a00ac145eb2c83dbe 100644 (file)
@@ -250,7 +250,7 @@ protected:
        ///
        char v_align_; // add approp. type
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index a4ff0eaada2f61b1ca13e307a891c1b9df2edcc1..17d8c4074b74f7ea11c511c42fea6d8aeacaa516 100644 (file)
@@ -71,10 +71,8 @@ using support::subst;
 using std::endl;
 using std::max;
 using std::ostream;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostringstream;
-using std::pair;
 using std::swap;
 using std::vector;
 
@@ -190,9 +188,9 @@ InsetMathHull::~InsetMathHull()
 {}
 
 
-auto_ptr<Inset> InsetMathHull::doClone() const
+Inset * InsetMathHull::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathHull(*this));
+       new InsetMathHull(*this);
 }
 
 
index 7afdc0eb1b8915f36d4422db96faba3d617d8d2f..83a223e876b6bc1db97335b7e37f905128b0660a 100644 (file)
@@ -133,7 +133,7 @@ protected:
        docstring eolString(row_type row, bool emptyline, bool fragile) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        void setType(HullType type);
        ///
index ab80287be530f416a539b52873b66e416f20a8f8..811a0da3f9e9686fdcb61276873528420ed91b21 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathKern::InsetMathKern()
 {
 }
@@ -40,9 +36,9 @@ InsetMathKern::InsetMathKern(docstring const & s)
 }
 
 
-auto_ptr<Inset> InsetMathKern::doClone() const
+Inset * InsetMathKern::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathKern(*this));
+       return new InsetMathKern(*this);
 }
 
 
index 8a1e3ee04770031e936c2d73925b3b595bbe9244..76b1199e2334d5acd7841d8ae0fc3450d9fc4d29 100644 (file)
@@ -39,7 +39,7 @@ public:
        ///
        void normalize(NormalStream & ns) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// width in em
        Length wid_;
 };
index 3c3dc4d572b1509852a950bfa24df87542029a92..44e4412b81c50e195fb624f3ca4ff79f497d1fb6 100644 (file)
 
 namespace lyx {
 
-
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathLefteqn::InsetMathLefteqn()
        : InsetMathNest(1)
 {}
 
 
-auto_ptr<Inset> InsetMathLefteqn::doClone() const
+Inset * InsetMathLefteqn::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathLefteqn(*this));
+       return new InsetMathLefteqn(*this);
 }
 
 
index 7526113b5f9090b75533ee6678476219b916aeca..ddf1f317af358ca8f7167787cedd69cfc6020332 100644 (file)
@@ -33,7 +33,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index ccde5013e1c411e4bfadc91abe5a9dd230b97ee9..324569d5f368a1db8921d883d4504462c57f80d2 100644 (file)
@@ -18,7 +18,6 @@
 
 namespace lyx {
 
-using std::auto_ptr;
 using std::endl;
 
 
@@ -32,9 +31,9 @@ InsetMathLim::InsetMathLim
 }
 
 
-auto_ptr<Inset> InsetMathLim::doClone() const
+Inset * InsetMathLim::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathLim(*this));
+       return new InsetMathLim(*this);
 }
 
 
index bc95d0e38df834bfb848d99bb57713ff206a4c6f..c2911c6d214846b17a06b3836e1bb6f50164a72e 100644 (file)
@@ -43,7 +43,7 @@ public:
        ///
        void write(WriteStream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 2b73da1015ea58e07ad29de3a422e464c6a76908..670165bae630900ba5497973d54c8e43715c28fc 100644 (file)
 #include "TexRow.h"
 #include "TextMetrics.h"
 
-namespace lyx {
 
-//using support::odocstream;
+namespace lyx {
 
-using std::auto_ptr;
 using std::endl;
 
 
@@ -49,9 +47,9 @@ InsetMathMBox::InsetMathMBox(LayoutPtr const & layout)
 }
 
 
-auto_ptr<Inset> InsetMathMBox::doClone() const
+Inset * InsetMathMBox::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathMBox(*this));
+       return new InsetMathMBox(*this);
 }
 
 
index a64d7d7f4fe5f1048097cf8a09743b2423a38bdf..437edf0cb513cd558f0b48564431dd58ed482474 100644 (file)
@@ -61,7 +61,7 @@ protected:
        mutable Text text_;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index ee863e1d461dd34b93d9c92fca7374459db3f4cc..86edf02bf8be8b053b524e5d7680dcda60b56caf 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathMakebox::InsetMathMakebox()
        : InsetMathNest(3)
 {}
 
 
-auto_ptr<Inset> InsetMathMakebox::doClone() const
+Inset * InsetMathMakebox::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathMakebox(*this));
+       return new InsetMathMakebox(*this);
 }
 
 
index 480f42d70a59f6083f2b5617fb87aab96eae72c4..1d423aa289f94cb3fc1cc3917ad929f9ae6687d7 100644 (file)
@@ -37,7 +37,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// width of '[' in current font
        mutable int w_;
 };
index ef1ac7d8dcf8b3fa06a138ea92fa7f6fd4434d27..778595b5f53177e00d2b7f83eb5d7c766630ebc4 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p)
        : InsetMathGrid(p)
 {}
 
 
-auto_ptr<Inset> InsetMathMatrix::doClone() const
+Inset * InsetMathMatrix::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathMatrix(*this));
+       return new InsetMathMatrix(*this);
 }
 
 
index 0b65634c64d94032405154ffa5b88335f3ea0fdf..efaaa13978b057b019b791f99001134afe6440f1 100644 (file)
@@ -44,7 +44,7 @@ public:
        ///
        void octave(OctaveStream &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 5247af48770d27880e22b1a6d885c571653377cc..57f6ad9253a7d918cc30354cf2fd6084bb87b2b5 100644 (file)
@@ -18,8 +18,6 @@
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
 using std::vector;
 
 InsetMathNumber::InsetMathNumber(docstring const & s)
@@ -27,9 +25,9 @@ InsetMathNumber::InsetMathNumber(docstring const & s)
 {}
 
 
-auto_ptr<Inset> InsetMathNumber::doClone() const
+Inset * InsetMathNumber::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathNumber(*this));
+       return new InsetMathNumber(*this);
 }
 
 
index e9142256a39329e35e7e2516be2c0f44c9d4f77a..040ed4fd408d9ca75dbf68c6fd7eccfda47b294a 100644 (file)
@@ -48,7 +48,7 @@ public:
        void write(WriteStream & os) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// the number as string
        docstring str_;
 };
index b112a56746b0549c5ec0d46be810b4afa9fefb89..6317c60089b304afb4bb09e5bc15ef1526288760 100644 (file)
 
 namespace lyx {
 
-using std::max;
-using std::auto_ptr;
-
-
-auto_ptr<Inset> InsetMathOverset::doClone() const
+Inset * InsetMathOverset::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathOverset(*this));
+       return new InsetMathOverset(*this);
 }
 
 
@@ -35,7 +31,7 @@ bool InsetMathOverset::metrics(MetricsInfo & mi, Dimension & dim) const
        cell(1).metrics(mi);
        FracChanger dummy(mi.base);
        cell(0).metrics(mi);
-       dim.wid = max(cell(0).width(), cell(1).width()) + 4;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 4;
        dim.asc = cell(1).ascent() + cell(0).height() + 4;
        dim.des = cell(1).descent();
        metricsMarkers(dim);
index 078ccf55713971c2e39fadd75624bac044caeb14..77da35369a581f9deb6dbd68ce53103407d78a9c 100644 (file)
@@ -36,7 +36,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index cb63ec84543aacbb5d525ce696d8545479c99b29..2de8a19f55488724c05c36e7b47250c1b18538a7 100644 (file)
 
 namespace lyx {
 
-
-using std::auto_ptr;
-
-
 InsetMathPar::InsetMathPar(MathData const & ar)
 {
        cells_[0] = ar;
@@ -60,9 +56,9 @@ void InsetMathPar::infoize(odocstream & os) const
 }
 
 
-auto_ptr<Inset> InsetMathPar::doClone() const
+Inset * InsetMathPar::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathPar(*this));
+       return new InsetMathPar(*this);
 }
 
 
index 500428c79613fff0a3bee107ccc34ccd20a7a200..e66e2da79fa2a3b36ee5620503643f1ced77b2b8 100644 (file)
@@ -36,7 +36,7 @@ public:
        void write(WriteStream & os) const;
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 4e18c7661e2d41ab8523d20057fcd46109727b46..80b0cd331d1691fc19ecb2f4bfa5e6ab59af2c09 100644 (file)
@@ -29,9 +29,9 @@ InsetMathPhantom::InsetMathPhantom(Kind k)
 {}
 
 
-std::auto_ptr<Inset> InsetMathPhantom::doClone() const
+Inset * InsetMathPhantom::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetMathPhantom(*this));
+       return new InsetMathPhantom(*this);
 }
 
 
index 3b5c6067da423a05d3ff42b3bacfb0364e1fbfed..82ac904281ff108195348ff06ac35156ac223904 100644 (file)
@@ -39,7 +39,7 @@ public:
        void infoize(odocstream & os) const;
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        Kind kind_;
 };
index 2c2bd8517dba1394efc7ed53969ed813fc2bd68c..0193a2ce01d9a4fcfa6051394102e6ab394b833a 100644 (file)
@@ -32,7 +32,6 @@
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
 using std::endl;
 
 
@@ -46,9 +45,9 @@ InsetMathRef::InsetMathRef(docstring const & data)
 {}
 
 
-auto_ptr<Inset> InsetMathRef::doClone() const
+Inset * InsetMathRef::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathRef(*this));
+       return new InsetMathRef(*this);
 }
 
 
index 7683ca587fafc13fe1736d227466fcc9ad4434bd..add7935e80c12e8825b04f9fb5ea19058425c4ec 100644 (file)
@@ -62,7 +62,7 @@ protected:
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 5442fd1be4d1b41e6478c0d3c609eb25e3906045..43974b131d5d79a427bcf4badc60591fa9be0607 100644 (file)
 
 namespace lyx {
 
-using std::max;
-using std::auto_ptr;
-
-
 
 InsetMathRoot::InsetMathRoot()
        : InsetMathNest(2)
 {}
 
 
-auto_ptr<Inset> InsetMathRoot::doClone() const
+Inset * InsetMathRoot::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathRoot(*this));
+       return new InsetMathRoot(*this);
 }
 
 
 bool InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       using std::max;
        InsetMathNest::metrics(mi);
        dim.asc = max(cell(0).ascent()  + 5, cell(1).ascent())  + 2;
        dim.des = max(cell(0).descent() - 5, cell(1).descent()) + 2;
index ee0bea3f147385039ea1ebe267042a87b6dab938..5872849750dbbba6a714bd575b93f58a0fb4419c 100644 (file)
@@ -44,7 +44,7 @@ public:
        ///
        void octave(OctaveStream &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 487c17b4770f1cbd38aece12bc599dd3e9447f16..58082572aeb3664fc52e8c8cc6e0147470b947b6 100644 (file)
@@ -29,11 +29,8 @@ namespace lyx {
 
 using std::string;
 using std::max;
-using std::auto_ptr;
 using std::endl;
 
-
-
 InsetMathScript::InsetMathScript()
        : InsetMathNest(1), cell_1_is_up_(false), limits_(0)
 {}
@@ -52,9 +49,9 @@ InsetMathScript::InsetMathScript(MathAtom const & at, bool up)
 }
 
 
-auto_ptr<Inset> InsetMathScript::doClone() const
+Inset * InsetMathScript::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathScript(*this));
+       return new InsetMathScript(*this);
 }
 
 
index 0d43f95d6e9d6fb760176704e64a6659ffee64c4..822ef8b35e72446a1f1d1f717e9daa600123d5da 100644 (file)
@@ -105,7 +105,7 @@ public:
 protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// returns x offset for main part
        int dxx() const;
        /// returns width of nucleus if any
index c94700b5d4281adc1c6bc633e63b82b0c07da749..bb0b69f0d8c4998ab22a79f11489ec1d4b324b96 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathSize::InsetMathSize(latexkeys const * l)
        : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
 {}
 
 
-auto_ptr<Inset> InsetMathSize::doClone() const
+Inset * InsetMathSize::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathSize(*this));
+       return new InsetMathSize(*this);
 }
 
 
index 0795a2f126ea134a3a3d0d666937ea0129acc453..74961feac5b89efa9be41fbc8315c83debcab0eb 100644 (file)
@@ -40,7 +40,7 @@ public:
        ///
        void infoize(odocstream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        latexkeys const * key_;
        ///
index eab748dfdac6fe62bb56e40d39d459d2026d4f42..1dfe58d0a9779814972c920b6158db222a1bf4fe 100644 (file)
@@ -20,8 +20,6 @@
 #include "frontends/Painter.h"
 
 using std::string;
-using std::auto_ptr;
-
 
 namespace lyx {
 
@@ -75,9 +73,9 @@ InsetMathSpace::InsetMathSpace(docstring const & name)
 }
 
 
-auto_ptr<Inset> InsetMathSpace::doClone() const
+Inset * InsetMathSpace::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathSpace(*this));
+       return new InsetMathSpace(*this);
 }
 
 
index c421bc1a844405d3a6a80bd613fc998c62993dbd..a4f1d1332ad764d39782926a3f2313cf12699250 100644 (file)
@@ -49,7 +49,7 @@ public:
        ///
        void write(WriteStream & os) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        int space_;
 };
index 2b68fc34788fd25c866a6f9497715afae7e2af88..3e5666eb3d46556342c1a007e664ba399d4f156f 100644 (file)
@@ -29,7 +29,6 @@ namespace lyx {
 using support::bformat;
 
 using std::string;
-using std::auto_ptr;
 
 
 InsetMathSplit::InsetMathSplit(docstring const & name, char valign)
@@ -38,9 +37,9 @@ InsetMathSplit::InsetMathSplit(docstring const & name, char valign)
 }
 
 
-auto_ptr<Inset> InsetMathSplit::doClone() const
+Inset * InsetMathSplit::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathSplit(*this));
+       return new InsetMathSplit(*this);
 }
 
 
index 959c013b1dd4f26e01c34561c7cf597f9001e8b3..93672606eb750f7f79c72793b92145eb8fea3e27 100644 (file)
@@ -39,7 +39,7 @@ public:
        char defaultColAlign(col_type);
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring name_;
 };
index 73cb05430609765fcc28cdcb151b20cefbb20d26..b2079e2951c6d3b1bd273cad3e6df167887cd500 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-
-
 InsetMathSqrt::InsetMathSqrt()
        : InsetMathNest(1)
 {}
 
 
-auto_ptr<Inset> InsetMathSqrt::doClone() const
+Inset * InsetMathSqrt::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathSqrt(*this));
+       return new InsetMathSqrt(*this);
 }
 
 
index bd8f46606659ac7e9713b6e222ba89ab9254759e..b712e9a328c07964318aaef530c4e43cb7b2e529 100644 (file)
@@ -46,7 +46,7 @@ public:
        ///
        void mathmlize(MathStream &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index c45ae2c78a53521f4827d6ee2d1cc75c0e487788..c43c88091c77fb4844d112ab13c86ec366a7067a 100644 (file)
 
 namespace lyx {
 
-
-using std::max;
-using std::auto_ptr;
-
-
 InsetMathStackrel::InsetMathStackrel()
 {}
 
 
-auto_ptr<Inset> InsetMathStackrel::doClone() const
+Inset * InsetMathStackrel::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathStackrel(*this));
+       return new InsetMathStackrel(*this);
 }
 
 
@@ -37,7 +32,7 @@ bool InsetMathStackrel::metrics(MetricsInfo & mi, Dimension & dim) const
        cell(1).metrics(mi);
        FracChanger dummy(mi.base);
        cell(0).metrics(mi);
-       dim.wid = max(cell(0).width(), cell(1).width()) + 4;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 4;
        dim.asc = cell(1).ascent() + cell(0).height() + 4;
        dim.des = cell(1).descent();
        metricsMarkers(dim);
index e9537b4580482fa4b6075ff080c5f7239d3dba0e..ca2de72e0b0c0f931529733c0aca30ec1fb053a8 100644 (file)
@@ -37,7 +37,7 @@ public:
        ///
        void normalize(NormalStream &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 3ca3e898b3638dd643a7421b0a15d670e3f803a5..28e0aac7efb425bbfe6081742fcef5e77e6ca119 100644 (file)
 
 namespace lyx {
 
-using std::auto_ptr;
-using std::vector;
-
-
 InsetMathString::InsetMathString(docstring const & s)
        : str_(s)
 {}
 
 
-auto_ptr<Inset> InsetMathString::doClone() const
+Inset * InsetMathString::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathString(*this));
+       return new InsetMathString(*this);
 }
 
 
index ad0a22312ed43351d175062c3e178ccdcdcf3ed8..f8d8771033a867b5b2ed7f2e5139d79fa86b6949 100644 (file)
@@ -50,7 +50,7 @@ public:
        void write(WriteStream & os) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// the string
        docstring str_;
 };
index 0084eac345040fcdff17451da329056d69acc72f..19021f2ce0c9138668e7062cbe8f62dc39c23e5e 100644 (file)
@@ -28,17 +28,15 @@ namespace lyx {
 using support::bformat;
 
 using std::string;
-using std::auto_ptr;
-
 
 InsetMathSubstack::InsetMathSubstack()
        : InsetMathGrid(1, 1)
 {}
 
 
-auto_ptr<Inset> InsetMathSubstack::doClone() const
+Inset * InsetMathSubstack::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathSubstack(*this));
+       return new InsetMathSubstack(*this);
 }
 
 
@@ -68,11 +66,12 @@ bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
 {
        switch (cmd.action) {
        case LFUN_TABULAR_FEATURE: {
-               string const name("substack");
+               string const name = "substack";
                docstring const & s = cmd.argument();
                if (s == "add-vline-left" || s == "add-vline-right") {
                        flag.message(bformat(
-                               from_utf8(N_("Can't add vertical grid lines in '%1$s'")), lyx::from_utf8(name)));
+                               from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
+                               from_utf8(name)));
                        flag.enabled(false);
                        return true;
                }
index f2b9e5c0aa48f0eb8e4505e393d8032c412a418d..e42a4aaa7ef7e328395637ddf0c705b2eb4a3180 100644 (file)
@@ -45,7 +45,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index 16f26169dd3c340bb4c0f5d6b5644bb546c225c1..28d20bad079afaccbedf751a1328d241c23e58a9 100644 (file)
 
 #include "support/textutils.h"
 
-namespace lyx {
-
-using std::string;
-using std::auto_ptr;
 
+namespace lyx {
 
 InsetMathSymbol::InsetMathSymbol(latexkeys const * l)
        : sym_(l), h_(0), scriptable_(false)
@@ -44,9 +41,9 @@ InsetMathSymbol::InsetMathSymbol(docstring const & name)
 {}
 
 
-auto_ptr<Inset> InsetMathSymbol::doClone() const
+Inset * InsetMathSymbol::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathSymbol(*this));
+       return new InsetMathSymbol(*this);
 }
 
 
index 60f4028fb063264d21722472b7b9da4375ec85cf..ad78aed38fbeb62a1b7337183fb89482337f05d3 100644 (file)
@@ -72,7 +72,7 @@ public:
        void infoize2(odocstream & os) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        latexkeys const * sym_;
        ///
index 5a1fd86df8ed9027ccb76acefa874cdf0b0156d3..b9a1b3b4ad145d194f4e45ea084ba3d4b704a7aa 100644 (file)
 
 namespace lyx {
 
-
-using std::string;
-using std::max;
-using std::auto_ptr;
-
-
 InsetMathTFrac::InsetMathTFrac()
        : InsetMathFrac()
 {}
 
 
-auto_ptr<Inset> InsetMathTFrac::doClone() const
+Inset * InsetMathTFrac::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathTFrac(*this));
+       return new InsetMathTFrac(*this);
 }
 
 
@@ -45,7 +39,7 @@ bool InsetMathTFrac::metrics(MetricsInfo & mi, Dimension & dim) const
        StyleChanger dummy(mi.base, LM_ST_SCRIPT);
        cell(0).metrics(mi);
        cell(1).metrics(mi);
-       dim.wid = max(cell(0).width(), cell(1).width()) + 2;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 2;
        dim.asc = cell(0).height() + 2 + 5;
        dim.des = cell(1).height() + 2 - 5;
        if (dim_ == dim)
index 5299b0b11aa741ba5f047b14e29546da15f8e3dc..8bc7433caeb5a65d4d23c5e5b94bb9196008893d 100644 (file)
@@ -34,7 +34,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index f93b2884a3daf2c45255271ac1088fb046170eeb..2e17fb401238fe2604cbb70da412b44be3b3fe43 100644 (file)
 
 namespace lyx {
 
-
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathTabular::InsetMathTabular(docstring const & name, int m, int n)
        : InsetMathGrid(m, n), name_(name)
 {}
@@ -45,9 +40,9 @@ InsetMathTabular::InsetMathTabular(docstring const & name, char valign,
 {}
 
 
-auto_ptr<Inset> InsetMathTabular::doClone() const
+Inset * InsetMathTabular::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathTabular(*this));
+       return new InsetMathTabular(*this);
 }
 
 
index 1d591924a53d23a32d7032a651ba060613580e3d..fc1cdb55be0e37996620c5e407a35b8a8a04dd72 100644 (file)
@@ -47,7 +47,7 @@ public:
        void maple(MapleStream &) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring name_;
 };
index 87392bd4e0b07f5b6c1173b3c169186b1a2eb73f..8a2f4bf02b606973d49a621d9c931814cdda63fd 100644 (file)
 
 namespace lyx {
 
-using std::max;
-using std::auto_ptr;
-
-
-
-auto_ptr<Inset> InsetMathUnderset::doClone() const
+Inset * InsetMathUnderset::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathUnderset(*this));
+       return new InsetMathUnderset(*this);
 }
 
 
@@ -36,7 +31,7 @@ bool InsetMathUnderset::metrics(MetricsInfo & mi, Dimension & dim) const
        cell(1).metrics(mi);
        FracChanger dummy(mi.base);
        cell(0).metrics(mi);
-       dim.wid = max(cell(0).width(), cell(1).width()) + 4;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 4;
        dim.asc = cell(1).ascent();
        dim.des = cell(1).descent() + cell(0).height() + 4;
        metricsMarkers(dim);
index c195eb10b6987e3cf8ddb35f18e15e16dd00922e..0c261e3af688137c0ecdc724363d5a1b1239a81e 100644 (file)
@@ -38,7 +38,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
 };
 
 
index a50ac259ec60d82fc31672692769cdf49b2dfef9..50032bf9b5526319c164bf966fdce808f6bf00e3 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-using std::vector;
-
-
 InsetMathUnknown::InsetMathUnknown(docstring const & nm, bool final, bool black)
        : name_(nm), final_(final), black_(black)
 {}
 
 
-auto_ptr<Inset> InsetMathUnknown::doClone() const
+Inset * InsetMathUnknown::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathUnknown(*this));
+       return new InsetMathUnknown(*this);
 }
 
 
index 9c8a81b19aac141578bdc4fa24223553d1ee0c4e..144ac64a606be7656c0c29bb30f83c4e07a7d610 100644 (file)
@@ -54,7 +54,7 @@ public:
        ///
        int kerning() const { return kerning_; }
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        docstring name_;
        /// are we finished creating the name?
index 02a1e4147b40234f2117f3d43c558bdafd22afb5..97bff1ec760b31ba2856528add01d868e250ffda 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-
 
 InsetMathXArrow::InsetMathXArrow(docstring const & name)
        : InsetMathFracBase(), name_(name)
 {}
 
 
-auto_ptr<Inset> InsetMathXArrow::doClone() const
+Inset * InsetMathXArrow::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathXArrow(*this));
+       return new InsetMathXArrow(*this);
 }
 
 
index f76758c0d9191fb8ff44e21a7e94eb07217b9307..70df8f365b698a8e9cfad34fb20a565bae5f717c 100644 (file)
@@ -35,7 +35,7 @@ public:
        void validate(LaTeXFeatures & features) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        bool upper() const;
        ///
index 3449271568c848eda98c56995d22f1ab1facf3dd..884e78423bb9153659be15f8a06c1bfac944ea05 100644 (file)
@@ -28,9 +28,9 @@ InsetMathXYArrow::InsetMathXYArrow()
 {}
 
 
-std::auto_ptr<Inset> InsetMathXYArrow::clone() const
+Inset * InsetMathXYArrow::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetMathXYArrow(*this));
+       return new InsetMathXYArrow(*this);
 }
 
 
index baeef628c80ea9ec2d5095538db61b56800a1245..08faf9dea71b73ff612e25ab15d4ae7df7ece80a 100644 (file)
@@ -28,7 +28,7 @@ public:
        ///
        InsetMathXYArrow();
        ///
-       virtual std::auto_ptr<Inset> clone() const;
+       virtual Inset * clone() const;
        ///
        bool metrics(MetricsInfo & mi) const;
        ///
index 367d522e51fd28a15aebb383610be83704eac0be..ab1fe83d279452bf431ff6ed86359f643068493f 100644 (file)
@@ -25,9 +25,9 @@ InsetMathXYMatrix::InsetMathXYMatrix(Length const & s, char c)
 {}
 
 
-std::auto_ptr<Inset> InsetMathXYMatrix::doClone() const
+Inset * InsetMathXYMatrix::clone() const
 {
-       return std::auto_ptr<Inset>(new InsetMathXYMatrix(*this));
+       new InsetMathXYMatrix(*this);
 }
 
 
index 9afc176347806c947c81f419b4459f83cd081fde..d718c6240e160c86d6649706830d50bc6c50b9b6 100644 (file)
@@ -46,7 +46,7 @@ public:
        void validate(LaTeXFeatures & features) const;
 private:
        ///
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// extra spacing, may be empty
        Length spacing_;
        ///
index dfb4329bb81b5bc70850dacf4218e0db2fb581d9..cd476cdb29f5d9a3397332dfcf962a1cd8d75d52 100644 (file)
@@ -33,7 +33,7 @@ MathAtom::MathAtom(MathAtom const & at)
        : nucleus_(0)
 {
        if (at.nucleus_)
-               nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone().release());
+               nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone());
 }
 
 
index 260ab5138f442461ca69fb9b55ca7593a78e01a1..f4190ca9783ff95aad34fa32d2a618f42dd7b003 100644 (file)
@@ -57,9 +57,9 @@ using support::subst;
 
 using frontend::function_names;
 
+using std::auto_ptr;
 using std::endl;
 using std::find_if;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::swap;
@@ -361,7 +361,7 @@ void splitScripts(MathData & ar)
 
                // create extra script inset and move superscript over
                InsetMathScript * p = ar[i].nucleus()->asScriptInset();
-               auto_ptr<InsetMathScript> q(new InsetMathScript(true));
+               std::auto_ptr<InsetMathScript> q(new InsetMathScript(true));
                swap(q->up(), p->up());
                p->removeScript(true);
 
@@ -563,7 +563,7 @@ void extractFunctions(MathData & ar)
                extractScript(exp, jt, ar.end(), true);
 
                // create a proper inset as replacement
-               auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(name));
+               std::auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(name));
 
                // jt points to the "argument". Get hold of this.
                MathData::iterator st = extractArgument(p->cell(0), jt, ar.end(), true);
@@ -815,7 +815,7 @@ void extractDiff(MathData & ar)
                }
 
                // create a proper diff inset
-               auto_ptr<InsetMathDiff> diff(new InsetMathDiff);
+               std::auto_ptr<InsetMathDiff> diff(new InsetMathDiff);
 
                // collect function, let jt point behind last used item
                MathData::iterator jt = it + 1;
index f68529c8e071a635919fc9cce8e0926bcdca9a17..33582124a8327b777420d0f2d26f70082c8cc3a9 100644 (file)
@@ -28,9 +28,6 @@ namespace lyx {
 
 using std::string;
 using std::max;
-using std::auto_ptr;
-using std::endl;
-using std::vector;
 
 
 /// This class is the value of a macro argument, technically
@@ -48,15 +45,15 @@ public:
        int kerning() const { return mathMacro_.cell(idx_).kerning(); }
 
 private:
-       std::auto_ptr<Inset> doClone() const;
+       Inset * clone() const;
        MathMacro const & mathMacro_;
        size_t idx_;
 };
 
 
-auto_ptr<Inset> MathMacroArgumentValue::doClone() const
+Inset * MathMacroArgumentValue::clone() const
 {
-       return auto_ptr<Inset>(new MathMacroArgumentValue(*this));
+       return new MathMacroArgumentValue(*this);
 }
 
 
@@ -89,12 +86,12 @@ MathMacro::MathMacro(docstring const & name, int numargs)
 {}
 
 
-auto_ptr<Inset> MathMacro::doClone() const
+Inset * MathMacro::clone() const
 {
        MathMacro * x = new MathMacro(*this);
        x->expanded_ = MathData();
        x->macroBackup_ = MacroData();
-       return auto_ptr<Inset>(x);
+       return x;
 }
 
 
@@ -304,7 +301,7 @@ void MathMacro::updateExpansion() const
        MacroData const & macro = MacroTable::globalMacros().get(name());
 
        // create MathMacroArgumentValue object pointing to the cells of the macro
-       vector<MathData> values(nargs());
+       std::vector<MathData> values(nargs());
        for (size_t i = 0; i != nargs(); ++i)
                                values[i].insert(0, MathAtom(new MathMacroArgumentValue(*this, i)));
        macro.expand(values, expanded_);
index 1978df228e2efa74bffb9c60488f15217012a4ba..369819ec3636ad90776d0bbbafd76369db8f1ea5 100644 (file)
@@ -73,7 +73,7 @@ public:
        void infoize2(odocstream &) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        ///
        void updateExpansion() const;
 
index eb3d86a86d2412d293302f055d95a6e7482ae0b0..730d5aa3554c0f0095a6394ff7a62722c8e506d1 100644 (file)
@@ -20,9 +20,7 @@
 namespace lyx {
 
 using std::endl;
-using std::auto_ptr;
 using std::size_t;
-using std::vector;
 
 
 MathMacroArgument::MathMacroArgument(size_t n)
@@ -42,9 +40,9 @@ MathMacroArgument::MathMacroArgument(size_t n)
 }
 
 
-auto_ptr<Inset> MathMacroArgument::doClone() const
+Inset * MathMacroArgument::clone() const
 {
-       return auto_ptr<Inset>(new MathMacroArgument(*this));
+       new MathMacroArgument(*this);
 }
 
 
index bee2ccc7c8c7c440ab9233dbe4ad0bd1abb93f24..7813731ad42f4a8c92896ead9649a869602d80e7 100644 (file)
@@ -39,7 +39,7 @@ public:
        void write(WriteStream & os) const;
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// A number between 1 and 9
        std::size_t number_;
        ///
index e0fc3d63c6970448076c1bb3e6a0135daa3c13a4..5f1a6fff2afc573c1aa1c218e65965b834d9aa1b 100644 (file)
@@ -32,7 +32,6 @@ namespace lyx {
 
 using support::bformat;
 
-using std::auto_ptr;
 using std::ostream;
 using std::endl;
 
@@ -73,9 +72,9 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str)
 }
 
 
-auto_ptr<Inset> MathMacroTemplate::doClone() const
+Inset * MathMacroTemplate::clone() const
 {
-       return auto_ptr<Inset>(new MathMacroTemplate(*this));
+       return new MathMacroTemplate(*this);
 }
 
 
index c24fd16f80433e8b28ad8de6a64d7d6ae12abf9f..8a54a4eb011ab65cb2f723ea020276c172101212 100644 (file)
@@ -68,7 +68,7 @@ public:
        Inset::Code lyxCode() const { return MATHMACRO_CODE; }
 
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       virtual Inset * clone() const;
        /// prefix in inset
        docstring prefix() const;